'; if ($jours == 'weekly *') $choix_jours .=''; else $choix_jours .=''; if ($jours == 'weekly saturday') $choix_jours .=''; else $choix_jours .=''; if ($jours == 'weekly sunday') $choix_jours .=''; else $choix_jours .=''; if ($jours == 'weekly mtwhf') $choix_jours .=''; else $choix_jours .=''; $choix_jours .=''; echo $choix_jours; } // recuperer les parametres passes par POST if ($_POST) extract($_POST); if ($_GET) extract($_GET); if (is_admin("se3_is_admin",$login)=="Y") { $role="admin"; } elseif (is_admin("sovajon_is_admin",$login)=="Y") { $role="prof"; } else { $role="eleve"; } if ($role !="admin") { //redirection } if ($mode == 'show_plages') { $sql = "select * from squid_plages WHERE nom <> 'all' ORDER BY `nom` "; $c = mysql_query($sql) or die("Erreur $sql"); $x = 1; echo ""; while ($R = mysql_fetch_object($c)) { echo "". ""; if ($x % 3 == 0) echo ""; $x++; } echo ''; echo ''; echo "
$R->nom

"; if ($R->nom != 'pause' && $R->nom != 'soir' && $R->nom != 'cours1') echo "nom\">Effacer"; echo "
nom\">Modifier
nom\" src=\"/elements/images/se3-internet/clock.jpg\">
 
Lire la configuration
"; die(''); } if ($mode == 'delete') { $info = explode('_',$plage); $plage = $info[1]; $sql = "SELECT id from squid_plages where nom ='$plage'"; $c = mysql_query($sql) or die("Err $sql"); if (mysql_num_rows($c) != 0) { $id = mysql_result($c,"id",0); $sql = "DELETE from squid_horaire where id_plage ='$id'"; $c = mysql_query($sql) or die("Err $sql"); $sql = "DELETE from squid_plages where id ='$id'"; $c = mysql_query($sql) or die("Err $sql"); } die(''); } if ($mode == 'update') { $infos = array_reverse(explode('_',$id_hor)); $idH = $infos[0]; $sql = "SELECT * from squid_horaire where id='$idH'"; $c = mysql_query($sql) or die("Err $sql"); if (mysql_num_rows($c) != 0) { $sql = "UPDATE squid_horaire SET `de`='$from', `a`='$to', `jours`='$days' WHERE id='$idH';"; $c = mysql_query($sql) or die("Err $sql"); } die(''); } if ($mode == 'modify') { $info = explode('_',$plage); $plage = $info[1]; $sql = "SELECT id from squid_plages where nom ='$plage'"; $c = mysql_query($sql) or die("Err $sql"); if (mysql_num_rows($c) != 0) { $id = mysql_result($c,"id",0); $sql = "SELECT * from squid_horaire where id_plage ='$id'"; $c = mysql_query($sql) or die("Err $sql"); echo "
$plage

"; while ($R = mysql_fetch_object($c)) { $from =$R->de; $to = $R->a; $days = $R->jours; echo '
De '; echo 'à '; echo mk_select("days_".$plage."_".$R->id,$days); echo ' Effacer'; } } if (mysql_num_rows($c) != 0) echo '
'; echo '

De '; echo 'à '; echo mk_select("new_days","*"); echo ' Ajouter'; echo '

Retour '; die(''); } if ($mode == 'add_plage') { $sql = "SELECT * from squid_plages where nom ='$plage'"; $c = mysql_query($sql) or die("Err $sql"); if (mysql_num_rows($c) == 0) { $sql = "INSERT INTO squid_plages VALUE ('','$new_plage')"; $c = mysql_query($sql) or die("Err $sql"); } die(''); } if ($mode == 'add_cren') { $infos = explode('_',$plage); $plage = $infos[1]; $sql = "SELECT id from squid_plages where nom ='$plage'"; $c = mysql_query($sql) or die("Err $sql"); if (mysql_num_rows($c) != 0) { $R = mysql_fetch_object($c); $sql = "INSERT INTO squid_horaire VALUE ('','$R->id','$from','$to','$days');"; $c = mysql_query($sql) or die("Err $sql"); } die(''); } if ($mode == 'del_cren') { $infos = explode('_',$id); $id_cren = $infos[0]; $sql = "DELETE from squid_horaire where id ='$id_cren'"; $c = mysql_query($sql) or die("Err $sql"); die(''); }