Exemplo n.º 1
0
 public function __construct()
 {
     $this->db = MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, true);
 }
Exemplo n.º 2
0
 public function __construct($dsn, $util, $pass, $erreur = false)
 {
     // on se connecte en utilisant la méthode statique de ma MaPDO
     $this->db = MaPDO::getConnection($dsn, $util, $pass, $erreur);
 }
Exemplo n.º 3
0
<?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');
Exemplo n.º 4
0
} elseif (isset($_GET['idecrivain'])) {
    // require all links in menu
    $periode_m = new PeriodeManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE));
    $menu = $periode_m->recupTous();
    // récupération de l'écrivain en question
    $id = (int) $_GET['idecrivain'];
    $ecrivain_a_m = new EcrivainAdminManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE));
    $ecrivain = $ecrivain_a_m->recupJointure($id);
    $ids = explode('||', $ecrivain['ids']);
    $titres = explode('||', $ecrivain['titres']);
    $descriptions = explode('||', $ecrivain['descriptions']);
    include 'view/ecrivain.php';
} elseif (isset($_GET['idlivre'])) {
    // require all links in menu
    $periode_m = new PeriodeManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE));
    $menu = $periode_m->recupTous();
    // récupération du livre
    $id = (int) $_GET['idlivre'];
    $livre_m = new LivreManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE));
    $livre = $livre_m->recupUn($id);
    include 'view/livre.php';
} else {
    // accueil
    // require all links in menu
    $periode_m = new PeriodeManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE));
    $menu = $periode_m->recupTous();
    // random writer
    $ecrivain_m = new EcrivainManager(MaPDO::getConnection(DB_SELECT, DB_USER, DB_PWD, TRUE));
    $ecrivain_random = $ecrivain_m->recupUnRandom();
    include 'view/accueil.php';
}
Exemplo n.º 5
0
 public function __construct()
 {
     $this->db = MaPDO::getConnection($dsn, $util, $pass, $erreur);
 }