예제 #1
0
 function __construct($id)
 {
     $bdd = new Connector();
     $document = $bdd->Select("*", "document", array("where" => array(array("id", "=", $id))));
     if (!$document) {
         throw new LengthException("Le fichier n'existe pas");
     }
     $document = $document[0];
     $this->id = $document["id"];
     $this->rang = $document["rang"];
     $this->promo = $document["promo"];
     $this->libelle = $document["libelle"];
     $this->fichier = $document["fichier"];
     if (isset($document["promo"])) {
         $promo = new Promo($document["promo"]);
         $this->libelle_promo = $promo->getLibelle();
     }
 }
예제 #2
0
<?php

require_once "conf/top.php";
//$user = new User($_SESSION['user_session']);
include_once 'models/class.Promo.php';
$promo = new Promo($_REQUEST['id']);
echo $twig->render("modif_promo.html.twig", array("id" => $promo->getId(), "libelle" => $promo->getLibelle(), "mail" => $promo->getMail()));
if (isset($_REQUEST['submit'])) {
    if (isset($_REQUEST['nom']) && isset($_REQUEST['email'])) {
        $db = Database::getInstance();
        $promo = new Promo();
        $promo->updatePromo($_REQUEST['id'], $_REQUEST['nom'], $_REQUEST['email']);
        header('Location: promo_list.php');
    }
}
예제 #3
0
<?php

require_once "conf/top.php";
include_once 'models/class.Promo.php';
$promo = new Promo($_REQUEST['id']);
$user_list = new User();
echo $twig->render("add_user_promo.html.twig", array("user_list" => $user_list->getAllNoneAttributePromo(), "libelle_promo" => $promo->getLibelle(), "id_promo" => $promo->getId()));
if (isset($_REQUEST['submit'])) {
    $db = Database::getInstance();
    foreach ($_REQUEST['list_eleve'] as $e) {
        $promo->add_user_promo($e, $_REQUEST['id']);
    }
    header('Location: promo_list.php');
}