Ejemplo n.º 1
0
<?php

require_once "conf/top.php";
//$user = new User($_SESSION['user_session']);
include_once 'models/class.Cours.php';
if (!empty($_REQUEST['did']) && !empty($_REQUEST['cid'])) {
    $cours = new Cours($_REQUEST['cid']);
    $cours->unHide($_REQUEST['did'], $_REQUEST['cid']);
    $session->redirect('mes_cours.php');
}
Ejemplo n.º 2
0
<?php

require_once "conf/top.php";
include_once "models/class.Cours.php";
include_once "models/class.Doc.php";
include_once "models/class.Year.php";
include_once "models/class.Promo.php";
include_once "models/class.DocShared.php";
$cours = new Cours($_REQUEST['id']);
echo $twig->render("modif_desc.html.twig", array("cours" => $cours, "desc" => $cours->getDesc()));
if (isset($_REQUEST['submit'])) {
    if (isset($_REQUEST['desc'])) {
        $db = Database::getInstance();
        $cours->updateDesc($_REQUEST['desc']);
        header('Location: mes_cours.php');
    }
}
Ejemplo n.º 3
0
<?php

require_once "conf/top.php";
include_once "models/class.Cours.php";
include_once "models/class.Doc.php";
include_once "models/class.Year.php";
include_once "models/class.Promo.php";
include_once "models/class.DocShared.php";
$cours = new Cours();
$doc = new Doc();
$docS = new DocShared();
$promo = new Promo();
$semestre = 1;
if ($semestre == 1) {
    if ($level == 1 || $level == 2) {
        $cours_l = $cours->CoursListProfS1($userid);
        $doc_l = $docS->allyeardocProfS1($userid);
    } else {
        $promo_id = $promo->user_promo_id($userid);
        $cours_l = $cours->CoursListPS1($promo_id[0]['promo_id']);
        $doc_l = $docS->allyeardocS1($promo_id[0]['promo_id']);
    }
} else {
    if ($level == 1 || $level == 2) {
        $cours_l = $cours->CoursListProfS2($userid);
        $doc_l = $docS->allyeardocProfS2($userid);
    } else {
        $promo_id = $promo->user_promo_id($userid);
        $cours_l = $cours->CoursListPS2($promo_id[0]['promo_id']);
        $doc_l = $docS->allyeardocS2($promo_id[0]['promo_id']);
    }
Ejemplo n.º 4
0
<?php

require_once "conf/top.php";
//$user = new User($_SESSION['user_session']);
include_once 'models/class.Cours.php';
if (!empty($_REQUEST['did']) && !empty($_REQUEST['cid'])) {
    $cours = new Cours($_REQUEST['cid']);
    $cours->delierCours($_REQUEST['did'], $_REQUEST['cid']);
    $session->redirect('mes_cours.php');
}
Ejemplo n.º 5
0
 /** Fonction qui remplis un tableau de cours.
  *  Utilise icalendar.
  */
 public function getCours()
 {
     /* Parse l'ics*/
     $nb = 0;
     $tab = array();
     $ical = new SG_iCalReader($this->ICS);
     $query = new SG_iCal_Query();
     $evts = $ical->getEvents();
     $data = array();
     if (!is_array($evts)) {
         echo "ERREUR, d'initialisation des evenements.";
         echo '<br>$evts= ' . $evts;
     }
     foreach ($evts as $id => $ev) {
         $jsEvt = array("id" => $id + 1, "title" => $ev->getProperty('summary'), "start" => $ev->getStart(), "end" => $ev->getEnd(), "allDay" => $ev->isWholeDay(), "location" => $ev->getProperty('location'), "description" => $ev->getProperty('description'));
         if (isset($ev->recurrence)) {
             $count = 0;
             $start = $ev->getStart();
             $freq = $ev->getFrequency();
             if ($freq->firstOccurrence() == $start) {
                 $data[] = $jsEvt;
             }
             while (($next = $freq->nextOccurrence($start)) > 0) {
                 if (!$next or $count >= 1000) {
                     break;
                 }
                 $count++;
                 $start = $next;
                 $jsEvt["start"] = $start;
                 $jsEvt["end"] = $start + $ev->getDuration();
                 $data[] = $jsEvt;
             }
         } else {
             $data[] = $jsEvt;
         }
         $String2 = htmlentities($jsEvt["description"], ENT_QUOTES, "UTF-8");
         $String = nl2br($String2);
         $sum = htmlentities($jsEvt["title"], ENT_QUOTES, "UTF-8");
         $sum2 = nl2br($sum);
         $Matiere = between('Mati&egrave;re : ', '<br />', $String);
         $prof = between('Personnel : ', '<br />', $String);
         $promo = between('Groupe : ', 'Groupe ', $String);
         $tmp = between('Groupe :', 'Salle ', $String);
         $sous_groupe = rtrim(trim(stripslashes(after('-', $tmp))));
         if ($sous_groupe == "") {
             $sous_groupe = "0";
         }
         $tabGroupe = array();
         $promo = trim($promo);
         $tmp_groupe = between('Groupe :', 'Salle', $String2);
         //--> 'INFO 2 Groupe 2\, INFO 2 Groupe 3'
         // echo $tmp.'<br/>';
         $tmp_tab = explode(",", $tmp_groupe);
         foreach ($tmp_tab as $g) {
             if (strpos($g, 'TP') !== FALSE) {
                 $tmp = between("TP ", "-", $String2);
             } else {
                 $tmp = after($promo . ' Groupe ', $g);
                 $tmp = trim(stripslashes($tmp));
                 // Enlève antislash et les espaces
                 if ($tmp == "") {
                     $tmp = "0";
                 }
             }
             array_push($tabGroupe, $tmp);
         }
         $type = before(' -', $sum2);
         $salle = between('Salle : ', '<br />', $String);
         $date_debut = $jsEvt['start'];
         $date_fin = $jsEvt['end'];
         $date = new DateTime('@' . $date_debut);
         /* Instancie les BEANs*/
         $cours = new Cours();
         $cours->setDateDebut($date_debut);
         $cours->setMatiere($Matiere);
         $cours->setDateFin($date_fin);
         $cours->setType($type);
         $cours->setProf($prof);
         $cours->setSalle($salle);
         foreach ($tabGroupe as $g) {
             $Groupe = new Groupe();
             $Groupe->setSousGroupe($sous_groupe[0]);
             $Groupe->setNumero($g);
             $Groupe->setPromo($promo);
             $cours->setGroupe($Groupe);
         }
         $cours->setId();
         $tab[$nb++] = $cours;
         sort($tab);
         // Noé
         array_push($this->tab_cours, $cours);
     }
 }
Ejemplo n.º 6
0
 public function testGetTailleRowspanExceptionel1()
 {
     $dao = new Dao();
     $cours = new Cours();
     $cours->setDateDebut("1443166200");
     $cours->setDateFin("1443166200");
     $groupe = new Groupe();
     $groupe->setNumero("INFO 2 Groupe 3");
     $cours->setGroupe($groupe);
     $oracle = 1;
     $this->assertEquals($oracle, $dao->getTailleRowspan($cours));
 }
Ejemplo n.º 7
0
<?php

require_once "conf/top.php";
include_once 'models/class.Year.php';
include_once 'models/class.Cours.php';
$annee = new Year();
$cours = new Cours();
$annee_list = $annee->getAll();
$cours_list_s1 = $cours->coursListS1();
$cours_list_s2 = $cours->coursListS2();
echo $twig->render("cours.html.twig", array("annee" => $annee_list, "cours_s1" => $cours_list_s1, "cours_s2" => $cours_list_s2));
Ejemplo n.º 8
0
<?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));
Ejemplo n.º 9
0
            if ($coursCateg != $categorieDuTutoriel) {
                $cours->deplacer_element($coursCateg, $dataCours, $member);
            }
            $error = new error();
            $error->add_error(translate('cours_move_okay'), ERROR_PAGE, __FILE__, __LINE__);
        }
        break;
    case 'afficherTutoriel':
        $idTutoriel = intval($_GET['idTutoriel']);
        $cours = new Cours($idTutoriel);
        break;
}
tpl_begin();
switch ($action) {
    case 'voirArborescence':
        $cours = new Cours();
        $cours->racine()->elements_enfants_arborescence();
        break;
    case 'afficherTutoriel':
        $cours->affiche_cours();
        break;
    case 'voirListeTous':
        $dataCours = $cours->recupere_cours();
        ?>
		<table>
			<tr>
				<th>Nom</th>
				<th>Actions</th>
			</tr>
		<?php 
        foreach ($dataCours as $v) {
Ejemplo n.º 10
0
include 'Matiere.class.php';
include 'Seance.class.php';
include 'Section.class.php';
include 'Sous_groupe.class.php';
include 'Etudiant.class.php';
include 'Absent.class.php';
echo "Prof(s) : </br>";
$prof = new Prof(1, "Laroche", "Pierre", "*****@*****.**", 0);
echo $prof->getNo_prof() . "</br>";
echo $prof->getNom() . "</br>";
echo $prof->getPrenom() . "</br>";
echo $prof->getEmail() . "</br>";
echo $prof->getEnvoiCodes() . "</br>";
echo $prof . "</br>";
echo "Cour(s) : </br>";
$cour = new Cours(1, 1, 1, 1);
echo $cour->getNo_cours() . "</br>";
echo $cour->getNo_prof() . "</br>";
echo $cour->getNo_type() . "</br>";
echo $cour->getNo_matiere() . "</br>";
echo $cour . "</br>";
echo "Type(s) : </br>";
$type = new Type(1, "CM");
echo $type->getNo_type() . "</br>";
echo $type->getNom() . "</br>";
echo $type . "</br>";
echo "Matiere(s) : </br>";
$matiere = new Matiere(1, "Base de données", "BdD", 1, 1);
echo $matiere->getNo_matiere() . "</br>";
echo $matiere->getNom() . "</br>";
echo $matiere->getInitiales() . "</br>";