<?php use Evengyl\module\Construct_categ; if(!isset($_GET['categ_id']) && !isset($_GET['id_sub_categ'])) { $__categories_list = Construct_categ::db_get_category_and_sub();?> <div class="<?php echo ($_GET['page'] == 'home' || !isset($_GET['page']))?"col-lg-10":"col-lg-12";?>"> <div class="col-lg-12 col-without-padding" style="padding-bottom: 15px; border:1px solid #337AB7;"> <h1 style="padding:5px; background:#337AB7; padding-left:50px; margin-top:0px; margin-bottom: 15px; font-size: 30px; color:white;"><?php echo $current_categ; ?></h1><? foreach($__categories_list as $categ) {?> <div class="col-sm-6 col-md-4 col-lg-3"> <div class="thumbnail"> <img src="http://placehold.it/350x150" alt="..."> <div class="caption"> <?php echo "<h3>" . $categ->name. "</h3>"; ?> <p><?php echo $categ->description; ?></p> <p><?php if(isset($categ->sub_category)) { foreach($categ->sub_category as $sub_categ) { echo $sub_categ->name; } } ?> </p> </div> </div>
// system de contenu ob_start(); if ($page == 'category') { if (!isset($_GET['categ_id']) && !isset($_GET['id_sub_categ'])) { //si on n'a pas d'id de categ ni d'id de sub categ c'est que l'on doit afficher uniquement la listes des categ $title_page = 'List of category'; $current_categ = 'Category'; require "../content/show_category.php"; } else { if (isset($_GET['categ_id']) && !isset($_GET['id_sub_categ'])) { //Si on a un id de catégorie mais pas de sub categ id , on affiche la listes des sub categ $name_page = Construct_categ::db_get_name_current_categ($_GET['categ_id']); $title_page = $name_page[0]->name_categ; require "../content/show_sub_category.php"; } else { if (isset($_GET['categ_id']) && $_GET['categ_id'] != "" && isset($_GET['id_sub_categ']) && $_GET['id_sub_categ'] != "" && !isset($_GET['id_article'])) { // si on possède un id de categ un id de sub catg ,on affiche l'ensemble des articles associés a cette manip $name_page = Construct_categ::db_get_name_current_subcateg($_GET['id_sub_categ']); $title_page = 'List articles of ' . $name_page[0]->name_sub_categ; require "../content/show_list_articles.php"; } else { if (isset($_GET['categ_id']) && $_GET['categ_id'] != "" && isset($_GET['id_sub_categ']) && $_GET['id_sub_categ'] != "" && isset($_GET['id_article']) && $_GET['id_article'] != "") { // si on possède un id de categ un id de sub catg ,et un id d'article , on affiche directement l'article associé a cette id require "../content/show_articles.php"; } } } } } $content = ob_get_clean(); require_once "../content/templates/default.php";