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-22 11:50:56 +00:00
|
|
|
?>
|
2015-10-21 20:56:56 +00:00
|
|
|
|
2015-10-23 11:08:33 +00:00
|
|
|
|
|
|
|
|
2015-10-27 11:30:56 +00:00
|
|
|
<section name='allgroups' title='tous les groupes' class='basic'>
|
2015-10-28 17:08:12 +00:00
|
|
|
<?php if( $_SESSION['identifiant'] != null ){ // si connecté
|
2015-10-21 20:56:56 +00:00
|
|
|
|
2015-10-23 11:08:33 +00:00
|
|
|
|
|
|
|
$request = new stdClass();
|
|
|
|
$answer = new stdClass();
|
|
|
|
|
2015-10-28 17:08:12 +00:00
|
|
|
$request->level_1 = 'grouplist';
|
2015-10-29 23:01:35 +00:00
|
|
|
$request->semestre = $_SESSION['semestre'];
|
|
|
|
$request->annee = $_SESSION['annee'];
|
2015-10-22 21:06:25 +00:00
|
|
|
|
2015-10-23 11:08:33 +00:00
|
|
|
groups_switch_level_1($request, $answer);
|
2015-10-22 21:06:25 +00:00
|
|
|
|
2015-10-24 17:01:22 +00:00
|
|
|
if( $answer->request == 'success' ){ // si pas d'erreur
|
|
|
|
//////////////////////////////////////////////////////////////
|
2015-11-02 11:20:01 +00:00
|
|
|
|
|
|
|
echo "<table class='basic'><thead><tr>";
|
|
|
|
echo '<th>Identifiant</td>';
|
|
|
|
echo '<th>Prenom</td>';
|
|
|
|
echo '<th>Nom</td>';
|
|
|
|
echo '<th>Groupe</td>';
|
|
|
|
echo '</tr></thead></table>';
|
2015-10-22 21:06:25 +00:00
|
|
|
|
2015-10-24 17:01:22 +00:00
|
|
|
foreach($answer->grouplist as $group){ // pour chaque groupe
|
2015-10-22 21:06:25 +00:00
|
|
|
|
2015-10-24 17:01:22 +00:00
|
|
|
if( count($group->userlist) > 0 ){ // s'il y a des utilisateurs
|
2015-10-22 21:06:25 +00:00
|
|
|
|
2015-10-24 17:01:22 +00:00
|
|
|
echo "<table class='basic'>";
|
2015-10-22 21:06:25 +00:00
|
|
|
|
2015-11-02 11:20:01 +00:00
|
|
|
echo '<tbody>';
|
2015-10-25 16:55:18 +00:00
|
|
|
|
2015-10-24 17:01:22 +00:00
|
|
|
|
|
|
|
// pour chaque utilisateur
|
|
|
|
foreach($group->userlist as $user){
|
|
|
|
echo '<tr>';
|
2015-11-02 11:20:01 +00:00
|
|
|
echo "<td>".$user['identifiant'].'</td>';
|
|
|
|
echo '<td>'.$user['prenom'].'</td>';
|
|
|
|
echo '<td>'.$user['nom'].'</td>';
|
|
|
|
echo '<td>Groupe <span>'.$group->nom.'</span></td>';
|
2015-10-24 17:01:22 +00:00
|
|
|
echo '</tr>';
|
|
|
|
}
|
2015-10-23 11:08:33 +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-10-24 17:01:22 +00:00
|
|
|
echo '</tbody>';
|
2015-10-23 11:08:33 +00:00
|
|
|
|
2015-10-24 17:01:22 +00:00
|
|
|
echo '</table>';
|
2015-10-23 11:08:33 +00:00
|
|
|
|
2015-10-24 17:01:22 +00:00
|
|
|
}
|
2015-10-22 21:06:25 +00:00
|
|
|
}
|
2015-10-24 17:01:22 +00:00
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
}else
|
|
|
|
echo "Erreur interne...";
|
2015-10-23 11:08:33 +00:00
|
|
|
|
2015-10-22 21:06:25 +00:00
|
|
|
|
2015-10-22 11:50:56 +00:00
|
|
|
} ?>
|
|
|
|
</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-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-10-27 11:30:56 +00:00
|
|
|
echo "<section name='mygroup' 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-02 11:20:01 +00:00
|
|
|
echo "<table class='basic'><thead>";
|
|
|
|
echo '<tr>';
|
|
|
|
echo '<th colspan=5>';
|
|
|
|
echo 'Groupe '.$group->nom;
|
|
|
|
echo '</th>';
|
|
|
|
echo '</tr>';
|
|
|
|
echo '</thead></table>';
|
2015-10-25 16:55:18 +00:00
|
|
|
|
2015-11-02 11:20:01 +00:00
|
|
|
echo "<table class='basic'><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>';
|
|
|
|
echo "<td>".$user['identifiant'].'</td>';
|
|
|
|
echo '<td>'.$user['prenom'].'</td>';
|
|
|
|
echo '<td>'.$user['nom'].'</td>';
|
|
|
|
echo '<td>Groupe <span>'.$group->nom.'</span></td>';
|
|
|
|
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-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-10-31 16:25:19 +00:00
|
|
|
$request->level_1 = 'grouplist';
|
|
|
|
$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-10-31 16:25:19 +00:00
|
|
|
echo "<table class='basic'>";
|
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-02 11:20:01 +00:00
|
|
|
echo "<td>".$user['identifiant'].'</td>';
|
|
|
|
echo '<td>'.$user['prenom'].'</td>';
|
|
|
|
echo '<td>'.$user['nom'].'</td>';
|
2015-11-02 11:25:25 +00:00
|
|
|
echo '<td>Groupe <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>';
|
|
|
|
} ?>
|