2015-10-23 11:08:33 +00:00
< ? php define ( '__ROOT__' , dirname ( dirname ( __FILE__ )) );
2015-10-28 17:08:12 +00:00
require_once __ROOT__ . '/manager/security.php' ;
2015-10-24 17:01:22 +00:00
require_once __ROOT__ . '/manager/groups.php' ;
2015-10-21 20:56:56 +00:00
/****************************************
* *
* SECTION " GROUPES " *
* *
*****************************************
*
2015-10-22 11:50:56 +00:00
* [ 1 ] Présentation ( studend + prof )
2015-10-21 20:56:56 +00:00
* [ 2 ] Tout les groupes ( tous connecté )
* [ 3 ] Modifier les groupes ( admin )
* [ 4 ] Répartir les élèves ( admin )
*
*****************************************/
2015-10-23 11:08:33 +00:00
2015-10-21 20:56:56 +00:00
2015-11-04 08:15:35 +00:00
/************************/
/*** TOUS LES GROUPES ***/
/************************/
/*
* UTILISATEUR -> affichage du même semestre
*
*
*/
if ( $_SESSION [ 'identifiant' ] != null && $_SESSION [ 'droits' ] == 'student' ){ // si connecté && utilisateur
2015-11-06 10:13:32 +00:00
echo " <section name='studentallgroups' title='tous les groupes' class='basic'> " ;
2015-11-04 08:15:35 +00:00
$request = new stdClass ();
$answer = new stdClass ();
2015-10-23 11:08:33 +00:00
2015-11-04 08:15:35 +00:00
$request -> level_1 = 'grouplist' ;
$request -> semestre = $_SESSION [ 'semestre' ];
$request -> annee = $_SESSION [ 'annee' ];
2015-10-23 11:08:33 +00:00
2015-11-04 08:15:35 +00:00
groups_switch_level_1 ( $request , $answer );
2015-10-21 20:56:56 +00:00
2015-11-04 08:15:35 +00:00
if ( $answer -> request == 'success' ){ // si pas d'erreur
//////////////////////////////////////////////////////////////
echo " <table class='basic col5'><thead><tr> " ;
echo '<th>Identifiant</td>' ;
echo '<th>Prenom</td>' ;
echo '<th>Nom</td>' ;
echo '<th>Semestre</td>' ;
echo '<th>Groupe</td>' ;
echo '</tr></thead></table>' ;
2015-10-23 11:08:33 +00:00
2015-11-04 08:15:35 +00:00
foreach ( $answer -> grouplist as $group ){ // pour chaque groupe
2015-10-22 21:06:25 +00:00
2015-11-04 08:15:35 +00:00
if ( count ( $group -> userlist ) > 0 ){ // s'il y a des utilisateurs
2015-10-22 21:06:25 +00:00
2015-11-04 08:15:35 +00:00
echo " <table class='basic margin col5'> " ;
2015-10-22 21:06:25 +00:00
2015-11-04 08:15:35 +00:00
echo '<tbody>' ;
2015-10-22 21:06:25 +00:00
2015-11-04 08:15:35 +00:00
// pour chaque utilisateur
foreach ( $group -> userlist as $user ){
echo '<tr>' ;
echo " <td><span class=link> " . $user [ 'identifiant' ] . '</span></td>' ;
echo '<td>' . $user [ 'prenom' ] . '</td>' ;
echo '<td>' . $user [ 'nom' ] . '</td>' ;
echo '<td>' . $group -> semestre . '</td>' ;
echo '<td>Groupe <span class=stressed>' . $group -> nom . '</span></td>' ;
echo '</tr>' ;
}
2015-10-22 21:06:25 +00:00
2015-11-04 08:15:35 +00:00
// echo '<tr><td colspan=5 class=more></td></tr>';
2015-10-22 21:06:25 +00:00
2015-11-04 08:15:35 +00:00
echo '</tbody>' ;
2015-10-24 17:01:22 +00:00
2015-11-04 08:15:35 +00:00
echo '</table>' ;
2015-10-23 11:08:33 +00:00
2015-11-04 08:15:35 +00:00
}
}
////////////////////////////////////////////////////////
} else
echo " Erreur interne... " ;
echo '</section>' ;
}
2015-10-25 16:55:18 +00:00
2015-10-23 11:08:33 +00:00
2015-11-04 08:15:35 +00:00
/************************/
/*** TOUS LES GROUPES ***/
/************************/
/*
* PROFESSEUR -> affichage des semestres en cours
* ADMINISTRATEUR -> affichage des semestres en cours
*
*
*/
if ( $_SESSION [ 'identifiant' ] != null && ( $_SESSION [ 'droits' ] == 'teacher' || $_SESSION [ 'droits' ] == 'admin' ) ){ // si connecté && prof ou admin
echo " <section name='allgroups' title='tous les groupes' class='basic'> " ;
2015-10-22 21:06:25 +00:00
2015-11-04 08:15:35 +00:00
$request = new stdClass ();
$answer = new stdClass ();
$request -> level_1 = 'grouplistForYear' ;
$request -> annee = $_SESSION [ 'annee' ];
groups_switch_level_1 ( $request , $answer );
if ( $answer -> request == 'success' ){ // si pas d'erreur
//////////////////////////////////////////////////////////////
2015-11-06 10:13:32 +00:00
/* select pour SEMESTRES */
$lastSemestre = null ;
echo " <select> " ;
echo " <option>Choix du semestre</option> " ;
foreach ( $answer -> grouplist as $group ){
if ( $lastSemestre == null || $lastSemestre != $group -> semestre ){
echo '<option>' . $group -> semestre . '</option>' ;
$lastSemestre = $group -> semestre ;
}
}
echo " <select> " ;
/* select pour GROUPES */
$lastGroupe = null ;
echo " <select> " ;
echo " <option>Choix du groupe</option> " ;
foreach ( $answer -> grouplist as $group ){
if ( $lastGroupe == null || $lastGroupe != $group -> nom ){
echo '<option>' . $group -> nom . '</option>' ;
$lastGroupe = $group -> nom ;
}
}
echo " <select> " ;
2015-11-04 08:15:35 +00:00
echo " <table class='basic col5'><thead><tr> " ;
echo '<th>Identifiant</td>' ;
echo '<th>Prenom</td>' ;
echo '<th>Nom</td>' ;
echo '<th>Semestre</td>' ;
echo '<th>Groupe</td>' ;
echo '</tr></thead></table>' ;
foreach ( $answer -> grouplist as $group ){ // pour chaque groupe
if ( count ( $group -> userlist ) > 0 ){ // s'il y a des utilisateurs
echo " <table class='basic margin col5'> " ;
echo '<tbody>' ;
// pour chaque utilisateur
foreach ( $group -> userlist as $user ){
echo '<tr>' ;
echo " <td><span class=link> " . $user [ 'identifiant' ] . '</span></td>' ;
echo '<td>' . $user [ 'prenom' ] . '</td>' ;
echo '<td>' . $user [ 'nom' ] . '</td>' ;
echo '<td>' . $group -> semestre . '</td>' ;
echo '<td>Groupe <span class=stressed>' . $group -> nom . '</span></td>' ;
echo '</tr>' ;
}
// echo '<tr><td colspan=5 class=more></td></tr>';
echo '</tbody>' ;
echo '</table>' ;
}
}
////////////////////////////////////////////////////////
} else
echo " Erreur interne... " ;
echo '</section>' ;
} ?>
2015-10-21 20:56:56 +00:00
2015-10-23 08:04:26 +00:00
2015-10-25 16:55:18 +00:00
<!-- mon groupe -->
< ? php
/******************/
/*** MON GROUPE ***/
/******************/
2015-11-04 08:15:35 +00:00
/*
*
* ETUDIANT -> son groupe de son semestre
*
*/
2015-10-28 17:08:12 +00:00
if ( $_SESSION [ 'identifiant' ] != null && $_SESSION [ 'droits' ] == 'student' ){ // si l'utilisateur est connecté et que c'est un élève
2015-11-06 10:13:32 +00:00
echo " <section name='studentsgroup' title='Mon groupe' class='basic'> " ;
2015-10-25 16:55:18 +00:00
$request = new stdClass (); $answer = new stdClass ();
$request -> level_1 = 'get' ;
2015-10-28 17:08:12 +00:00
$request -> etudiant = $_SESSION [ 'identifiant' ];
2015-10-29 23:01:35 +00:00
$request -> semestre = $_SESSION [ 'semestre' ];
$request -> annee = $_SESSION [ 'annee' ];
2015-10-28 17:08:12 +00:00
2015-10-25 16:55:18 +00:00
groups_switch_level_1 ( $request , $answer );
if ( $answer -> request == 'success' ){ // si pas d'erreur
$monGroupe = $answer -> groupe ;
$request = new stdClass (); $answer = new stdClass ();
$request -> level_1 = 'userlist' ;
$request -> groupe = $monGroupe ;
2015-10-29 23:01:35 +00:00
$request -> semestre = $_SESSION [ 'semestre' ];
$request -> annee = $_SESSION [ 'annee' ];
2015-10-25 16:55:18 +00:00
groups_switch_level_1 ( $request , $answer );
if ( $answer -> request == 'success' ){ // si on a bien récupéré les membres du groupe
////////////////////////////////////////////////////////////////////////////////
2015-11-03 11:09:14 +00:00
echo " <table class='basic col1'><thead> " ;
2015-11-02 11:20:01 +00:00
echo '<tr>' ;
echo '<th colspan=5>' ;
2015-11-03 11:09:14 +00:00
echo 'Groupe ' . $monGroupe ;
2015-11-02 11:20:01 +00:00
echo '</th>' ;
echo '</tr>' ;
echo '</thead></table>' ;
2015-10-25 16:55:18 +00:00
2015-11-04 08:15:35 +00:00
echo " <table class='basic col5'><tbody> " ;
2015-10-25 16:55:18 +00:00
2015-11-02 11:20:01 +00:00
// pour chaque utilisateur
foreach ( $answer -> userlist as $user ){
echo '<tr>' ;
2015-11-04 08:15:35 +00:00
echo " <td><span class=link> " . $user [ 'identifiant' ] . '</span></td>' ;
2015-11-02 11:20:01 +00:00
echo '<td>' . $user [ 'prenom' ] . '</td>' ;
echo '<td>' . $user [ 'nom' ] . '</td>' ;
2015-11-04 08:15:35 +00:00
echo '<td>' . $user [ 'semestre' ] . '</td>' ;
echo '<td>Groupe <span class=stressed>' . $monGroupe . '</span></td>' ;
2015-11-02 11:20:01 +00:00
echo '</tr>' ;
}
2015-10-25 16:55:18 +00:00
2015-11-02 11:20:01 +00:00
// echo '<tr><td colspan=5 class=more></td></tr>';
2015-10-25 16:55:18 +00:00
2015-11-02 11:20:01 +00:00
echo '</tbody>' ;
2015-10-25 16:55:18 +00:00
2015-11-02 11:20:01 +00:00
echo '</table>' ;
2015-10-25 16:55:18 +00:00
////////////////////////////////////////////////////////////////////////////////
} else
echo " Erreur interne. " ;
} else
echo " Aucun groupe trouvé pour cet utilisateur. " ;
echo '</section>' ;
} ?>
2015-10-21 20:56:56 +00:00
2015-11-04 08:15:35 +00:00
2015-11-06 10:13:32 +00:00
<!-- mes groupeS -->
2015-11-04 08:15:35 +00:00
< ? php
2015-11-06 10:13:32 +00:00
/*******************/
/*** MES GROUPES ***/
/*******************/
2015-11-04 08:15:35 +00:00
/*
*
* PROFESSEUR -> les groupes inscrits aux modules qu ' il enseigne
*
*/
if ( $_SESSION [ 'identifiant' ] != null && $_SESSION [ 'droits' ] == 'teacher' ){ // si l'utilisateur est connecté et que c'est un élève
2015-11-06 10:13:32 +00:00
echo " <section name='teachersgroups' title='Mes groupes' class='basic'> " ;
2015-11-04 08:15:35 +00:00
$request = new stdClass (); $answer = new stdClass ();
$request -> level_1 = 'grouplistForTeacher' ; /******************************************************************************************************** A FAIRE **/
$request -> enseignant = $_SESSION [ 'identifiant' ];
$request -> annee = $_SESSION [ 'annee' ];
groups_switch_level_1 ( $request , $answer );
if ( $answer -> request == 'success' ){ // si on a bien récupéré les membres du groupe
////////////////////////////////////////////////////////////////////////////////
2015-11-06 10:13:32 +00:00
/* select pour SEMESTRES */
$lastSemestre = null ;
echo " <select> " ;
echo " <option>Choix du semestre</option> " ;
foreach ( $answer -> grouplist as $group ){
if ( $lastSemestre == null || $lastSemestre != $group -> semestre ){
echo '<option>' . $group -> semestre . '</option>' ;
$lastSemestre = $group -> semestre ;
}
}
echo " <select> " ;
2015-11-04 08:15:35 +00:00
2015-11-06 10:13:32 +00:00
/* select pour GROUPES */
$lastGroupe = null ;
echo " <select> " ;
echo " <option>Choix du groupe</option> " ;
foreach ( $answer -> grouplist as $group ){
if ( $lastGroupe == null || $lastGroupe != $group -> nom ){
echo '<option>' . $group -> nom . '</option>' ;
$lastGroupe = $group -> nom ;
}
2015-11-04 08:15:35 +00:00
}
2015-11-06 10:13:32 +00:00
echo " <select> " ;
echo " <table class='basic col5'><thead><tr> " ;
echo '<th>Identifiant</td>' ;
echo '<th>Prenom</td>' ;
echo '<th>Nom</td>' ;
echo '<th>Semestre</td>' ;
echo '<th>Groupe</td>' ;
echo '</tr></thead></table>' ;
foreach ( $answer -> grouplist as $group ){ // pour chaque groupe
if ( count ( $group -> userlist ) > 0 ){ // s'il y a des utilisateurs
echo " <table class='basic margin col5'> " ;
2015-11-04 08:15:35 +00:00
2015-11-06 10:13:32 +00:00
echo '<tbody>' ;
2015-11-04 08:15:35 +00:00
2015-11-06 10:13:32 +00:00
// pour chaque utilisateur
foreach ( $group -> userlist as $user ){
echo '<tr>' ;
echo " <td><span class=link> " . $user [ 'identifiant' ] . '</span></td>' ;
echo '<td>' . $user [ 'prenom' ] . '</td>' ;
echo '<td>' . $user [ 'nom' ] . '</td>' ;
echo '<td>' . $group -> semestre . '</td>' ;
echo '<td>Groupe <span class=stressed>' . $group -> nom . '</span></td>' ;
echo '</tr>' ;
}
2015-11-04 08:15:35 +00:00
2015-11-06 10:13:32 +00:00
// echo '<tr><td colspan=5 class=more></td></tr>';
echo '</tbody>' ;
echo '</table>' ;
}
}
2015-11-04 08:15:35 +00:00
////////////////////////////////////////////////////////////////////////////////
} else
echo " Erreur interne. " ;
echo '</section>' ;
} ?>
2015-10-27 11:30:56 +00:00
<!-- DEPLACEMENT D ' ELEVES -->
2015-10-21 20:56:56 +00:00
2015-10-27 11:30:56 +00:00
< ? php
/****************************/
/*** DEPLACEMENT D'ELEVES ***/
/****************************/
2015-10-28 17:08:12 +00:00
if ( $_SESSION [ 'identifiant' ] != null && $_SESSION [ 'droits' ] == 'admin' ){ // si l'utilisateur est connecté et que c'est un élève
2015-10-27 11:30:56 +00:00
echo " <section name='movestudents' title= \" Déplacements \" class='basic'> " ;
2015-10-21 20:56:56 +00:00
2015-10-31 16:25:19 +00:00
for ( $i = 2 ; $i <= 2 ; $i ++ ){ // pour chaque semestre
2015-10-21 20:56:56 +00:00
2015-10-31 16:25:19 +00:00
$request = new stdClass ();
$answer = new stdClass ();
2015-10-27 11:30:56 +00:00
2015-11-04 08:15:35 +00:00
$request -> level_1 = 'grouplistForYear' ;
2015-10-31 16:25:19 +00:00
$request -> semestre = $i ;
$request -> annee = $_SESSION [ 'annee' ];
2015-10-27 11:30:56 +00:00
2015-10-31 16:25:19 +00:00
groups_switch_level_1 ( $request , $answer );
2015-10-27 11:30:56 +00:00
2015-10-31 16:25:19 +00:00
if ( $answer -> request == 'success' ){ // si pas d'erreur
//////////////////////////////////////////////////////////////
2015-11-02 11:20:01 +00:00
2015-10-27 11:30:56 +00:00
2015-10-31 16:25:19 +00:00
foreach ( $answer -> grouplist as $group ){ // pour chaque groupe
2015-10-27 11:30:56 +00:00
2015-10-31 16:25:19 +00:00
if ( count ( $group -> userlist ) > 0 ){ // s'il y a des utilisateurs
2015-10-27 11:30:56 +00:00
2015-11-03 11:09:14 +00:00
echo " <table class='basic col4'> " ;
2015-10-27 11:30:56 +00:00
2015-10-31 16:25:19 +00:00
echo '<thead>' ;
echo '<tr>' ;
2015-11-02 11:20:01 +00:00
echo '<th colspan=5>' ;
2015-11-02 11:25:25 +00:00
echo 'Groupe <span>' . $group -> nom . '</span>' ;
2015-11-02 11:20:01 +00:00
echo " <span style='font-weight:normal;padding-left:1em; font-size: .8em;'>(glisser-déposer étudiant pour le déplacer)</span> " ;
echo '</th>' ;
2015-10-31 16:25:19 +00:00
echo '</tr>' ;
echo '</thead>' ;
2015-10-27 11:30:56 +00:00
2015-10-31 16:25:19 +00:00
echo '<tbody>' ;
2015-10-27 11:30:56 +00:00
2015-10-31 16:25:19 +00:00
// pour chaque utilisateur
foreach ( $group -> userlist as $user ){
echo '<tr>' ;
2015-11-04 08:15:35 +00:00
echo " <td><span class=link> " . $user [ 'identifiant' ] . '</span></td>' ;
2015-11-02 11:20:01 +00:00
echo '<td>' . $user [ 'prenom' ] . '</td>' ;
echo '<td>' . $user [ 'nom' ] . '</td>' ;
2015-11-02 12:52:16 +00:00
echo '<td><strong><span>' . $group -> nom . '</span></strong></td>' ;
2015-10-31 16:25:19 +00:00
echo '</tr>' ;
}
2015-10-27 11:30:56 +00:00
2015-11-02 11:20:01 +00:00
// echo '<tr><td colspan=5 class=more></td></tr>';
2015-10-27 11:30:56 +00:00
2015-10-31 16:25:19 +00:00
echo '</tbody>' ;
2015-10-27 11:30:56 +00:00
2015-10-31 16:25:19 +00:00
echo '</table>' ;
}
2015-10-27 11:30:56 +00:00
}
2015-10-31 16:25:19 +00:00
////////////////////////////////////////////////////////
} else
echo " Erreur interne... " ;
}
2015-10-27 11:30:56 +00:00
echo '</section>' ;
} ?>