* @author Axel Mainguy */ /** * Routeur Admin Index */ session_start(); $controller = ""; $action = ""; if (!empty($_GET['c']) && !empty($_GET['a'])) { $controller = $_GET['c']; $action = $_GET['a']; } if ($controller == "article" && $action == "add") { require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/article.php"; $controller_admin_addArticle = new Controller_Article(); $controller_admin_addArticle->addArticle(); // Page Ajout d'article } elseif ($controller == "article" && $action == "list") { require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/admin.php"; $controller_admin_listArticle = new Controller_Admin(); $controller_admin_listArticle->listeArticles(); // Page Liste d'article } elseif ($controller == "article" && $action == "delete") { if (empty($_GET['id'])) { echo "<p>Il manque l'identifiant du produit pour pouvoir supprimer l'article</p>"; } else { $id_articles = intval($_GET['id']); require_once $_SERVER['DOCUMENT_ROOT'] . "/ecommerce/controllers/article.php"; $controller_admin_deleteArticle = new Controller_Article(); $controller_admin_deleteArticle->deleteArticle($id_articles); }
$controller = ""; $action = ""; require_once $_SERVER['DOCUMENT_ROOT'] . '/boutique/admin/views/header.php'; if (!empty($_GET['c']) && !empty($_GET['a'])) { $controller = $_GET['c']; $action = $_GET['a']; } if ($controller == '' && $action == '') { require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/home_admin.php'; $articleUser = new Controller_Admin(); $articleUser->listLastArticleUser(); } elseif ($controller == "articles" && $action == "add") { require_once $_SERVER['DOCUMENT_ROOT'] . "/boutique/controllers/article.php"; $article = new Controller_Article(); $article->addArticle(); } elseif ($controller == 'categorie' && $action == 'add') { require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/categorie.php'; $categorie = new Controller_Categorie(); $categorie->addCatLic(); } elseif ($controller == 'admin' && $action == 'article') { require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/article.php'; $article = new Controller_Article(); $article->listArticleAdmin(); } elseif ($controller == 'admin' && $action == 'users') { require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/utilisateur.php'; $users = new Controller_Utilisateur(); $listUsers = $users->listUsersAdmin(); require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/admin/views/list_users.php'; } elseif ($controller == 'admin' && $action == 'modify') { require_once $_SERVER['DOCUMENT_ROOT'] . 'boutique/controllers/article.php';
} elseif ($controller == "user" && $action == "deconnexion") { require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/controllers/deconnexion.php"; $controllerDeconnexion = new Controller_Deconnexion(); $controllerDeconnexion->deconnexion(); } elseif ($controller == "user" && $action == "view") { require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/controllers/edit.php"; $controllerView = new Controller_Edit(); $controllerView->infoProfil(); } elseif ($controller == "user" && $action == "edit") { require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/controllers/edit.php"; $controllerEdit = new Controller_Edit(); $controllerEdit->edit(); } elseif ($controller == "article" && $action == "add") { require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/controllers/article.php"; $controller_Article = new Controller_Article(); $controller_Article->addArticle(); } elseif ($controller == "article" && $action == "delete") { require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/controllers/article.php"; $controller_Article = new Controller_Article(); $controller_Article->deleteArticle(); } elseif ($controller == "article" && $action == "detail") { $id = $_GET['id']; require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/controllers/article.php"; $controller_article = new Controller_Article(); $controller_article->detailArticle($id); } elseif ($controller == "article" && $action == "list") { require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/controllers/article.php"; $controller_article = new Controller_Article(); $controller_article->listArticle(); } elseif ($controller == "user" && $action == "list") { require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/controllers/inscription.php";