diff --git a/assests/img/error403.jpg b/assests/img/error403.jpg new file mode 100644 index 0000000..ddb9376 Binary files /dev/null and b/assests/img/error403.jpg differ diff --git a/assests/img/error404.webp b/assests/img/error404.webp new file mode 100644 index 0000000..1fb29eb Binary files /dev/null and b/assests/img/error404.webp differ diff --git a/controllers/admin_controller.php b/controllers/admin_controller.php index 5fd9e56..b98252b 100644 --- a/controllers/admin_controller.php +++ b/controllers/admin_controller.php @@ -25,7 +25,6 @@ header("Location:index.php?ctrl=error&action=error_403"); exit; } - var_dump($_SESSION); //gestion de l'user $objCategoryModel = new CategoryModel; @@ -44,6 +43,7 @@ $editCat->setId($_POST['id_to_edit']); $editCat->setName($_POST['new_name']); $objCategoryModel->editCategory($editCat); + $_SESSION['success'] = "La catégorie a bien été modifiée"; header('Location: index.php?ctrl=admin&action=admin'); exit; } diff --git a/controllers/error_controller.php b/controllers/error_controller.php new file mode 100644 index 0000000..4ebead6 --- /dev/null +++ b/controllers/error_controller.php @@ -0,0 +1,24 @@ +_display("error_404"); + } + + /** + * Page erreur 403 + */ + public function error_403(){ + $this->_display("error_403"); + } + + } \ No newline at end of file diff --git a/index.php b/index.php index 320007f..4013681 100644 --- a/index.php +++ b/index.php @@ -12,7 +12,7 @@ $boolError = false; $strFileName = "./controllers/".$strCtrl."_controller.php"; - + if(file_exists($strFileName)){ require($strFileName); $strClassName = ucfirst($strCtrl)."Ctrl"; @@ -31,6 +31,6 @@ } if($boolError){ - echo "error 404 - la page elle existe pas "; + header("Location:index.php?ctrl=error&action=error_404"); } diff --git a/views/_partial/preview.tpl b/views/_partial/preview.tpl index 82de7b3..128d866 100644 --- a/views/_partial/preview.tpl +++ b/views/_partial/preview.tpl @@ -3,21 +3,24 @@ {* IMAGE (partie supérieure - plus grande) *}
Changer le statut ou supprimer un utilisateur