Exemple #1
0
session_start();
if (!empty($_GET['c']) && !empty($_GET['a'])) {
    $controller = $_GET['c'];
    $action = $_GET['a'];
}
//si les champs sont vide nous envois à la page d'accueil
if ($controller == "" && $action == "") {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/views/home.php";
} elseif ($controller == "article" && $action == "Enceinte") {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/controllers/article.php";
    $controller_article = new Controller_Article();
    $controller_article->listArticleEnceinte();
} elseif ($controller == "article" && $action == "Amplificateur") {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/controllers/article.php";
    $controller_article = new Controller_Article();
    $controller_article->listArticleAmplificateur();
} elseif ($controller == "article" && $action == "Platine CD") {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/controllers/article.php";
    $controller_article = new Controller_Article();
    $controller_article->listArticlePlatineCD();
} elseif ($controller == "article" && $action == "Tracer") {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/controllers/article.php";
    $controller_article = new Controller_Article();
    $controller_article->listArticleTracer();
} elseif ($controller == "article" && $action == "view") {
    if (empty($_GET['id'])) {
        echo "<p>il manque l'id du produit</p>";
    } else {
        require_once $_SERVER['DOCUMENT_ROOT'] . "/imie/boutique/controllers/article.php";
        $controller_Article = new Controller_Article();
        $id = intval($_GET['id']);