} $result = getCategorie(0); $page = "admin_categories_liste"; } break; case "update": $result = getCategorie($get_id); if (!$categorie_titre) { if ($post_submit) { if (!$categorie_titre) { $msg .= "<p class='text-red'><i class='fa fa-long-arrow-right'></i> Titre obligatoire</p>"; } } $page = "admin_categories_update"; } else { $update = updateCategorie($categorie_titre, $get_id); if ($update) { $msg .= "<div class='box-body'><div class='alert alert-success alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button><h4><i class='icon fa fa-check'></i> Alert!</h4>Catégorie modifiée avec succès.</div></div>\n"; } else { $msg .= "<div class='box-body'><div class='alert alert-danger alert-dismissable'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button><h4><i class='icon fa fa-ban'></i> Alert!</h4>Oupsss... problème lors de l'ajout d'une catégorie.</div></div>\n"; } $result = getCategorie(0); $page = "admin_categories_liste"; } break; case "delete": $delete = deleteCategorie($get_id); if ($delete) { $msg .= "<p><b class='fond_ok'><i class='fa fa-thumbs-o-up'></i> Suppression effectuée avec succès.</b></p>\n"; } else { $msg .= "<p><b class='fond_pas_ok'><i class='fa fa-exclamation-triangle'></i> Oupsss... problème lors de la suppression....</b></p>\n";
$categorieomschrijving = filter_var(trim($_POST['categorieomschrijving']), FILTER_SANITIZE_STRING); addCategorie($categorie, $categorieomschrijving, $niveau); } } } //CATEGORIE WIJZIGEN if (isset($_POST['categorieopslaan'])) { if (isset($_POST['categorie'], $_POST['categorieomschrijving'], $_POST['niveau'])) { if ($_POST['categorie'] == "" or $_POST['categorieomschrijving'] == "" or $_POST['niveau'] == "") { $_SESSION['message'] = 'Je moet alle gegevens invullen!'; } else { $categorie_id = filter_var(trim($_POST['categorieid']), FILTER_SANITIZE_STRING); $categorie = filter_var(trim($_POST['categorie']), FILTER_SANITIZE_STRING); $niveau = filter_var(trim($_POST['niveau']), FILTER_SANITIZE_STRING); $categorieomschrijving = filter_var(trim($_POST['categorieomschrijving']), FILTER_SANITIZE_STRING); updateCategorie($categorie, $categorieomschrijving, $categorie_id, $niveau); } } } } ?> <?php include ROOT_PATH . "includes/templates/header.php"; ?> <?php include ROOT_PATH . "includes/templates/sidebar-admin.php"; ?> <!-- main --> <div class="col"> <!-- main header -->
$categorie = filter_var(trim($_POST['categorie']), FILTER_SANITIZE_STRING); $categorieomschrijving = filter_var(trim($_POST['categorieomschrijving']), FILTER_SANITIZE_STRING); addCategorie($categorie, $categorieomschrijving); } } } //CATEGORIE WIJZIGEN if (isset($_POST['categorieopslaan'])) { if (isset($_POST['categorie'], $_POST['categorieomschrijving'])) { if ($_POST['categorie'] == "" or $_POST['categorieomschrijving'] == "") { $_SESSION['message'] = 'Je moet alle gegevens invullen!'; } else { $categorie_id = filter_var(trim($_POST['categorieid']), FILTER_SANITIZE_STRING); $categorie = filter_var(trim($_POST['categorie']), FILTER_SANITIZE_STRING); $categorieomschrijving = filter_var(trim($_POST['categorieomschrijving']), FILTER_SANITIZE_STRING); updateCategorie($categorie, $categorieomschrijving, $categorie_id); } } } } ?> <?php include ROOT_PATH . "includes/templates/header.php"; ?> <div class="wrapper"> <?php include ROOT_PATH . "includes/templates/sidebar-admin.php"; ?> <div class="page-wrapper"> <div class="container-fluid">