コード例 #1
0
ファイル: admin.php プロジェクト: bsamel/best_lyon
include_once "navigation_admin.php";
?>
		
		<section id="administration_panel">
			<?php 
//factory qui crée un tableau d'objets à administrer selon la valeur du paramètre $_GET['page']
if (isset($_GET["page"])) {
    if (isset($_GET["mode"]) && is_numeric($_GET["mode"])) {
        if ($_GET["mode"] == 1) {
            $content = ContentFactory::build($_GET["page"]);
            echo "<h1>Contenu &agrave; ajouter : <h1>";
            $content->form_add->display("treatment.php?mode=1", "post");
        } else {
            $pdo_singleton = new PDOSingleton();
            if (isset($_GET['id']) && is_numeric($_GET['id'])) {
                $content = ContentFactory::build($_GET["page"], $_GET["id"]);
                echo "<h1>Contenu &agrave; modifier : <h1>";
                $content->form_modify->display("treatment.php?mode=2", "post");
            } else {
                $array = ContentFactory::buildArray($_GET["page"]);
                echo "<h1>Contenu disponible : <h1>";
                $array->display_list();
            }
        }
    }
} else {
    echo "<h1>Bienvenue sur l'espace d'administration</h1>";
}
?>
		</section>