Ejemplo n.º 1
0
<?php

require '../../modele/categorie/categorie.php';
require '../../modele/connexion/connexionBd.php';
session_start();
$categorie = $_POST["categorie"];
//$image = $_POST["image"];
$maCategorie = new Categorie($categorie);
$maCategorie->ajoutCategorie();
$msg = "Categorie ajouté";
include '../../vue/formulaire/Info.php';
<?php

$path = "../";
require_once $path . "includes/session.php";
require $path . "Modele/Categorie.class.php";
if (isset($_POST['ajout_categorie'])) {
    Categorie::ajoutCategorie($_POST['nom_categorie']);
    header("Location: " . $path . "Vue/ajout_categorie_vue.php");
} else {
    if (isset($_GET['supprNom'])) {
        Categorie::supprimerCategorie($_GET['supprNom']);
        header("Location: " . $path . "Vue/administration_vue.php");
    } else {
        if (isset($_POST['modif_categorie'])) {
            Categorie::modifierCategorie($_POST['nom_categorie'], $_POST['oldName']);
            header("Location: " . $path . "Vue/administration_vue.php");
        }
    }
}