Ejemplo n.º 1
0
        // ---- Redirection après traitement ------------ //
        if (1 == 1) {
            $page_redirection = "/admin/categorie/liste.php";
            if ($debug) {
                echo "Redirection vers " . $page_redirection;
            } else {
                header("Location: " . $page_redirection);
            }
            exit;
        }
        // ---------------------------------------------- //
    } else {
        if ($_POST["mon_action"] == "changer-ordre-categorie") {
            $categorie = new Categorie();
            try {
                $categorie->setChamp($_POST["id_categorie"], "ordre_affichage", $_POST["ordre_affichage"], $debug);
                if (!$debug) {
                    header("Location: /admin/categorie/liste.php");
                }
            } catch (Exception $e) {
                echo 'Erreur contactez votre administrateur <br> :', $e->getMessage(), "\n";
                $catproduct = null;
                exit;
            }
        }
    }
    //--------------------------------------------------------------------- //
} elseif ($_GET["action"] == 'delete') {
    try {
        $categorie = new Categorie();
        $result = $categorie->supprimer($_GET["id"], $debug);