Exemplo n.º 1
0
<?php

// Controleur secondaire - blog/index
// Afficher les bons articles en fonction de la page
if (!isset($_GET["page"])) {
    $page = 1;
} else {
    // Ajouter des tests
    $page = $_GET["page"];
}
$offset = ($page - 1) * MAXART;
include_once "modele/blog/lire_articles.php";
include_once "modele/blog/lire_categories.php";
$articles = lire_articles();
$categories = lire_categories();
//$articles = lire_articles($offset, MAXART);
include_once "vue/blog/index.php";
Exemplo n.º 2
0
<?php

// Controleur secondaire - back-office/gestion_articles
if (!isset($_SESSION["admin"])) {
    header('Location:?module=admin&action=login_admin');
} else {
    if (isset($_GET["id"])) {
        $id = $_GET["id"];
        include "modele/blog/suppr_categorie.php";
        if (suppr_categorie($id) == true) {
            header("Location:?module=blog&action=gestion_categories&del=ok");
        } else {
            header("Location:?module=blog&action=gestion_categories&del=nok");
        }
    }
    include_once "modele/blog/gestion_categories.php";
    $retour_cat = lire_categories();
    include_once "vue/blog/gestion_categories.php";
}