if (empty($_GET['id'])) { echo "<p>Il manque l'identifiant de la news</p>"; } else { $id_news = intval($_GET['id']); require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/news.php"; $controller_news = new Controller_News(); $controller_news->deleteNews($id_news); } // Page Suppression des news } elseif ($controller == "news" && $action == "update") { if (empty($_GET['id'])) { echo "<p>Il manque l'identifiant de la news</p>"; } else { $id_news = intval($_GET['id']); require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/news.php"; $controller_news = new Controller_News(); $controller_news->updateNews($id_news); } // Page Modification des news } elseif ($controller == "categories" && $action == "list") { require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/categorie.php"; $controller_categorie = new Controller_Categorie(); $controller_categorie->listeCategories(); // Page Liste des categories } elseif ($controller == "categories" && $action == "add") { require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/categorie.php"; $controller_admin_createCateg = new Controller_Categorie(); $controller_admin_createCateg->createCategorie(); // Page Ajout de categorie } elseif ($controller == "categories" && $action == "delete") { if (empty($_GET['id'])) {
} elseif ($controller == "user" && $action == "commande") { require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/users.php"; $controller_commandeuser = new Controller_Users(); $controller_commandeuser->commandeuser(); } elseif ($controller == "shop" && $action == "panier") { require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/panier.php"; $controller_listpanier = new Controller_Panier(); $controller_listpanier->viewPanier(); } elseif ($controller == "panier" && $action == "add") { if (empty($_GET['id'])) { echo "<p>Il manque l'identifiant du produit</p>"; } else { $id_articles = intval($_GET['id']); require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/panier.php"; $controller_listpanier = new Controller_Panier(); $controller_listpanier->addPanier($id_articles); } } elseif ($controller == "" && $action == "") { require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/news.php"; $controller_news = new Controller_News(); $controller_news->listNews(); } elseif ($controller == "news" && $action == "view") { if (empty($_GET['id'])) { echo "<p>Il manque l'identifiant de la news</p>"; } else { $id_news = intval($_GET['id']); require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/news.php"; $controller_article = new Controller_News(); $controller_article->viewNews($id_news); } }