2015-10-23 11:08:33 +00:00
|
|
|
<?php define('__ROOT__', dirname(__FILE__) );
|
2015-10-28 17:08:12 +00:00
|
|
|
require_once __ROOT__.'/manager/security.php';
|
2015-10-22 16:55:26 +00:00
|
|
|
|
2015-11-02 11:20:01 +00:00
|
|
|
/***************/
|
|
|
|
/*** 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
|
|
|
|
|
|
|
|
/***************/
|
|
|
|
/***************/
|
|
|
|
/***************/
|
|
|
|
|
2015-10-22 19:19:52 +00:00
|
|
|
/*** CRÉATION D'UTILISATEUR ***/
|
|
|
|
|
|
|
|
// require('manager/user.php');
|
2015-10-28 17:08:12 +00:00
|
|
|
// debug();
|
2015-10-22 19:19:52 +00:00
|
|
|
|
|
|
|
// $request = new stdClass();
|
|
|
|
// $answer = new stdClass();
|
|
|
|
|
|
|
|
// $request->level_1 = 'create';
|
2015-10-28 17:08:12 +00:00
|
|
|
// $request->identifiant = 'fvg1856a';
|
2015-10-23 11:08:33 +00:00
|
|
|
// $request->prenom = 'guillaume';
|
|
|
|
// $request->nom = 'fauvet';
|
2015-10-28 17:08:12 +00:00
|
|
|
// $request->mail = 'guillaume.fauvet@etu.iut-tlse3.fr';
|
|
|
|
// $request->mdp = ' Test_Password _';
|
2015-10-22 19:19:52 +00:00
|
|
|
// $request->droits = 'student';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// user_switch_level_1($request, $answer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// echo var_dump( $answer );
|
|
|
|
|
2015-10-23 08:04:26 +00:00
|
|
|
// echo '<br><br><br><br><br><br><br>It works !';
|
2015-10-22 19:19:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-11 16:41:10 +00:00
|
|
|
// test string
|
|
|
|
echo 'Test sur le type String';
|
|
|
|
var_dump( true == checkParam(array('mrd1609a'), array('string'),array('/^[\w -]{3,50}$/i')) ); // bonnes valeurs
|
|
|
|
var_dump( false == checkParam(array(18), array('string'),array('/^[\w -]{3,50}$/i')) ); // mauvaise variable
|
|
|
|
var_dump( false == checkParam(array('mrd1609a'), array('int'),array('/^[\w -]{3,50}$/i')) ); // mauvais type
|
|
|
|
echo '<br>';
|
|
|
|
|
|
|
|
// test int
|
|
|
|
echo 'Test sur le type int';
|
|
|
|
var_dump( true == checkParam(array(18), array('int'),array('/^[0-9]*$/')) ); // bonnes valeurs
|
|
|
|
var_dump( false == checkParam(array(18), array('string'),array('/^[0-9]*$/i')) ); // mauvaise variable
|
|
|
|
var_dump( false == checkParam(array('18'), array('int'),array('/^[\w -]{3,50}$/i')) ); // mauvais type
|
|
|
|
echo '<br>';
|
|
|
|
|
|
|
|
// test numeric
|
|
|
|
echo 'Test sur le type numeric';
|
|
|
|
var_dump( false == checkParam(array('18'), array('numeric'),array('/^[\w -]{3,50}$/i')) ); // bonnes valeurs
|
|
|
|
var_dump( false == checkParam(array('18'), array('string'),array('/^[\w -]{3,50}$/i')) ); // mauvaise variable
|
|
|
|
var_dump( false == checkParam(array('18'), array('int'),array('/^[\w -]{3,50}$/i')) ); // mauvais type
|
|
|
|
echo '<br>';
|
|
|
|
|
|
|
|
// test array
|
|
|
|
echo 'Test sur le type array';
|
|
|
|
var_dump( true == checkParam(array('mrd1609a','lbh1609'), array('string','string'),array('/^[\w -]{3,50}$/i','/^[\w -]{3,50}$/i')) ); // bonnes valeurs
|
|
|
|
var_dump( false == checkParam(array('mrd1609a','lbh1609'), array('int','int'),array('/^[\w -]{3,50}$/i')) ); // mauvaise variable
|
|
|
|
var_dump( false == checkParam(array('mrd1609a','lbh1609'), array('string','int'),array('/^[x]{3,50}$/i','/^[x]{3,50}$/i')) ); // mauvais regex
|
|
|
|
echo '<br>';
|
|
|
|
|
|
|
|
|
2015-11-10 09:50:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** RETOURNE LE SEMESTRE COURANT D'UN ETUDIANT ***/
|
2015-11-10 09:56:43 +00:00
|
|
|
// require_once __ROOT__.'/manager/groups.php';
|
2015-11-10 09:50:43 +00:00
|
|
|
|
2015-11-10 09:56:43 +00:00
|
|
|
// $request = new stdClass();
|
|
|
|
// $answer = new stdClass();
|
2015-11-10 09:50:43 +00:00
|
|
|
|
|
|
|
|
2015-11-10 09:56:43 +00:00
|
|
|
// $request->level_1 = 'getSemestre';
|
|
|
|
// $request->etudiant = 'mrd1609a';
|
2015-11-10 09:50:43 +00:00
|
|
|
|
2015-11-10 09:56:43 +00:00
|
|
|
// groups_switch_level_1($request, $answer);
|
2015-11-10 09:50:43 +00:00
|
|
|
|
2015-11-10 09:56:43 +00:00
|
|
|
// echo var_dump( $answer );
|
2015-11-10 09:50:43 +00:00
|
|
|
|
2015-11-10 09:56:43 +00:00
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
2015-11-10 09:50:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-22 19:19:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** CRÉATION GROUPE ***/
|
2015-10-28 17:08:12 +00:00
|
|
|
// require_once __ROOT__.'/manager/groups.php';
|
2015-10-22 19:19:52 +00:00
|
|
|
|
|
|
|
// $request = new stdClass();
|
|
|
|
// $answer = new stdClass();
|
|
|
|
|
|
|
|
// $request->level_1 = 'create';
|
2015-10-28 17:08:12 +00:00
|
|
|
// $request->nom = 'S4C';
|
2015-10-22 19:19:52 +00:00
|
|
|
|
|
|
|
// groups_switch_level_1($request, $answer);
|
|
|
|
|
|
|
|
// echo var_dump( $answer );
|
|
|
|
|
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
|
|
|
|
2015-11-10 09:50:43 +00:00
|
|
|
|
2015-10-22 19:19:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-22 16:55:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-22 19:19:52 +00:00
|
|
|
/*** AJOUT D'UN UTILISATEUR À UN GROUPE ***/
|
2015-10-23 11:08:33 +00:00
|
|
|
|
|
|
|
// require __ROOT__.'/manager/groups.php';
|
2015-10-22 19:19:52 +00:00
|
|
|
|
2015-10-28 17:08:12 +00:00
|
|
|
|
2015-10-22 19:19:52 +00:00
|
|
|
// $request = new stdClass();
|
|
|
|
// $answer = new stdClass();
|
|
|
|
|
2015-10-28 17:08:12 +00:00
|
|
|
// $request->level_1 = 'add';
|
|
|
|
// $request->etudiant = 'fvg1856a'; // utilisateur.identifiant
|
|
|
|
// $request->groupe = 'S3A'; // groupe.nom
|
|
|
|
// $request->semestre = '3'; // semestre.rang
|
|
|
|
// $request->annee = '2015'; // semestre.annee
|
2015-10-22 19:19:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
// groups_switch_level_1($request, $answer);
|
|
|
|
|
|
|
|
// echo var_dump( $answer );
|
|
|
|
|
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-28 17:08:12 +00:00
|
|
|
/*** 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 !";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-06 13:05:14 +00:00
|
|
|
// /*** 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 ***/
|
|
|
|
|
2015-11-06 22:00:08 +00:00
|
|
|
// require __ROOT__.'/manager/groups.php';
|
2015-11-06 13:05:14 +00:00
|
|
|
|
2015-11-06 22:00:08 +00:00
|
|
|
// $request = new stdClass();
|
|
|
|
// $answer = new stdClass();
|
2015-11-06 13:05:14 +00:00
|
|
|
|
2015-11-06 22:00:08 +00:00
|
|
|
// $request->level_1 = 'grouplistForYear';
|
|
|
|
// $request->semestre = '3'; // groupe.nom // OPTIONNEL
|
|
|
|
// $request->annee = '2015'; // annee
|
|
|
|
// // $request->groupe = 'S3A'; // OPTIONNEL
|
2015-11-06 13:05:14 +00:00
|
|
|
|
2015-11-06 22:00:08 +00:00
|
|
|
// groups_switch_level_1($request, $answer);
|
2015-11-06 13:05:14 +00:00
|
|
|
|
2015-11-06 22:00:08 +00:00
|
|
|
// var_dump( $answer );
|
2015-10-28 17:08:12 +00:00
|
|
|
|
2015-11-06 22:00:08 +00:00
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
2015-10-28 17:08:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-22 19:19:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*** AFFICHER LES MEMBRES D'UN GROUPE ***/
|
|
|
|
|
2015-10-22 21:06:25 +00:00
|
|
|
// require('manager/groups.php');
|
2015-10-22 19:19:52 +00:00
|
|
|
|
2015-10-22 21:06:25 +00:00
|
|
|
// $request = new stdClass();
|
|
|
|
// $answer = new stdClass();
|
2015-10-22 19:19:52 +00:00
|
|
|
|
2015-10-28 17:08:12 +00:00
|
|
|
// $request->level_1 = 'userlist';
|
|
|
|
// $request->groupe = 'S3A'; // groupe.nom
|
|
|
|
// $request->semestre = '3'; // semestre.rang
|
|
|
|
// $request->annee = '2015'; // semestre.annee
|
2015-10-22 19:19:52 +00:00
|
|
|
|
|
|
|
|
2015-10-22 21:06:25 +00:00
|
|
|
// groups_switch_level_1($request, $answer);
|
2015-10-22 19:19:52 +00:00
|
|
|
|
2015-10-22 21:06:25 +00:00
|
|
|
// echo var_dump( $answer );
|
2015-10-22 16:55:26 +00:00
|
|
|
|
2015-10-22 21:06:25 +00:00
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
2015-10-22 16:55:26 +00:00
|
|
|
|
2015-10-22 19:19:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-23 08:04:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-28 22:33:16 +00:00
|
|
|
/*** AFFICHER LES MEMBRES DE TOUS LES GROUPES (d'un semestre particulier) ***/
|
2015-10-23 08:04:26 +00:00
|
|
|
|
2015-11-06 10:13:32 +00:00
|
|
|
// require('manager/groups.php');
|
2015-10-23 08:04:26 +00:00
|
|
|
|
2015-11-06 10:13:32 +00:00
|
|
|
// $request = new stdClass();
|
|
|
|
// $answer = new stdClass();
|
2015-10-23 08:04:26 +00:00
|
|
|
|
2015-11-06 10:13:32 +00:00
|
|
|
// $request->level_1 = 'grouplist';
|
|
|
|
// $request->semestre = '3';
|
|
|
|
// $request->annee = '2015';
|
2015-10-23 08:04:26 +00:00
|
|
|
|
2015-11-06 10:13:32 +00:00
|
|
|
// groups_switch_level_1($request, $answer);
|
2015-10-23 08:56:22 +00:00
|
|
|
|
2015-11-06 10:13:32 +00:00
|
|
|
// 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>';
|
|
|
|
// }
|
|
|
|
// }
|
2015-10-23 08:04:26 +00:00
|
|
|
|
2015-11-06 10:13:32 +00:00
|
|
|
// echo "<br><br><br><br><br><br><br>It works !";
|
2015-10-23 08:04:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-22 16:55:26 +00:00
|
|
|
?>
|