<?php // Contrôleur de l'affichage hors connexion // dependencies require 'model/MaPDOClass.php'; require 'model/Periode.php'; require 'model/Livre.php'; require 'model/Ecrivain.php'; // managers require 'model/PeriodeManager.php'; require 'model/LivreManager.php'; require 'model/EcrivainManager.php'; $periode_m = new PeriodeManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE)); $ecrivain_m = new EcrivainManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE)); $livre_m = new LivreManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE)); $obj = $periode_m->recupUn(1); var_dump($obj); $obj = $ecrivain_m->recupUn(1); var_dump($obj); $obj = $livre_m->recupUn(1); var_dump($obj); header('Content-Type: text/html; charset=utf-8');
header('Location: ./'); } if (isset($_GET['dellivre'])) { // traitement suppression livres $id = (int) $_GET['dellivre']; $livre_a_m = new LivreAdminManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE)); $livre_a_m->deleteBook($id); header('Location: ./'); } } // chargement des dépendances pour modifications if (isset($_GET['mod']) xor isset($_GET['modlivre'])) { if (isset($_GET['mod'])) { $id = (int) $_GET['mod']; $ecrivain_m = new EcrivainManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE)); $ecrivain = $ecrivain_m->recupUn($id); $periode_m = new PeriodeManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE)); $siecles = $periode_m->recupTous(); } if (isset($_GET['modlivre'])) { $ecrivain_m = new EcrivainAdminManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE)); $ecrivains = $ecrivain_m->recupTous(); $id = (int) $_GET['modlivre']; $livre_m = new LivreManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE)); $livre = $livre_m->recupUn($id); } } // traitement des modifications if (isset($_POST['submitmodifierecrivain']) xor isset($_POST['submitmodifierlivre'])) { // traitement modification écrivain if (isset($_POST['submitmodifierecrivain'])) {