<link rel="stylesheet" href="../../css/bootstrap.css">
        <title></title>
    </head>
    <body>
        
        <?php 
require_once '../../includes/session-start.php';
require_once '../../includes/access-required.html.php';
include_once '../../functions/dbConn.php';
include_once '../../functions/categoryFunctions.php';
include_once '../../functions/productsFunctions.php';
include_once '../../functions/until.php';
$results = '';
if (isPostRequest()) {
    $category = filter_input(INPUT_POST, 'category');
    if (isValidCategory($category) == true) {
        createCategory($category);
        $results = 'Category added';
    } else {
        $results = 'Category is not valid';
    }
}
?>
            
    <center>
        <h1>Add Category</h1><br/>
        
    
        <form method="post" action="#">
            <div class="form-group">
            Category Name : <input type="text" name="category" value="" /><br/><br/>
Esempio n. 2
0
include '../../functions/utils-function.php';
?>
        <!-- Latest compiled and minified CSS -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

        <!-- Optional theme -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
    </head>
    <body>
        <?php 
require_once '../../includes/session-start.req-inc.php';
require_once '../../includes/access-required.html.php';
if (isPostRequest()) {
    $category = filter_input(INPUT_POST, 'category');
    $errors = array();
    if (!isValidCategory($category)) {
        $errors[] = 'Category is not valid';
    }
    if (count($errors) == 0) {
        if (createCategory($category)) {
            $results = 'Category added';
        } else {
            $results = 'Category was not added';
        }
    }
}
?>
        
         <h1>Add Category</h1>
        
          <?php 
Esempio n. 3
0
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title></title>
        <link href="../../css/bootstrap.min.css" rel="stylesheet">
    </head>
    <body>
        <?php 
require_once '../../includes/session-start.req-inc.php';
require_once '../../includes/access-required.html.php';
include_once '../../functions/dbconnect.php';
include_once '../../functions/category_functions.php';
include_once '../../functions/util.php';
$categories = getAllCategories();
if (isPostRequest()) {
    $newCategory = filter_input(INPUT_POST, 'newCategory');
    $oldCategoryID = filter_input(INPUT_POST, 'category_id');
    if (isValidCategory($newCategory)) {
        if (updateCategory($newCategory, $oldCategoryID)) {
            $results = 'Category updated';
        } else {
            $results = 'Category was not updated';
        }
    } else {
        $results = 'Category is not valid';
    }
}
?>

        
        <h1>Update Category</h1>
        
        <?php