425 lines
7.7 KiB
PHP
Executable File
425 lines
7.7 KiB
PHP
Executable File
<?php define('__ROOT__', dirname(__FILE__) );
|
|
require_once __ROOT__.'/manager/security.php';
|
|
|
|
/***************/
|
|
/*** A FAIRE ***/
|
|
/***************
|
|
|
|
[ ] Lors du déplacement par drag'n'drop, déplacer l'élève au bon endroit (classé alphabétiquement)
|
|
[ ] Refaire le design des tableaux en utilisant xdoc/flat_table_design.jpg
|
|
|
|
/***************/
|
|
/***************/
|
|
/***************/
|
|
|
|
/*** CRÉATION D'UTILISATEUR ***/
|
|
|
|
// require('manager/user.php');
|
|
// debug();
|
|
|
|
// $request = new stdClass();
|
|
// $answer = new stdClass();
|
|
|
|
// $request->level_1 = 'create';
|
|
// $request->identifiant = 'fvg1856a';
|
|
// $request->prenom = 'guillaume';
|
|
// $request->nom = 'fauvet';
|
|
// $request->mail = 'guillaume.fauvet@etu.iut-tlse3.fr';
|
|
// $request->mdp = ' Test_Password _';
|
|
// $request->droits = 'student';
|
|
|
|
|
|
|
|
// user_switch_level_1($request, $answer);
|
|
|
|
|
|
|
|
// echo var_dump( $answer );
|
|
|
|
// echo '<br><br><br><br><br><br><br>It works !';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
debug();
|
|
|
|
|
|
/* [1] On récupère le semestre d'un étudiant
|
|
=====================================================*/
|
|
// var_dump( DataBase::getInstance()->applyJuryTo('Etud100', 95, 'DEM') );
|
|
// var_dump( DataBase::getInstance()->saisieNoteMultiple(589, array(
|
|
// [ 'etudiant' => 'Etud100', 'valeur' => '10' ],
|
|
// [ 'etudiant' => 'Etud101', 'valeur' => '10' ],
|
|
// [ 'etudiant' => 'Etud134', 'valeur' => '10' ]
|
|
// )) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $_SESSION['annee'] = 2015;
|
|
|
|
// require_once __ROOT__.'/manager/security.php';
|
|
|
|
// $_SESSION['identifiant'] = 'modele'; // afin de lire le fichier
|
|
|
|
// $r1 = new stdClass(); $a1 = new stdClass();
|
|
// $r1->level_1 = 'import_mcc';
|
|
|
|
// xlsx_switch_lvl1($r1, $a1);
|
|
|
|
// if( $a1->request == 'success' ){
|
|
|
|
// $mcc = $a1->mcc;
|
|
// $ue11 = $mcc[0]; $ue11mods = $ue11['modules'];
|
|
// $ue12 = $mcc[1]; $ue12mods = $ue12['modules'];
|
|
|
|
|
|
// var_dump( $ue11mods[0]['controles'] );
|
|
|
|
// // $r2 = new stdClass(); $a2 = new stdClass();
|
|
// // $r2->level_1 = 'addUserlist';
|
|
// // $r2->rang = 1;
|
|
// // $r2->annee = 2018;
|
|
// // $r2->formationList = $a1->formationList;
|
|
|
|
// // groups_switch_level_1($r2, $a2);
|
|
|
|
// // var_dump( $a2 );
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $request = new stdClass(); $answer = new stdClass();
|
|
// $request->level_1 = 'updateRole';
|
|
// $request->identifiant = 'admin';
|
|
// $request->admin = null;
|
|
// $request->master = null;
|
|
// $request->addModule = null;
|
|
// $request->delModule = 42;
|
|
|
|
// user_switch_level_1($request, $answer);
|
|
|
|
// var_dump( $answer );
|
|
|
|
|
|
|
|
// $_SESSION['semestre_pair'] = !$_SESSION['semestre_pair'];
|
|
// var_dump( $_SESSION['semestre_pair'] );
|
|
|
|
// var_dump( utf8_decode( utf8_decode('Introduction aux systèmes informatiques')) );
|
|
|
|
// on affiche les modules d'un étudiant
|
|
// var_dump( DataBase::getInstance()->getModulesByUEByEtudiant(
|
|
// $_SESSION['identifiant'],
|
|
// $_SESSION['semestre'],
|
|
// $_SESSION['annee']
|
|
// ) );
|
|
|
|
|
|
// // on affiche les controle d'un étudiant pour un module, semestre particulier
|
|
// $UEList = ueRepo::forStudent($_SESSION['identifiant'], $_SESSION['semestre']);
|
|
|
|
// foreach($UEList as $iter_ue=>$a){
|
|
// $UEList[$iter_ue]['modules'] = moduleRepo::forStudent($UEList[$iter_ue]['id'], $UEList[$iter_ue]['id_semestre']);
|
|
|
|
// foreach($UEList[$iter_ue]['modules'] as $iter_mod=>$b){
|
|
// $UEList[$iter_ue]['modules'][$iter_mod]['controles'] = controleRepo::forStudent($UEList[$iter_ue]['modules'][$iter_mod]['id'], $UEList[$iter_ue]['id_semestre']);
|
|
|
|
// foreach($UEList[$iter_ue]['modules'][$iter_mod]['controles'] as $iter_ct=>$c)
|
|
// $UEList[$iter_ue]['modules'][$iter_mod]['controles'][$iter_ct]['notes'] = noteRepo::forStudent($_SESSION['identifiant'], $UEList[$iter_ue]['modules'][$iter_mod]['controles'][$iter_ct]['id']);
|
|
// }
|
|
|
|
// }
|
|
// var_dump( $UEList[0]['modules'][0]['controles'][0] );
|
|
|
|
|
|
|
|
|
|
|
|
/*** RETOURNE LE SEMESTRE COURANT D'UN ETUDIANT ***/
|
|
require_once __ROOT__.'/manager/security.php';
|
|
|
|
// $request = new stdClass();
|
|
// $answer = new stdClass();
|
|
|
|
|
|
// $request->level_1 = 'getSemestre';
|
|
// $request->etudiant = 'mrd1609a';
|
|
|
|
// groups_switch_level_1($request, $answer);
|
|
|
|
// echo var_dump( $answer );
|
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** CRÉATION GROUPE ***/
|
|
require_once __ROOT__.'/manager/security.php';
|
|
|
|
// $request = new stdClass();
|
|
// $answer = new stdClass();
|
|
|
|
// $request->level_1 = 'create';
|
|
// $request->nom = 'S4C';
|
|
|
|
// groups_switch_level_1($request, $answer);
|
|
|
|
// echo var_dump( $answer );
|
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** AJOUT D'UN UTILISATEUR À UN GROUPE ***/
|
|
|
|
// require __ROOT__.'/manager/groups.php';
|
|
|
|
|
|
// $request = new stdClass();
|
|
// $answer = new stdClass();
|
|
|
|
// $request->level_1 = 'add';
|
|
// $request->etudiant = 'fvg1856a'; // utilisateur.identifiant
|
|
// $request->groupe = 'S3A'; // groupe.nom
|
|
// $request->semestre = '3'; // semestre.rang
|
|
// $request->annee = '2015'; // semestre.annee
|
|
|
|
|
|
// groups_switch_level_1($request, $answer);
|
|
|
|
// echo var_dump( $answer );
|
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** AFFICHER LE GROUPE D'UN ETUDIANT ***/
|
|
|
|
// require __ROOT__.'/manager/groups.php';
|
|
|
|
// $request = new stdClass();
|
|
// $answer = new stdClass();
|
|
|
|
// $request->level_1 = 'get';
|
|
// $request->etudiant = 'ihf1991a'; // utilisateur.identifiant
|
|
// $request->semestre = '3'; // groupe.nom
|
|
// $request->annee = '2015'; // groupe.nom
|
|
|
|
|
|
// groups_switch_level_1($request, $answer);
|
|
|
|
// echo var_dump( $answer );
|
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// /*** AFFICHER LE GROUPE D'UN ENSEIGNANT ***/
|
|
|
|
// require __ROOT__.'/manager/groups.php';
|
|
|
|
// $request = new stdClass();
|
|
// $answer = new stdClass();
|
|
|
|
// $request->level_1 = 'grouplistForTeacher';
|
|
// $request->enseignant = 'lbh1609a'; // utilisateur.identifiant
|
|
// // $request->semestre = '3'; // groupe.nom
|
|
// $request->annee = '2015'; // groupe.nom
|
|
// // $request->groupe = 'S1A';
|
|
|
|
// groups_switch_level_1($request, $answer);
|
|
|
|
// var_dump( $answer );
|
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
|
|
|
|
|
|
|
/*** AFFICHER LES GROUPES D'UNE ANNEE ***/
|
|
|
|
// require __ROOT__.'/manager/groups.php';
|
|
|
|
// $request = new stdClass();
|
|
// $answer = new stdClass();
|
|
|
|
// $request->level_1 = 'grouplistForYear';
|
|
// $request->semestre = '3'; // groupe.nom // OPTIONNEL
|
|
// $request->annee = '2015'; // annee
|
|
// // $request->groupe = 'S3A'; // OPTIONNEL
|
|
|
|
// groups_switch_level_1($request, $answer);
|
|
|
|
// var_dump( $answer );
|
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** AFFICHER LES MEMBRES D'UN GROUPE ***/
|
|
|
|
// require('manager/groups.php');
|
|
|
|
// $request = new stdClass();
|
|
// $answer = new stdClass();
|
|
|
|
// $request->level_1 = 'userlist';
|
|
// $request->groupe = 'S3A'; // groupe.nom
|
|
// $request->semestre = '3'; // semestre.rang
|
|
// $request->annee = '2015'; // semestre.annee
|
|
|
|
|
|
// groups_switch_level_1($request, $answer);
|
|
|
|
// echo var_dump( $answer );
|
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** AFFICHER LES MEMBRES DE TOUS LES GROUPES (d'un semestre particulier) ***/
|
|
|
|
// require('manager/groups.php');
|
|
|
|
// $request = new stdClass();
|
|
// $answer = new stdClass();
|
|
|
|
// $request->level_1 = 'grouplist';
|
|
// $request->semestre = '3';
|
|
// $request->annee = '2015';
|
|
|
|
// groups_switch_level_1($request, $answer);
|
|
|
|
// var_dump( $answer );
|
|
// echo '<br><br><br><br>';
|
|
|
|
// foreach($answer->grouplist as $group){
|
|
// echo "<br><br>================";
|
|
// echo "<br>=== GROUPE ".$group->nom." ===<br>";
|
|
// echo "================<br>";
|
|
// foreach($group as $userlist)
|
|
// foreach($userlist as $user){
|
|
// foreach($user as $key=>$value)
|
|
// echo $key.' = '.$value.' | ';
|
|
// echo '<br>';
|
|
// }
|
|
// }
|
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|