2015-10-28 17:08:12 +00:00
|
|
|
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
|
|
|
|
require_once __ROOT__.'/manager/security.php';
|
|
|
|
require_once __ROOT__.'/manager/groups.php';
|
|
|
|
require_once __ROOT__.'/manager/modules.php';
|
2015-10-22 12:06:49 +00:00
|
|
|
|
2015-11-15 18:10:33 +00:00
|
|
|
|
|
|
|
/*** GESTION DES PARAMETRES OPTIONNELS ***/
|
|
|
|
|
|
|
|
// on initialise les paramètres optionnels
|
|
|
|
$ueOpt = null;
|
|
|
|
|
|
|
|
// on cherche dans toutes les variables _get si on trouve des paramètres
|
|
|
|
foreach($_POST as $k=>$v){
|
|
|
|
|
|
|
|
if( preg_match('/^u:(.+)$/', $k, $m) ) // s:nomSemestre
|
|
|
|
$ueOpt = $m[1];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$ueOpt = ($ueOpt == null || $ueOpt == '*') ? null : $ueOpt;
|
|
|
|
|
|
|
|
|
2015-10-28 17:08:12 +00:00
|
|
|
/****************************************
|
|
|
|
* *
|
2015-10-29 23:01:35 +00:00
|
|
|
* SECTION "MODULES" *
|
2015-10-28 17:08:12 +00:00
|
|
|
* *
|
|
|
|
*****************************************
|
|
|
|
*
|
2015-10-29 23:01:35 +00:00
|
|
|
* [1] MES MODULES (studend + prof)
|
|
|
|
* [2] MES MODULES (prof)
|
2015-10-28 17:08:12 +00:00
|
|
|
*
|
|
|
|
*****************************************/
|
|
|
|
?>
|
2015-10-22 12:06:49 +00:00
|
|
|
|
2015-10-28 17:08:12 +00:00
|
|
|
|
|
|
|
<!-- mes modules -->
|
|
|
|
|
|
|
|
<?php
|
2015-10-28 22:33:16 +00:00
|
|
|
/**************************************/
|
|
|
|
/*** MES MODULES (version étudiant) ***/
|
|
|
|
/**************************************/
|
2015-11-06 22:00:08 +00:00
|
|
|
if( permission('student') ){ // si l'utilisateur est connecté et que c'est un élève
|
2015-10-28 17:08:12 +00:00
|
|
|
|
|
|
|
$request = new stdClass(); $answer = new stdClass();
|
|
|
|
|
|
|
|
$request->level_1 = 'getByEtudiant';
|
|
|
|
$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
|
|
|
|
|
|
|
modules_switch_level_1($request, $answer);
|
|
|
|
|
|
|
|
if( $answer->request == 'success' ){ // si on a bien récupéré les membres du groupe
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2015-11-15 14:42:12 +00:00
|
|
|
echo "<section name='studentsmodules' data-title='Mes modules' class='basic'>";
|
2015-10-28 22:33:16 +00:00
|
|
|
|
2015-11-15 18:10:33 +00:00
|
|
|
echo "<table class='partlist' name='UE'><tbody><tr>";
|
|
|
|
if( $ueOpt == null ) echo "<td data-value='*' class='active'>Tous</td>";
|
|
|
|
else echo "<td data-value='*'>Tous</td>";
|
|
|
|
|
|
|
|
foreach($answer->UEs as $UE)
|
|
|
|
if( $UE['nom'] == $ueOpt ) // si c'est le semestre séléctionné
|
|
|
|
echo "<td data-value='".$UE['nom']."' class='active'>".$UE['nom'].'</td>';
|
|
|
|
else // sinon on affiche normalement
|
|
|
|
echo "<td data-value='".$UE['nom']."'>".$UE['nom'].'</td>';
|
|
|
|
echo "</tr></tbody></table>";
|
|
|
|
|
2015-11-03 22:20:54 +00:00
|
|
|
foreach($answer->UEs as $UE){
|
2015-11-15 18:10:33 +00:00
|
|
|
|
|
|
|
if( $ueOpt == null || $UE['nom'] == $ueOpt ){
|
|
|
|
|
|
|
|
echo "<table class='basic'>";
|
|
|
|
echo "<thead class='normal'>";
|
2015-11-03 22:20:54 +00:00
|
|
|
echo '<tr>';
|
2015-11-15 18:10:33 +00:00
|
|
|
echo '<th colspan=5><strong>'.$UE['semestre'].'</strong> - '.$UE['nom'].' - '.$UE['libelle'].'</th>';
|
2015-11-03 22:20:54 +00:00
|
|
|
echo '</tr>';
|
2015-11-15 18:10:33 +00:00
|
|
|
echo '</thead>';
|
|
|
|
echo '<tbody>';
|
|
|
|
foreach($UE['modules'] as $MODULE){
|
|
|
|
echo '<tr>';
|
|
|
|
echo '<td>'.$MODULE['nom'].'</td>';
|
|
|
|
echo '<td>'.$MODULE['libelle'].'</td>';
|
|
|
|
echo '</tr>';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '</tbody>';
|
|
|
|
echo '</table>';
|
|
|
|
|
|
|
|
}
|
2015-10-28 17:08:12 +00:00
|
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2015-10-28 22:33:16 +00:00
|
|
|
echo '</section>';
|
2015-10-28 17:08:12 +00:00
|
|
|
}else
|
2015-11-15 14:42:12 +00:00
|
|
|
echo "<section name='studentsmodules' data-title='Mes modules' class='basic'><table class=basic><tbody><tr><td>Aucun module trouvé</td></tr></tbody></table></section>";
|
2015-10-28 17:08:12 +00:00
|
|
|
|
|
|
|
} ?>
|
2015-11-06 22:00:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- mes modules -->
|
|
|
|
|
|
|
|
<?php
|
|
|
|
/****************************************/
|
|
|
|
/*** MES MODULES (version enseignant) ***/
|
|
|
|
/****************************************/
|
2015-11-08 21:30:23 +00:00
|
|
|
if( permission('teacher') ){ // si l'utilisateur est un prof
|
2015-11-06 22:00:08 +00:00
|
|
|
|
|
|
|
$request = new stdClass(); $answer = new stdClass();
|
|
|
|
|
|
|
|
$request->level_1 = 'getByEnseignant';
|
|
|
|
$request->enseignant = $_SESSION['identifiant'];
|
|
|
|
$request->annee = $_SESSION['annee'];
|
|
|
|
|
|
|
|
modules_switch_level_1($request, $answer);
|
|
|
|
|
|
|
|
if( $answer->request == 'success' ){ // si on a bien récupéré les membres du groupe
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2015-11-15 14:42:12 +00:00
|
|
|
echo "<section name='teachersmodules' data-title='Mes modules' class='basic'>";
|
2015-11-06 22:00:08 +00:00
|
|
|
|
2015-11-15 18:10:33 +00:00
|
|
|
|
|
|
|
echo "<table class='partlist' name='UE'><tbody><tr>";
|
|
|
|
if( $ueOpt == null ) echo "<td data-value='*' class='active'>Tous</td>";
|
|
|
|
else echo "<td data-value='*'>Tous</td>";
|
|
|
|
|
|
|
|
foreach($answer->UEs as $UE)
|
|
|
|
if( $UE['nom'] == $ueOpt ) // si c'est le semestre séléctionné
|
|
|
|
echo "<td data-value='".$UE['nom']."' class='active'>".$UE['nom'].'</td>';
|
|
|
|
else // sinon on affiche normalement
|
|
|
|
echo "<td data-value='".$UE['nom']."'>".$UE['nom'].'</td>';
|
|
|
|
echo "</tr></tbody></table>";
|
|
|
|
|
|
|
|
|
2015-11-06 22:00:08 +00:00
|
|
|
foreach($answer->UEs as $UE){
|
2015-11-15 18:10:33 +00:00
|
|
|
|
|
|
|
if( $ueOpt == null || $UE['nom'] == $ueOpt ){
|
|
|
|
|
|
|
|
echo "<table class='basic'>";
|
|
|
|
echo "<thead class='normal'>";
|
2015-11-06 22:00:08 +00:00
|
|
|
echo '<tr>';
|
2015-11-15 18:10:33 +00:00
|
|
|
echo '<th colspan=5><strong>'.$UE['semestre'].'</strong> - '.$UE['nom'].' - '.$UE['libelle'].'</th>';
|
2015-11-06 22:00:08 +00:00
|
|
|
echo '</tr>';
|
2015-11-15 18:10:33 +00:00
|
|
|
echo '</thead>';
|
|
|
|
echo '<tbody>';
|
|
|
|
foreach($UE['modules'] as $MODULE){
|
|
|
|
echo '<tr>';
|
|
|
|
echo '<td>'.$MODULE['nom'].'</td>';
|
|
|
|
echo '<td>'.$MODULE['libelle'].'</td>';
|
|
|
|
echo '</tr>';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '</tbody>';
|
|
|
|
echo '</table>';
|
|
|
|
|
|
|
|
}
|
2015-11-06 22:00:08 +00:00
|
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
echo '</section>';
|
|
|
|
}else
|
2015-11-15 14:42:12 +00:00
|
|
|
echo "<section name='teachersmodules' data-title='Mes modules' class='basic'><table class=basic><tbody><tr><td>Aucun module trouvé</td></tr></tbody></table></section>";
|
2015-11-06 22:00:08 +00:00
|
|
|
} ?>
|
|
|
|
|
|
|
|
|
2015-11-08 21:30:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- tous les modules -->
|
|
|
|
|
|
|
|
<?php
|
|
|
|
/****************************************/
|
|
|
|
/*** TOUT LES MODULES (version admin) ***/
|
|
|
|
/****************************************/
|
|
|
|
if( permission('admin') ){ // si l'utilisateur est un admin
|
|
|
|
|
|
|
|
$request = new stdClass(); $answer = new stdClass();
|
|
|
|
|
|
|
|
$request->level_1 = 'getByYear';
|
|
|
|
$request->annee = $_SESSION['annee'];
|
|
|
|
|
|
|
|
modules_switch_level_1($request, $answer);
|
|
|
|
|
|
|
|
if( $answer->request == 'success' ){ // si on a bien récupéré les membres du groupe
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2015-11-15 14:42:12 +00:00
|
|
|
echo "<section name='allmodules' data-title='Tous les modules' class='basic'>";
|
2015-11-08 21:30:23 +00:00
|
|
|
|
2015-11-15 18:10:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* ON RECUPERE UNE LISTE UNIQUE DES SEMESTRES */
|
|
|
|
// $ListeNomsSemestres = array();
|
|
|
|
// foreach($answer->UEs as $UE)
|
|
|
|
// array_push( $ListeNomsSemestres, $UE['semestre'] );
|
|
|
|
// $ListeNomsSemestres = array_unique($ListeNomsSemestres);
|
|
|
|
|
|
|
|
/* ON RECUPERE UNE LISTE UNIQUE DES UEs */
|
|
|
|
$ListeNomsUE = array();
|
|
|
|
foreach($answer->UEs as $UE)
|
|
|
|
array_push( $ListeNomsUE, $UE['nom'] );
|
|
|
|
$ListeNomsUE = array_unique($ListeNomsUE);
|
|
|
|
|
|
|
|
|
|
|
|
echo "<table class='partlist' name='UE'><tbody><tr>";
|
|
|
|
if( $ueOpt == null ) echo "<td data-value='*' class='active'>Tous</td>";
|
|
|
|
else echo "<td data-value='*'>Tous</td>";
|
|
|
|
|
|
|
|
foreach($ListeNomsUE as $NomUE)
|
|
|
|
if( $NomUE == $ueOpt ) // si c'est le semestre séléctionné
|
|
|
|
echo "<td data-value='".$NomUE."' class='active'>".$NomUE.'</td>';
|
|
|
|
else // sinon on affiche normalement
|
|
|
|
echo "<td data-value='".$NomUE."'>".$NomUE.'</td>';
|
|
|
|
echo "</tr></tbody></table>";
|
|
|
|
|
|
|
|
|
2015-11-08 21:30:23 +00:00
|
|
|
foreach($answer->UEs as $UE){
|
2015-11-15 18:10:33 +00:00
|
|
|
|
|
|
|
if( $ueOpt == null || $UE['nom'] == $ueOpt ){
|
|
|
|
|
|
|
|
echo "<table class='basic'>";
|
|
|
|
echo "<thead class='normal'>";
|
2015-11-08 21:30:23 +00:00
|
|
|
echo '<tr>';
|
2015-11-15 18:10:33 +00:00
|
|
|
echo '<th colspan=5><strong>'.$UE['semestre'].'</strong> - '.$UE['nom'].' - '.$UE['libelle'].'</th>';
|
2015-11-08 21:30:23 +00:00
|
|
|
echo '</tr>';
|
2015-11-15 18:10:33 +00:00
|
|
|
echo '</thead>';
|
|
|
|
echo '<tbody>';
|
|
|
|
foreach($UE['modules'] as $MODULE){
|
|
|
|
echo '<tr>';
|
|
|
|
echo '<td>'.$MODULE['nom'].'</td>';
|
|
|
|
echo '<td>'.$MODULE['libelle'].'</td>';
|
|
|
|
echo '</tr>';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '</tbody>';
|
|
|
|
echo '</table>';
|
|
|
|
|
|
|
|
}
|
2015-11-08 21:30:23 +00:00
|
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
echo '</section>';
|
|
|
|
}else
|
2015-11-15 14:42:12 +00:00
|
|
|
echo "<section name='allmodules' data-title='Tous les modules' class='basic'><table class='basic'><tbody><tr><td>Aucun module trouvé</td></tr></tbody></table></section>";
|
2015-11-08 21:30:23 +00:00
|
|
|
|
|
|
|
} ?>
|
|
|
|
|
|
|
|
|