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-06 13:05:14 +00:00
/*** GESTION DES PARAMETRES OPTIONNELS ***/
$postVars = array (); // on récupère les variables post
foreach ( $_POST as $k => $v )
array_push ( $postVars , $k );
/* GESTION SEMESTRE OPTIONNEL */
if ( isset ( $postVars [ 1 ]) && is_numeric ( $postVars [ 1 ]) )
$semestreOpt = $postVars [ 1 ];
else
$semestreOpt = null ;
/* GESTION GROUPES OPTIONNEL */
if ( isset ( $postVars [ 2 ]) && is_string ( $postVars [ 2 ]) && strlen ( $postVars [ 2 ]) > 1 )
$groupeOpt = $postVars [ 2 ];
else
$groupeOpt = null ;
2015-11-04 08:15:35 +00:00
/************************/
/*** TOUS LES GROUPES ***/
/************************/
/*
* UTILISATEUR -> affichage du même semestre
*
*
*/
2015-11-06 22:00:08 +00:00
if ( permission ( '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
*
*
*/
2015-11-10 08:17:41 +00:00
if ( permission ( 'teacher' ) ){ // si connecté && prof
2015-11-04 08:15:35 +00:00
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' ];
2015-11-06 14:57:12 +00:00
if ( $semestreOpt != null ) $request -> semestre = $semestreOpt ;
elseif ( $groupeOpt != null ) $request -> groupe = $groupeOpt ;
2015-11-04 08:15:35 +00:00
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 ;
2015-11-06 14:57:12 +00:00
echo " <select name='semestre'> " ;
echo " <option value='*'>Tous les semestres</option> " ;
2015-11-06 10:13:32 +00:00
foreach ( $answer -> grouplist as $group ){
if ( $lastSemestre == null || $lastSemestre != $group -> semestre ){
2015-11-06 14:57:12 +00:00
if ( $group -> semestre [ 1 ] == $semestreOpt ) // si c'est le semestre séléctionné
echo " <option value=' " . $group -> semestre [ 1 ] . " ' selected> " . $group -> semestre . '</option>' ;
else // sinon on affiche normalement
echo " <option value=' " . $group -> semestre [ 1 ] . " '> " . $group -> semestre . '</option>' ;
2015-11-06 10:13:32 +00:00
$lastSemestre = $group -> semestre ;
}
}
echo " <select> " ;
/* select pour GROUPES */
$lastGroupe = null ;
2015-11-06 14:57:12 +00:00
echo " <select name='groupe'> " ;
echo " <option value='*'>Tous les groupes</option> " ;
2015-11-06 10:13:32 +00:00
foreach ( $answer -> grouplist as $group ){
if ( $lastGroupe == null || $lastGroupe != $group -> nom ){
2015-11-06 14:57:12 +00:00
if ( $group -> nom == $groupeOpt ) // si c'est le groupe séléctionné
echo " <option value=' " . $group -> nom . " ' selected> " . $group -> nom . '</option>' ;
else
echo " <option value=' " . $group -> nom . " '> " . $group -> nom . '</option>' ;
2015-11-06 10:13:32 +00:00
$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-11-06 22:00:08 +00:00
if ( permission ( '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
*
*/
2015-11-06 22:00:08 +00:00
if ( permission ( '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' ];
2015-11-06 14:57:12 +00:00
if ( $semestreOpt != null ) $request -> semestre = $semestreOpt ;
elseif ( $groupeOpt != null ) $request -> groupe = $groupeOpt ;
2015-11-04 08:15:35 +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-06 10:13:32 +00:00
/* select pour SEMESTRES */
$lastSemestre = null ;
2015-11-06 14:57:12 +00:00
echo " <select name='semestre'> " ;
echo " <option value='*'>Tous les semestres</option> " ;
2015-11-06 10:13:32 +00:00
foreach ( $answer -> grouplist as $group ){
if ( $lastSemestre == null || $lastSemestre != $group -> semestre ){
2015-11-06 14:57:12 +00:00
if ( $group -> semestre [ 1 ] == $semestreOpt ) // si c'est le semestre séléctionné
echo " <option value=' " . $group -> semestre [ 1 ] . " ' selected> " . $group -> semestre . '</option>' ;
else // sinon on affiche normalement
echo " <option value=' " . $group -> semestre [ 1 ] . " '> " . $group -> semestre . '</option>' ;
2015-11-06 10:13:32 +00:00
$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 ;
2015-11-06 14:57:12 +00:00
echo " <select name='groupe'> " ;
echo " <option value='*'>Tous les groupes</option> " ;
2015-11-06 10:13:32 +00:00
foreach ( $answer -> grouplist as $group ){
if ( $lastGroupe == null || $lastGroupe != $group -> nom ){
2015-11-06 14:57:12 +00:00
if ( $group -> nom == $groupeOpt ) // si c'est le groupe séléctionné
echo " <option value=' " . $group -> nom . " ' selected> " . $group -> nom . '</option>' ;
else
echo " <option value=' " . $group -> nom . " '> " . $group -> nom . '</option>' ;
2015-11-06 10:13:32 +00:00
$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-11-06 22:00:08 +00:00
if ( permission ( '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 -> annee = $_SESSION [ 'annee' ];
2015-11-06 14:57:12 +00:00
if ( $semestreOpt != null ) $request -> semestre = $semestreOpt ;
elseif ( $groupeOpt != null ) $request -> groupe = $groupeOpt ;
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-06 14:57:12 +00:00
/* select pour SEMESTRES */
$lastSemestre = null ;
echo " <select name='semestre'> " ;
echo " <option value='*'>Tous les semestres</option> " ;
foreach ( $answer -> grouplist as $group ){
if ( $lastSemestre == null || $lastSemestre != $group -> semestre ){
if ( $group -> semestre [ 1 ] == $semestreOpt ) // si c'est le semestre séléctionné
echo " <option value=' " . $group -> semestre [ 1 ] . " ' selected> " . $group -> semestre . '</option>' ;
else // sinon on affiche normalement
echo " <option value=' " . $group -> semestre [ 1 ] . " '> " . $group -> semestre . '</option>' ;
$lastSemestre = $group -> semestre ;
}
}
echo " <select> " ;
/* select pour GROUPES */
$lastGroupe = null ;
echo " <select name='groupe'> " ;
echo " <option value='*'>Tous les groupes</option> " ;
foreach ( $answer -> grouplist as $group ){
if ( $lastGroupe == null || $lastGroupe != $group -> nom ){
if ( $group -> nom == $groupeOpt ) // si c'est le groupe séléctionné
echo " <option value=' " . $group -> nom . " ' selected> " . $group -> nom . '</option>' ;
else
echo " <option value=' " . $group -> nom . " '> " . $group -> nom . '</option>' ;
$lastGroupe = $group -> nom ;
}
}
echo " <select> " ;
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>' ;
2015-11-09 20:47:53 +00:00
} ?>
< ? php
/*********************************/
/*** IMPORTATION FICHIER EXCEL ***/
/*********************************/
2015-11-10 08:17:41 +00:00
if ( permission ( 'admin' ) ){
2015-11-09 20:47:53 +00:00
echo " <section name='importexcel' title='Importation/Export' class='basic'> " ;
//inclusion des classes de PHPExcel
2015-11-09 20:58:38 +00:00
include __ROOT__ . DIRECTORY_SEPARATOR . join ( DIRECTORY_SEPARATOR , array ( " src " , " phpexcel " , " Classes " , " PHPExcel.php " ));
include __ROOT__ . DIRECTORY_SEPARATOR . join ( DIRECTORY_SEPARATOR , array ( " src " , " phpexcel " , " Classes " , " PHPExcel " , " Writer " , " Excel2007.php " ));
2015-11-09 20:47:53 +00:00
//On crée une instance du fichier xls, ainsi que de la feuille active
$workbook = new PHPExcel ();
$sheet = $workbook -> getActiveSheet ();
$writer = new PHPExcel_Writer_Excel2007 ( $workbook );
//on prépare le tableau
$sheet -> setCellValue ( 'A1' , 'IAE Etape' );
$sheet -> setCellValue ( 'B1' , 'Nom' );
$sheet -> setCellValue ( 'C1' , 'Prénom' );
$sheet -> setCellValue ( 'D1' , 'Identifiant' );
$sheet -> setCellValue ( 'E1' , 'Sexe' );
$sheet -> setCellValue ( 'F1' , 'Mail étudiant' );
//on récupère l'ensemble des étudiants
$request = new stdClass ();
$answer = new stdClass ();
$request -> level_1 = 'grouplistForYear' ;
$request -> annee = $_SESSION [ 'annee' ];
groups_switch_level_1 ( $request , $answer );
//Si l'execution s'est proprement effectuée
$index = 2 ;
if ( $answer -> request == 'success' ) {
foreach ( $answer -> grouplist as $group ) {
$groupeName = $group -> nom ;
foreach ( $group -> userlist as $student ) {
$sheet -> setCellValue ( 'A' . $index , $groupeName );
$sheet -> setCellValue ( 'B' . $index , $student [ 'nom' ]);
$sheet -> setCellValue ( 'C' . $index , $student [ 'prenom' ]);
$sheet -> setCellValue ( 'D' . $index , $student [ 'identifiant' ]);
//$sheet->setCellValue('E'.$index, $student['sexe']);
$sheet -> setCellValue ( 'F' . $index , $student [ 'mail' ]);
$index ++ ;
}
}
}
//On enregistre le fichier
$writer -> save ( 'test.xlsx' );
}
?>