} // CSS et js particulier à l'EdT $javascript_specifique = "edt_organisation/script/fonctions_edt"; $ua = getenv("HTTP_USER_AGENT"); if (strstr($ua, "MSIE 6.0")) { $style_specifique = "templates/" . NameTemplateEDT() . "/css/style_edt_ie6"; } else { $style_specifique = "templates/" . NameTemplateEDT() . "/css/style_edt"; } //=========================== GESTION DES PERIODES if (PeriodesExistent()) { if ($period_id != NULL) { $_SESSION['period_id'] = $period_id; } if (!isset($_SESSION['period_id'])) { $_SESSION['period_id'] = ReturnIdPeriod(date("U")); } if (!PeriodExistsInDB($_SESSION['period_id'])) { $_SESSION['period_id'] = ReturnFirstIdPeriod(); } $DisplayPeriodBar = true; } else { $DisplayPeriodBar = false; $_SESSION['period_id'] = 0; } //=========================== CONSTRUCTION DES EDT if ($_SESSION['statut'] == "eleve") { $tab_data = ConstruireEDTEleve($_SESSION['login'], $_SESSION['period_id']); $entetes = ConstruireEnteteEDT(); $creneaux = ConstruireCreneauxEDT(); $DisplayEDT = true;
$query->filterByIdAid($current_aid->getId()); } if ($current_groupe != null) { $query->filterByIdGroupe($current_groupe->getId()); } if ($current_classe != null) { $query->filterByIdClasse($current_classe->getId()); } $query->filterByUtilisateurProfessionnel($utilisateur); $nb_creneau_a_saisir=0; foreach ($afficheEleve as &$eleveCourant) { $login_e =$eleveCourant['accesFiche']; $periode = ReturnIdPeriod($dt_date_absence_eleve->format('U')); $tab_enseignement_final = array(); $cpt = 0; $cptSeq = 0; $decalage = 0; $dureeCreneau = 0; $echap = 0; $pause = 0; while ((($cptSeq +1) / 2) < count($tableCreneau)) { if ('pause' == $tableCreneau[intval ($cptSeq / 2)]['typeCreneau']) { $eleveCourant['sequence'][$cptSeq]['duree'] = 'Pause'; $cptSeq++ ; $eleveCourant['sequence'][$cptSeq]['duree'] = 'Pause'; $cptSeq++ ; }
/** * Renvoie l'id de la période précédant celle passée en argument * @param int $current_id_period * @return int * @see ReturnIdPeriod() */ function ReturnPreviousIdPeriod($current_id_period) { global $mysqli; $sql_periode = "SELECT * FROM edt_calendrier ORDER BY debut_calendrier_ts DESC"; $endprocess = FALSE; $retour = ReturnIdPeriod(date("U")); $req_periode = mysqli_query($mysqli, $sql_periode); while ($rep_periode = $req_periode->fetch_object() and !$endprocess) { if ($rep_periode->id_calendrier == $current_id_period) { $endprocess = TRUE; if ($rep_periode = $req_periode->fetch_object()) { $retour = $rep_periode->id_calendrier; } else { //$rep_periode->data_seek(0); $req_periode->data_seek(0); $rep_periode = $req_periode->fetch_object(); $retour = $rep_periode->id_calendrier; } } } $req_periode->close(); return $retour; }
function AfficheBarCommutateurPeriodesEleve() { if (isset($_SESSION['period_id'])) { $period_next = ReturnNextIdPeriod($_SESSION['period_id']); $period_previous = ReturnPreviousIdPeriod($_SESSION['period_id']); } else { $period_next = ReturnNextIdPeriod(ReturnIdPeriod(date("U"))); $period_previous = ReturnPreviousIdPeriod(ReturnIdPeriod(date("U"))); } echo "<div id=\"ButtonBarArrows\">"; echo "<ul class=\"ButtonBarArrowLeft\">"; echo "<li class=\"ButtonBarArrowLeft1\">"; echo "<a href=\"./edt_eleve.php?period_id=" . $period_previous . "\"></a>"; echo "</li>"; echo "</ul>"; $req_periode = mysqli_query($GLOBALS["mysqli"], "SELECT nom_calendrier FROM edt_calendrier WHERE id_calendrier='" . $_SESSION['period_id'] . "'"); $rep_periode = mysqli_fetch_array($req_periode); echo "<ul class=\"Period\">"; echo "Période visualisée : " . $rep_periode['nom_calendrier']; echo "</ul>"; echo "<ul class=\"ButtonBarArrowRight\">"; echo "<li class=\"ButtonBarArrowRight1\">"; echo "<a href=\"./edt_eleve.php?period_id=" . $period_next . "\"></a>"; echo "</li>"; echo "</ul>"; echo "</div>"; echo "<div class=\"spacer\"></div>"; }
public function launch(Request $request, Response $response) { $type_edt = null; $id = null; if ($request->getParam('login_prof')) { $id = $request->getParam('login_prof'); $type_edt = "prof"; } else { if ($request->getParam('id_classe')) { $id = $request->getParam('id_classe'); $type_edt = "classe"; } else { if ($request->getParam('id_salle')) { $id = $request->getParam('id_salle'); $type_edt = "salle"; } } } if ($request->getParam('message') != "") { $_SESSION["message"] = ""; } // =================== Gérer la bascule entre emplois du temps périodes et emplois du temps semaines. if ($request->getParam('bascule_edt')) { $_SESSION['bascule_edt'] = $bascule_edt; } if (!isset($_SESSION['bascule_edt'])) { $_SESSION['bascule_edt'] = 'periode'; } if ($_SESSION['bascule_edt'] == 'periode') { if (PeriodesExistent()) { if ($period_id != NULL) { $_SESSION['period_id'] = $period_id; } if (!isset($_SESSION['period_id'])) { $_SESSION['period_id'] = ReturnIdPeriod(date("U")); } if (!PeriodExistsInDB($_SESSION['period_id'])) { $_SESSION['period_id'] = ReturnFirstIdPeriod(); } $DisplayPeriodBar = true; $DisplayWeekBar = false; } else { $DisplayWeekBar = false; $DisplayPeriodBar = false; $_SESSION['period_id'] = 0; } } else { $DisplayPeriodBar = false; $DisplayWeekBar = true; if ($week_selected != NULL) { $_SESSION['week_selected'] = $week_selected; } if (!isset($_SESSION['week_selected'])) { $_SESSION['week_selected'] = date("W"); } } // =================== Forcer l'affichage d'un edt si l'utilisateur est un prof if (!$id) { if ($_SESSION['statut'] == "professeur" and $type_edt == "prof") { $id = $_SESSION['login']; $_GET["login_edt"] = $id; $_GET["type_edt_2"] = "prof"; $type_edt_2 = "prof"; $visioedt = "prof1"; } } // =================== Construire les emplois du temps if ($id) { if ($type_edt == "prof") { $tab_data = ConstruireEDTProf($id, $_SESSION['period_id']); $entetes = ConstruireEnteteEDT(); $creneaux = ConstruireCreneauxEDT(); FixColumnPositions($tab_data, $entetes); // en cours de devel $DisplayEDT = true; } else { if ($type_edt == "classe") { $tab_data = ConstruireEDTClasse($id, $_SESSION['period_id']); $entetes = ConstruireEnteteEDT(); $creneaux = ConstruireCreneauxEDT(); $DisplayEDT = true; } else { if ($type_edt == "salle") { $tab_data = ConstruireEDTSalle($id, $_SESSION['period_id']); $entetes = ConstruireEnteteEDT(); $creneaux = ConstruireCreneauxEDT(); //FixColumnPositions($tab_data, $entetes); // en cours de devel $DisplayEDT = true; } else { if ($type_edt == "eleve") { $tab_data = ConstruireEDTEleve($id, $_SESSION['period_id']); $entetes = ConstruireEnteteEDT(); $creneaux = ConstruireCreneauxEDT(); $DisplayEDT = true; } else { $DisplayEDT = false; } } } } } else { $DisplayEDT = false; } $response->addVar('message', $message); $response->addVar('NomPeriode', calendar::getPeriodName(time())); $response->addVar('TypeSemaineCourante', calendar::getTypeCurrentWeek()); $response->addVar('SemaineCourante', calendar::getCurrentWeek()); $this->render("./lib/template/edtSuccess.php"); $this->printOut(); }
} if (!isset($_SESSION['week_selected'])) { $_SESSION['week_selected'] = date("W"); } // =================== Forcer l'affichage d'un edt si l'utilisateur est un prof if (!isset($login_edt)) { if ($_SESSION['statut'] == "professeur" and $visioedt == "prof1") { $login_edt = $_SESSION['login']; $_GET["login_edt"] = $login_edt; $_GET["type_edt_2"] = "prof"; $type_edt_2 = "prof"; $visioedt = "prof1"; } } if (PeriodesExistent()) { $_SESSION['period_id'] = ReturnIdPeriod(RecupereTimestampJour(1)); if (!PeriodExistsInDB($_SESSION['period_id'])) { $_SESSION['period_id'] = ReturnFirstIdPeriod(); } } else { $_SESSION['period_id'] = 0; } // =================== Construire les emplois du temps if (isset($login_edt)) { $type_edt = isset($_GET["type_edt_2"]) ? $_GET["type_edt_2"] : (isset($_POST["type_edt_2"]) ? $_POST["type_edt_2"] : NULL); $tab_data = ConstruireEDTProf($login_edt, $_SESSION['period_id']); $entetes = ConstruireEnteteEDT(); $creneaux = ConstruireCreneauxEDT(); $DisplayEDT = true; FixColumnPositions($tab_data, $entetes); // en cours de dével