<?php require_once "conf/top.php"; include_once 'models/class.Year.php'; include_once 'models/class.Cours.php'; include_once 'models/class.Semestre.php'; $annee = new Year(); $cours = new Cours(); $semestre = new Semestre(); $prof = $user->getProfAdmin(); $annee_list = $annee->AnneeList(); $semestre = $semestre->getAll(); if (isset($_REQUEST['submit'])) { if (isset($_REQUEST['nom']) && isset($_REQUEST['description']) && isset($_REQUEST['prof']) && isset($_REQUEST['semestre']) && isset($_REQUEST['annee'])) { $nom = $_REQUEST['nom']; $desc = $_REQUEST['description']; $profid = $_REQUEST['prof']; $a_id = $_REQUEST['annee']; $sem = $_REQUEST['semestre']; $cours->new_cour($nom, $desc, $profid, $a_id, $sem); $session->redirect('cours.php'); } } echo $twig->render("new_cour.html.twig", array("annee" => $annee_list, "prof" => $prof, "semestre" => $semestre));