161 lines
4.5 KiB
PHP
Executable File
161 lines
4.5 KiB
PHP
Executable File
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
|
|
require_once __ROOT__.'/manager/security.php';
|
|
require_once __ROOT__.'/manager/groups.php';
|
|
require_once __ROOT__.'/manager/modules.php';
|
|
|
|
/****************************************
|
|
* *
|
|
* SECTION "MODULES" *
|
|
* *
|
|
*****************************************
|
|
*
|
|
* [1] MES MODULES (studend + prof)
|
|
* [2] MES MODULES (prof)
|
|
*
|
|
*****************************************/
|
|
?>
|
|
|
|
|
|
<!-- mes modules -->
|
|
|
|
<?php
|
|
/**************************************/
|
|
/*** MES MODULES (version étudiant) ***/
|
|
/**************************************/
|
|
if( permission('student') ){ // si l'utilisateur est connecté et que c'est un élève
|
|
|
|
$request = new stdClass(); $answer = new stdClass();
|
|
|
|
$request->level_1 = 'getByEtudiant';
|
|
$request->etudiant = $_SESSION['identifiant'];
|
|
$request->semestre = $_SESSION['semestre'];
|
|
$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
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
echo "<section name='studentsmodules' title='Mes modules' class='basic'>";
|
|
|
|
foreach($answer->UEs as $UE){
|
|
echo "<table class='basic'>";
|
|
echo "<thead class='active'>";
|
|
echo '<tr>';
|
|
echo '<th colspan=5>'.$UE['nom'].' - '.$UE['libelle'].'</th>';
|
|
echo '</tr>';
|
|
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>';
|
|
}
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
echo '</section>';
|
|
}else
|
|
echo "Erreur interne.";
|
|
|
|
} ?>
|
|
|
|
|
|
|
|
<!-- mes modules -->
|
|
|
|
<?php
|
|
/****************************************/
|
|
/*** MES MODULES (version enseignant) ***/
|
|
/****************************************/
|
|
if( permission('teacher') ){ // si l'utilisateur est un prof
|
|
|
|
$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
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
echo "<section name='teachersmodules' title='Mes modules' class='basic'>";
|
|
|
|
foreach($answer->UEs as $UE){
|
|
echo "<table class='basic'>";
|
|
echo "<thead class='active'>";
|
|
echo '<tr>';
|
|
echo '<th colspan=5>'.$UE['nom'].' - '.$UE['libelle'].'</th>';
|
|
echo '</tr>';
|
|
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>';
|
|
}
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
echo '</section>';
|
|
}else
|
|
echo "Erreur interne.";
|
|
|
|
} ?>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 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
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
echo "<section name='allmodules' title='Mes modules' class='basic'>";
|
|
|
|
foreach($answer->UEs as $UE){
|
|
echo "<table class='basic'>";
|
|
echo "<thead class='active'>";
|
|
echo '<tr>';
|
|
echo '<th colspan=5>'.$UE['nom'].' - '.$UE['libelle'].'</th>';
|
|
echo '</tr>';
|
|
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>';
|
|
}
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
echo '</section>';
|
|
}else
|
|
echo "Erreur interne.";
|
|
|
|
} ?>
|
|
|
|
|