예제 #1
0
파일: saisie_edt.php 프로젝트: rhertzog/lcs
                     echo "Erreur: " . mysqli_error($GLOBALS["mysqli"]);
                     die;
                 } else {
                     // Afficher le cours modifié
                     echo get_infos_cours($id_cours);
                     $_SESSION['edt_prof_enseignement'] = $enseignement;
                     $_SESSION['edt_prof_salle'] = $login_salle;
                 }
             }
         }
     }
 } elseif (isset($modifier_cours) and $modifier_cours == "non") {
     //echo "1";
     if (ProfDisponible($identite, $ch_jour_semaine, $ch_heure, $duree, $heure_debut, $choix_semaine, -1, $message, $periode_calendrier)) {
         //echo "2";
         if (SalleDisponible($login_salle, $ch_jour_semaine, $ch_heure, $duree, $heure_debut, $choix_semaine, -1, $message, $periode_calendrier)) {
             //echo "3";
             if (GroupeDisponible($enseignement, $id_aid, $ch_jour_semaine, $ch_heure, $duree, $heure_debut, $choix_semaine, -1, $message, $periode_calendrier)) {
                 $sql = "INSERT INTO edt_cours SET id_groupe = '{$enseignement}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid_aid = '{$id_aid}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid_salle = '{$login_salle}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tjour_semaine = '{$ch_jour_semaine}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid_definie_periode = '{$ch_heure}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tduree = '{$duree}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theuredeb_dec = '{$heure_debut}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid_semaine = '{$choix_semaine}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid_calendrier = '{$periode_calendrier}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlogin_prof = '" . $identite . "'";
                 //echo "$sql<br />";
                 $nouveau_cours = mysqli_query($GLOBALS["mysqli"], $sql);
                 if (!$nouveau_cours) {
                     echo "Erreur: " . mysqli_error($GLOBALS["mysqli"]);
                     die;
                 } else {
                     // Afficher le nouveau cours
                     $id_cours = is_null($___mysqli_res = mysqli_insert_id($GLOBALS["mysqli"])) ? false : $___mysqli_res;
                     echo get_infos_cours($id_cours);
                     $_SESSION['edt_prof_enseignement'] = $enseignement;
                     $_SESSION['edt_prof_salle'] = $login_salle;
                 }
예제 #2
0
    $tab_select_salle = renvoie_liste("salle");
    for ($c = 0; $c < count($tab_select_salle); $c++) {
        if (isset($rep_cours["id_salle"])) {
            if ($rep_cours["id_salle"] == $tab_select_salle[$c]["id_salle"]) {
                $selected = " selected='selected'";
            } else {
                $selected = "";
            }
        } else {
            $selected = "";
        }
        // On vérifie si le nom de l asalle existe vraiment
        if ($tab_select_salle[$c]["nom_salle"] == "") {
            $tab_select_salle[$c]["nom_salle"] = $tab_select_salle[$c]["numero_salle"];
        }
        if (SalleDisponible($tab_select_salle[$c]["id_salle"], $rep_cours["jour_semaine"], $rep_cours["id_definie_periode"], $rep_cours["duree"], $rep_cours["heuredeb_dec"], $rep_cours["id_semaine"], -1, $message, $rep_cours["id_calendrier"])) {
            echo "<option value='" . $tab_select_salle[$c]["id_salle"] . "'" . $selected . ">" . $tab_select_salle[$c]["nom_salle"] . "</option>\n";
        } else {
            if ($tab_select_salle[$c]["id_salle"] == $rep_cours["id_salle"]) {
                echo "<option value='" . $tab_select_salle[$c]["id_salle"] . "'" . $selected . ">" . $tab_select_salle[$c]["nom_salle"] . "</option>\n";
            }
        }
    }
    echo '
			</select>

			</td>
			<td>
    ';
    $req_calendrier = mysqli_query($GLOBALS["mysqli"], "SELECT * FROM edt_calendrier WHERE etabferme_calendrier = '1' AND etabvacances_calendrier = '0'");
    $nbre_calendrier = mysqli_num_rows($req_calendrier);