diff --git a/API.js b/API.js index d5b8def..a04ec9b 100755 --- a/API.js +++ b/API.js @@ -51,7 +51,7 @@ APIClass.prototype = { if( ptrAPI.xhr[i].readyState == 4 ){ // si la requête est terminée /* DEBUG : affiche la réponse BRUTE de API.php */ - // console.log('API.php => '+ptrAPI.xhr[i].responseText); + console.log('API.php => '+ptrAPI.xhr[i].responseText); console.log(JSON.parse(ptrAPI.xhr[i].responseText) ); /* si success de requête */ diff --git a/API.php b/API.php index a6a9177..a3bc203 100755 --- a/API.php +++ b/API.php @@ -46,10 +46,12 @@ require_once __ROOT__.'/manager/security.php'; break; - /********************/ - /* CALCUL DES NOTES */ - /********************/ - case 'MCC': + /********************************/ + /* DOSSIER ETUDIANT (NOTES,...) */ + /********************************/ + case 'career': + if( isset($request->level_1) ){ require_once __ROOT__.'/manager/career.php'; career_switch_level_1($request, $answer); } + else { $answer->request = 'missing_level_1'; } break; diff --git a/css/menu.css b/css/menu.css index 605a7f5..29792c9 100755 --- a/css/menu.css +++ b/css/menu.css @@ -126,10 +126,9 @@ /* gestion des différentes icônes */ #MENU span:nth-child(2){ background-image: url(../src/menu/menu_icon/home.svg); } #MENU span:nth-child(3){ background-image: url(../src/menu/menu_icon/groups.svg); } -#MENU span:nth-child(4){ background-image: url(../src/menu/menu_icon/ue.svg); } -#MENU span:nth-child(5){ background-image: url(../src/menu/menu_icon/modules.svg); } -#MENU span:nth-child(6){ background-image: url(../src/menu/menu_icon/marks.svg); } -#MENU span:nth-child(7){ background-image: url(../src/menu/menu_icon/settings.svg); } +#MENU span:nth-child(4){ background-image: url(../src/menu/menu_icon/modules.svg); } +#MENU span:nth-child(5){ background-image: url(../src/menu/menu_icon/career.svg); } +#MENU span:nth-child(6){ background-image: url(../src/menu/menu_icon/settings.svg); } /* gestion de l'activation des différentes icônes */ @@ -138,13 +137,11 @@ #MENU span:nth-child(3):hover, #MENU span:nth-child(3).active{ background-image: url(../src/menu/menu_icon/groups@hover.svg); } #MENU span:nth-child(4):hover, -#MENU span:nth-child(4).active{ background-image: url(../src/menu/menu_icon/ue@hover.svg); } +#MENU span:nth-child(4).active{ background-image: url(../src/menu/menu_icon/modules@hover.svg); } #MENU span:nth-child(5):hover, -#MENU span:nth-child(5).active{ background-image: url(../src/menu/menu_icon/modules@hover.svg); } +#MENU span:nth-child(5).active{ background-image: url(../src/menu/menu_icon/career@hover.svg); } #MENU span:nth-child(6):hover, -#MENU span:nth-child(6).active{ background-image: url(../src/menu/menu_icon/marks@hover.svg); } -#MENU span:nth-child(7):hover, -#MENU span:nth-child(7).active{ background-image: url(../src/menu/menu_icon/settings@hover.svg); } +#MENU span:nth-child(6).active{ background-image: url(../src/menu/menu_icon/settings@hover.svg); } diff --git a/index.php b/index.php index 9abf1af..fd914d4 100755 --- a/index.php +++ b/index.php @@ -51,9 +51,8 @@ $notifNotifNum = 5; Accueil Composition - Suivi - Modules - Notes + Modules + Parcours Paramètres diff --git a/js/actionScript.js b/js/actionScript.js index 7a96d04..a4e8522 100755 --- a/js/actionScript.js +++ b/js/actionScript.js @@ -61,7 +61,7 @@ var connected = !( DOM.AUTH.children[0].innerHTML == 'Connexion' ); pageM = new pageManager(); // instance principale /* initialisation du gestionnaire */ - pageM.setPage(null, 'page', DOM.CONTAINER, ['home', 'groups', 'ue', 'modules', 'marks', 'auth', 'settings'] ); + pageM.setPage(null, 'page', DOM.CONTAINER, ['home', 'groups', 'modules', 'career', 'settings'] ); /* [b] API.js diff --git a/manager/career.php b/manager/career.php new file mode 100755 index 0000000..a91fa1b --- /dev/null +++ b/manager/career.php @@ -0,0 +1,96 @@ +level_1 ){ + + /*******************************/ + /* liste des notes par modules */ + /*******************************/ + case 'getNotesByModules': + $areSetParam = isset($request->etudiant) && isset($request->semestre) && isset($request->annee); // les arguments existent + $typeOkParam = $areSetParam && is_string($request->etudiant) && is_string($request->semestre) && is_string($request->annee); // si c'est des strings + $nEmptyParam = $typeOkParam && strlen($request->etudiant) > 0 && is_numeric($request->semestre) && is_numeric($request->annee); // des bon types + $etudiantCheck = $nEmptyParam && preg_match('/^[\w -]{6,100}$/i', $request->etudiant); // nom bon format + $semestreCheck = $etudiantCheck && preg_match('/^[1-4]{1}$/i', $request->semestre); // semestre (semestre) bon format + $anneeCheck = $semestreCheck && preg_match('/^[0-9]{4}$/i', $request->annee); // semestre (annee) bon format + + if( $anneeCheck ){ // si tout les paramètres sont bons + $notes = DataBase::getInstance()->getNotesByModules($request->etudiant, $request->semestre, $request->annee); + + if( is_array($notes) ){ // si on a bien un tableau + $answer->notes = $notes; // on renvoie dans answer->note + $answer->request = 'success'; // et on renvoie success + }else // sinon si c'est pas un tableau + $answer->request = $notes; // on retourne l'erreur + }else + $answer->request = 'param_error'; + break; + + /***************************/ + /* liste des notes par UEs */ + /***************************/ + case 'getNotesByUEs': + $areSetParam = isset($request->etudiant) && isset($request->semestre) && isset($request->annee); // les arguments existent + $typeOkParam = $areSetParam && is_string($request->etudiant) && is_string($request->semestre) && is_string($request->annee); // si c'est des strings + $nEmptyParam = $typeOkParam && strlen($request->etudiant) > 0 && is_numeric($request->semestre) && is_numeric($request->annee); // des bon types + $etudiantCheck = $nEmptyParam && preg_match('/^[\w -]{6,100}$/i', $request->etudiant); // nom bon format + $semestreCheck = $etudiantCheck && preg_match('/^[1-4]{1}$/i', $request->semestre); // semestre (semestre) bon format + $anneeCheck = $semestreCheck && preg_match('/^[0-9]{4}$/i', $request->annee); // semestre (annee) bon format + + if( $anneeCheck ){ // si tout les paramètres sont bons + $notes = DataBase::getInstance()->getNotesByUEs($request->etudiant, $request->semestre, $request->annee); + + if( is_array($notes) ){ // si on a bien un tableau + $answer->notes = $notes; // on renvoie dans answer->note + $answer->request = 'success'; // et on renvoie success + }else // sinon si c'est pas un tableau + $answer->request = $notes; // on retourne l'erreur + }else + $answer->request = 'param_error'; + break; + + + + + /***********/ + /* DEFAULT */ + /***********/ + default: + $answer->request = 'unknown_level_1'; + break; + } + + } + + +?> \ No newline at end of file diff --git a/manager/database.php b/manager/database.php index 2ec1bb6..b8af32d 100755 --- a/manager/database.php +++ b/manager/database.php @@ -24,7 +24,7 @@ class DataBase{ /* retourne une instance de la classe */ public static function getInstance(){ - return new DataBase("localhost", "sid2", "php", "Qt358nUdyeTxLDM8"); + return new DataBase("localhost", "sid", "php", "Qt358nUdyeTxLDM8"); } /*********************************************/ @@ -350,7 +350,7 @@ class DataBase{ return 'unknown_group'; // si on a l'UID utilisateur & l'UID groupe => on récupère les modules - $getModuleList = $this->pdo->prepare("SELECT DISTINCT m.nom, m.libelle ". + $getModuleList = $this->pdo->prepare("SELECT DISTINCT m.id_module as id, m.nom as nom, m.libelle as libelle ". "FROM module as m, groupe as g, semestre as s, programme as prog, ue, appartenance as app ". "WHERE app.id_semestre = prog.id_semestre ". "AND app.id_semestre = s.id_semestre ". @@ -381,6 +381,377 @@ class DataBase{ + /**************************************/ + /*** retourne les UEs d'un étudiant ***/ + /**************************************/ + public function getUEsEtudiant($etudiant, $semestre, $annee){ + /*** on cherche un semestre avec ce rang et cette année (qui est unique) ***/ + $getSemestreUID = $this->pdo->prepare("SELECT id_semestre as id FROM semestre WHERE rang = :rang AND annee = :annee"); + $getSemestreUID->execute(array( + ':rang' => $semestre, + ':annee' => $annee + )); + + // si on trouve, on le définit, sinon on retourne "unknown_group" + if( $semestreUID = $getSemestreUID->fetch()['id'] ) + $semestreUID = (int) $semestreUID; + else + return 'unknown_semestre'; + + + + /*** on cherche un utilisateur avec cet identifiant ***/ + $getEtudiantUID = $this->pdo->prepare("SELECT identifiant as id FROM utilisateur WHERE identifiant = :etudiant"); + $getEtudiantUID->execute(array( + ':etudiant' => $etudiant + )); + + // si on trouve, on le définit, sinon on retourne "unknown_user" + if( $etudiantUID = $getEtudiantUID->fetch()['id'] ) + $etudiantUID = $etudiantUID; + else + return 'unknown_user'; + + /*** on cherche le groupe de cet utilisateur ***/ + $getGroupeUID = $this->pdo->prepare("SELECT g.id_groupe as id ". + "FROM utilisateur as u, groupe as g, appartenance as app, semestre as s ". + "WHERE app.id_etudiant = u.identifiant ". + "AND app.id_groupe = g.id_groupe ". + "AND app.id_semestre = s.id_semestre ". + + "AND u.identifiant = :etudiantUID ". + "AND app.id_semestre = :semestreUID"); + $getGroupeUID->execute(array( + ':etudiantUID' => $etudiantUID, + ':semestreUID' => $semestreUID, + )); + + // si on trouve, on le définit, sinon on retourne "unknown_user" + if( $groupeUID = $getGroupeUID->fetch()['id'] ) + $groupeUID = $groupeUID; + else + return 'unknown_group'; + + // si on a l'UID utilisateur & l'UID groupe => on récupère les modules + $getUEList = $this->pdo->prepare("SELECT DISTINCT ue.id_ue as id, s.annee as annee, ue.nom as nom, ue.libelle as libelle ". + "FROM module as m, groupe as g, semestre as s, programme as prog, ue, appartenance as app ". + "WHERE app.id_semestre = prog.id_semestre ". + "AND app.id_semestre = s.id_semestre ". + "AND app.id_groupe = g.id_groupe ". + "AND prog.id_ue = ue.id_ue ". + "AND prog.id_module = m.id_module ". + + "AND g.id_groupe = :groupeUID ". + "AND app.id_semestre = :semestreUID ". + "ORDER BY m.nom, m.libelle ASC"); + $getUEList->execute(array( + ':groupeUID' => $groupeUID, + ':semestreUID' => $semestreUID + )); + + $UElist = $getUEList->fetchAll(); // on récupère la liste des modules + + // on supprime les doublons des entrées (indice numérique) + for( $i = 0 ; $i < count($UElist) ; $i++ ) // pour tout les modules + foreach($UElist[$i] as $col => $val) // pour toutes les entrées + if( is_int($col) ) // si l'indice est un entier + unset( $UElist[$i][$col] ); // on le supprime + + return $UElist; + } + + + /**************************************/ + /*** retourne les notes par modules ***/ + /**************************************/ + public function getNotesByModules($etudiant, $semestre, $annee){ + /*** on cherche un semestre avec ce rang et cette année (qui est unique) ***/ + $getSemestreUID = $this->pdo->prepare("SELECT id_semestre as id FROM semestre WHERE rang = :rang AND annee = :annee"); + $getSemestreUID->execute(array( + ':rang' => $semestre, + ':annee' => $annee + )); + + // si on trouve, on le définit, sinon on retourne "unknown_group" + if( $semestreUID = $getSemestreUID->fetch()['id'] ) + $semestreUID = (int) $semestreUID; + else + return 'unknown_semestre'; + + + /*** on cherche un utilisateur avec cet identifiant ***/ + $getEtudiantUID = $this->pdo->prepare("SELECT u.identifiant as id FROM utilisateur as u, appartenance as app ". + "WHERE u.identifiant = app.id_etudiant ". + "AND u.identifiant = :etudiant ". + "AND app.id_semestre = :semestreUID"); + $getEtudiantUID->execute(array( + ':etudiant' => $etudiant, + ':semestreUID' => $semestreUID + )); + + // si on trouve, on le définit, sinon on retourne "unknown_user" + if( $etudiantUID = $getEtudiantUID->fetch()['id'] ) + $etudiantUID = $etudiantUID; + else + return 'unknown_user'; + + + $notelist = array(); // tableau qui contiendra tout les modules + + $modulelist = $this->getModulesEtudiant($etudiant, $semestre, $annee); // on récupère la liste des modules + + foreach($modulelist as $module){ // pour chaque module + + $notes = $this->getModuleNotes($etudiant, $module['nom'], $semestre, $annee); // on récupère les notes + + $current = array(); // on créé l'entrée qui sera dans le tableau de retour + $current['module'] = array(); + $current['module']['nom'] = $module['nom']; // contenant le nom du module + $current['module']['libelle'] = $module['libelle']; // contenant le nom du module + $current['notes'] = $notes; // et la liste de notes + + array_push($notelist, $current); // on l'ajoute au résultat + } + + return $notelist; + } + + + /*********************************/ + /*** retourne les notes par UE ***/ + /*********************************/ + public function getNotesByUEs($etudiant, $semestre, $annee){ + /*** on cherche un semestre avec ce rang et cette année (qui est unique) ***/ + $getSemestreUID = $this->pdo->prepare("SELECT id_semestre as id FROM semestre WHERE rang = :rang AND annee = :annee"); + $getSemestreUID->execute(array( + ':rang' => $semestre, + ':annee' => $annee + )); + + // si on trouve, on le définit, sinon on retourne "unknown_group" + if( $semestreUID = $getSemestreUID->fetch()['id'] ) + $semestreUID = (int) $semestreUID; + else + return 'unknown_semestre'; + + + /*** on cherche un utilisateur avec cet identifiant ***/ + $getEtudiantUID = $this->pdo->prepare("SELECT u.identifiant as id FROM utilisateur as u, appartenance as app ". + "WHERE u.identifiant = app.id_etudiant ". + "AND u.identifiant = :etudiant ". + "AND app.id_semestre = :semestreUID"); + $getEtudiantUID->execute(array( + ':etudiant' => $etudiant, + ':semestreUID' => $semestreUID + )); + + // si on trouve, on le définit, sinon on retourne "unknown_user" + if( $etudiantUID = $getEtudiantUID->fetch()['id'] ) + $etudiantUID = $etudiantUID; + else + return 'unknown_user'; + + + $notelist = array(); // tableau qui contiendra tout les modules + + $UElist = $this->getUEsEtudiant($etudiant, $semestre, $annee); // on récupère la liste des modules + + foreach($UElist as $UE){ // pour chaque module + + $notes = $this->getUENotes($etudiant, $UE['nom'], $semestre, $annee); // on récupère les notes + + $current = array(); // on créé l'entrée qui sera dans le tableau de retour + $current['UE'] = array(); + $current['UE']['annee'] = $UE['annee']; // contenant l'annee du UE + $current['UE']['nom'] = $UE['nom']; // contenant le nom du UE + $current['UE']['libelle'] = $UE['libelle']; // contenant le libelle du UE + $current['notes'] = $notes; // et la liste de notes + + array_push($notelist, $current); // on l'ajoute au résultat + } + + return $notelist; + } + + + + /**************************************/ + /*** retourne les notes d'un module ***/ + /**************************************/ + public function getModuleNotes($etudiant, $module, $semestre, $annee){ + /*** on cherche un semestre avec ce rang et cette année (qui est unique) ***/ + $getSemestreUID = $this->pdo->prepare("SELECT id_semestre as id FROM semestre WHERE rang = :rang AND annee = :annee"); + $getSemestreUID->execute(array( + ':rang' => $semestre, + ':annee' => $annee + )); + + // si on trouve, on le définit, sinon on retourne "unknown_group" + if( $semestreUID = $getSemestreUID->fetch()['id'] ) + $semestreUID = (int) $semestreUID; + else + return 'unknown_semestre'; + + + /*** on cherche un utilisateur avec cet identifiant ***/ + $getEtudiantUID = $this->pdo->prepare("SELECT identifiant as id FROM utilisateur as u, appartenance as app ". + "WHERE u.identifiant = app.id_etudiant ". + "AND u.identifiant = :etudiant ". + "AND app.id_semestre = :semestreUID"); + $getEtudiantUID->execute(array( + ':etudiant' => $etudiant, + ':semestreUID' => $semestreUID + )); + + // si on trouve, on le définit, sinon on retourne "unknown_user" + if( $etudiantUID = $getEtudiantUID->fetch()['id'] ) + $etudiantUID = $etudiantUID; + else + return 'unknown_user'; + + + + /*** on cherche un module avec ce nom, en accord avec le semestre et l'étudiant ***/ + $getModuleUID = $this->pdo->prepare("SELECT m.id_module as id FROM module as m, appartenance as app, programme as prog ". + "WHERE prog.id_module = m.id_module ". + "AND prog.id_semestre = app.id_semestre ". + "AND m.nom = :module ". + "AND app.id_etudiant = :etudiantUID ". + "AND app.id_semestre = :semestreUID"); + $getModuleUID->execute(array( + ':module' => $module, + ':etudiantUID' => $etudiantUID, + ':semestreUID' => $semestreUID + )); + + // si on trouve, on le définit, sinon on retourne "unknown_group" + if( $moduleUID = $getModuleUID->fetch()['id'] ) + $moduleUID = (int) $moduleUID; + else + return 'unknown_module'; + + // si on a l'UID utilisateur & l'UID groupe => on récupère les modules + $getModuleList = $this->pdo->prepare("SELECT note.intitule, note.valeur, note.base ". + "FROM note, appartenance as app, programme as prog, semestre as s, module as m ". + "WHERE note.id_appartenance = app.id_appartenance ". + "AND note.id_programme = prog.id_programme ". + "AND prog.id_module = m.id_module ". + "AND prog.id_semestre = s.id_semestre ". + + "AND prog.id_module = :moduleUID ". + "AND app.id_etudiant = :etudiantUID ". + "AND s.id_semestre = :semestreUID ". + "ORDER BY note.valeur, note.base ASC"); + $getModuleList->execute(array( + ':moduleUID' => $moduleUID, + ':etudiantUID' => $etudiantUID, + ':semestreUID' => $semestreUID + )); + + $notes = $getModuleList->fetchAll(); // on récupère la liste des notes + + // on supprime les doublons des entrées (indice numérique) + for( $i = 0 ; $i < count($notes) ; $i++ ) // pour toutes les notes + foreach($notes[$i] as $col => $val) // pour toutes les entrées + if( is_int($col) ) // si l'indice est un entier + unset( $notes[$i][$col] ); // on le supprime + + return $notes; + } + + + + + + /**********************************/ + /*** retourne les notes d'un UE ***/ + /**********************************/ + public function getUENotes($etudiant, $UE, $semestre, $annee){ + /*** on cherche un semestre avec ce rang et cette année (qui est unique) ***/ + $getSemestreUID = $this->pdo->prepare("SELECT id_semestre as id FROM semestre WHERE rang = :rang AND annee = :annee"); + $getSemestreUID->execute(array( + ':rang' => $semestre, + ':annee' => $annee + )); + + // si on trouve, on le définit, sinon on retourne "unknown_group" + if( $semestreUID = $getSemestreUID->fetch()['id'] ) + $semestreUID = (int) $semestreUID; + else + return 'unknown_semestre'; + + + /*** on cherche un utilisateur avec cet identifiant ***/ + $getEtudiantUID = $this->pdo->prepare("SELECT identifiant as id FROM utilisateur as u, appartenance as app ". + "WHERE u.identifiant = app.id_etudiant ". + "AND u.identifiant = :etudiant ". + "AND app.id_semestre = :semestreUID"); + $getEtudiantUID->execute(array( + ':etudiant' => $etudiant, + ':semestreUID' => $semestreUID + )); + + // si on trouve, on le définit, sinon on retourne "unknown_user" + if( $etudiantUID = $getEtudiantUID->fetch()['id'] ) + $etudiantUID = $etudiantUID; + else + return 'unknown_user'; + + + /*** on cherche un module avec ce nom, en accord avec le semestre et l'étudiant ***/ + $getUEUID = $this->pdo->prepare("SELECT ue.id_ue as id ". + "FROM module as m, appartenance as app, programme as prog, ue ". + "WHERE prog.id_module = m.id_module ". + "AND prog.id_semestre = app.id_semestre ". + "AND prog.id_ue = ue.id_ue ". + + "AND ue.nom = :UE ". + "AND app.id_etudiant = :etudiantUID ". + "AND app.id_semestre = :semestreUID"); + $getUEUID->execute(array( + ':UE' => $UE, + ':etudiantUID' => $etudiantUID, + ':semestreUID' => $semestreUID + )); + + // si on trouve, on le définit, sinon on retourne "unknown_group" + if( $UEUID = $getUEUID->fetch()['id'] ) + $UEUID = (int) $UEUID; + else + return 'unknown_UE'; + + + // si on a l'UID utilisateur & l'UID UE => on récupère les notes + $getUEList = $this->pdo->prepare("SELECT note.intitule, note.valeur, note.base ". + "FROM note, appartenance as app, programme as prog, semestre as s, module as m ". + "WHERE note.id_appartenance = app.id_appartenance ". + "AND note.id_programme = prog.id_programme ". + "AND prog.id_module = m.id_module ". + "AND prog.id_semestre = s.id_semestre ". + + "AND prog.id_ue = :UEUID ". + "AND app.id_etudiant = :etudiantUID ". + "AND s.id_semestre = :semestreUID ". + "ORDER BY note.valeur, note.base ASC"); + $getUEList->execute(array( + ':UEUID' => $UEUID, + ':etudiantUID' => $etudiantUID, + ':semestreUID' => $semestreUID + )); + + $notes = $getUEList->fetchAll(); // on récupère la liste des notes + + // on supprime les doublons des entrées (indice numérique) + for( $i = 0 ; $i < count($notes) ; $i++ ) // pour toutes les notes + foreach($notes[$i] as $col => $val) // pour toutes les entrées + if( is_int($col) ) // si l'indice est un entier + unset( $notes[$i][$col] ); // on le supprime + + return $notes; + } + + + diff --git a/manager/user.php b/manager/user.php index 25adea0..df09b47 100755 --- a/manager/user.php +++ b/manager/user.php @@ -161,6 +161,11 @@ require_once __ROOT__.'/manager/database.php'; // on définit les variables session $_SESSION['identifiant'] = $username; $_SESSION['droits'] = $userList->{$username}->permissions; + + /******************************* TEMPO *********************************/ + $_SESSION['annee'] = '2015'; + $_SESSION['semestre'] = '2'; + /***********************************************************************/ return 'success'; }else return 'wrong_password'; diff --git a/page/career.php b/page/career.php index 12bea97..61b7064 100755 --- a/page/career.php +++ b/page/career.php @@ -1 +1,119 @@ -career.php \ No newline at end of file + + + + + +level_1 = 'getNotesByModules'; + $request->etudiant = $_SESSION['identifiant']; + $request->semestre = $_SESSION['semestre']; + $request->annee = $_SESSION['annee']; + + career_switch_level_1($request, $answer); + + if( $answer->request == 'success' ){ // si on a bien récupéré les modules/notes + //////////////////////////////////////////////////////////////////////////////// + echo "
"; + + foreach($answer->notes as $module){ + + echo ""; + echo ""; + echo ''; + echo ''; + echo ''; + + echo ''; + echo ''; + foreach($module['notes'] as $note){ + echo ''; + echo ''; + echo ''; + echo ''; + } + echo ''; + echo '
'.$module['module']['nom'].' - '.$module['module']['libelle'].'
'.$note['intitule'].''.$note['valeur'].'/'.$note['base'].'
'; + } + //////////////////////////////////////////////////////////////////////////////// + echo '
'; + }else + echo "Erreur interne."; + +} ?> + + + + + + + +level_1 = 'getNotesByUEs'; + $request->etudiant = $_SESSION['identifiant']; + $request->semestre = $_SESSION['semestre']; + $request->annee = $_SESSION['annee']; + + career_switch_level_1($request, $answer); + + if( $answer->request == 'success' ){ // si on a bien récupéré les UE/notes + //////////////////////////////////////////////////////////////////////////////// + echo "
"; + + foreach($answer->notes as $UE){ + + echo ""; + echo ""; + echo ''; + echo ''; + echo ''; + + echo ''; + echo ''; + foreach($UE['notes'] as $note){ + echo ''; + echo ''; + echo ''; + echo ''; + } + echo ''; + echo '
'.$UE['UE']['nom'].' - '.$UE['UE']['libelle'].'
'.$note['intitule'].''.$note['valeur'].'/'.$note['base'].'
'; + } + //////////////////////////////////////////////////////////////////////////////// + echo '
'; + }else + echo "Erreur interne."; + +} ?> diff --git a/page/groups.php b/page/groups.php index 3f8d0af..bb4c460 100755 --- a/page/groups.php +++ b/page/groups.php @@ -27,8 +27,8 @@ require_once __ROOT__.'/manager/groups.php'; $answer = new stdClass(); $request->level_1 = 'grouplist'; - $request->semestre = '3'; - $request->annee = '2015'; + $request->semestre = $_SESSION['semestre']; + $request->annee = $_SESSION['annee']; groups_switch_level_1($request, $answer); @@ -100,8 +100,8 @@ if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'student' ){ // s $request->level_1 = 'get'; $request->etudiant = $_SESSION['identifiant']; - $request->semestre = '3'; - $request->annee = '2015'; + $request->semestre = $_SESSION['semestre']; + $request->annee = $_SESSION['annee']; groups_switch_level_1($request, $answer); @@ -111,8 +111,8 @@ if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'student' ){ // s $request = new stdClass(); $answer = new stdClass(); $request->level_1 = 'userlist'; $request->groupe = $monGroupe; - $request->semestre = '3'; - $request->annee = '2015'; + $request->semestre = $_SESSION['semestre']; + $request->annee = $_SESSION['annee']; groups_switch_level_1($request, $answer); if( $answer->request == 'success' ){ // si on a bien récupéré les membres du groupe @@ -163,8 +163,8 @@ if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'admin' ){ // si $answer = new stdClass(); $request->level_1 = 'grouplist'; - $request->semestre = '3'; - $request->annee = '2015'; + $request->semestre = $_SESSION['semestre']; + $request->annee = $_SESSION['annee']; groups_switch_level_1($request, $answer); diff --git a/page/marks.php b/page/marks.php deleted file mode 100755 index 58569ea..0000000 --- a/page/marks.php +++ /dev/null @@ -1 +0,0 @@ -Notes ici !!! \ No newline at end of file diff --git a/page/modules.php b/page/modules.php index 2af4f79..e9f73d6 100755 --- a/page/modules.php +++ b/page/modules.php @@ -1,19 +1,16 @@ @@ -28,12 +25,11 @@ require_once __ROOT__.'/manager/modules.php'; if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'student' ){ // si l'utilisateur est connecté et que c'est un élève $request = new stdClass(); $answer = new stdClass(); - debug(); $request->level_1 = 'getByEtudiant'; $request->etudiant = $_SESSION['identifiant']; - $request->semestre = '3'; - $request->annee = '2015'; + $request->semestre = $_SESSION['semestre']; + $request->annee = $_SESSION['annee']; modules_switch_level_1($request, $answer); diff --git a/src/menu/menu_icon/ue.svg b/src/menu/menu_icon/career.svg similarity index 100% rename from src/menu/menu_icon/ue.svg rename to src/menu/menu_icon/career.svg diff --git a/src/menu/menu_icon/ue@hover.svg b/src/menu/menu_icon/career@hover.svg similarity index 100% rename from src/menu/menu_icon/ue@hover.svg rename to src/menu/menu_icon/career@hover.svg diff --git a/src/userlist.json b/src/userlist.json index 3e8a8a9..b45b65b 100755 --- a/src/userlist.json +++ b/src/userlist.json @@ -4,7 +4,7 @@ "password" : "eleve1password" }, - "eme1913a": { + "ydw1981a": { "permissions": "student", "password" : "password" }, diff --git a/xdoc/MCD.png b/xdoc/MCD.png old mode 100644 new mode 100755 index 334b8da..be9e071 Binary files a/xdoc/MCD.png and b/xdoc/MCD.png differ diff --git a/xdoc/requêtes_sql_types.sql b/xdoc/requêtes_sql_types.sql index f242420..b5c13a8 100755 --- a/xdoc/requêtes_sql_types.sql +++ b/xdoc/requêtes_sql_types.sql @@ -144,7 +144,7 @@ ORDER BY s.annee, ue.nom, m.nom ASC /******************************************/ /*** AFFICHE LES ETUDIANTS PAR SEMESTRE ***/ /******************************************/ -SELECT DISTINCT s.annee as annee, s.nom as semestre, u.identifiant+'-' as etudiant +SELECT DISTINCT s.annee as annee, s.nom as semestre, u.identifiant as etudiant FROM utilisateur as u, semestre as s, appartenance as app WHERE app.id_etudiant = u.identifiant AND app.id_semestre = s.id_semestre diff --git a/xdoc/sid.sql b/xdoc/sid.sql index e060e5b..2ad7d57 100755 --- a/xdoc/sid.sql +++ b/xdoc/sid.sql @@ -19,8 +19,8 @@ SET time_zone = "+00:00"; -- -- Base de données: `sid2` -- -CREATE DATABASE IF NOT EXISTS `sid2` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; -USE `sid2`; +CREATE DATABASE IF NOT EXISTS `sid` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; +USE `sid`; -- -------------------------------------------------------- @@ -55,106 +55,106 @@ CREATE TABLE IF NOT EXISTS `appartenance` ( -- INSERT INTO `appartenance` (`id_appartenance`, `id_etudiant`, `id_groupe`, `id_semestre`) VALUES -(1, 'ydw1981a', 25, 3), -(2, 'ihf1991a', 26, 4), -(3, 'mma1990a', 23, 3), -(4, 'lme1952a', 9, 3), -(5, 'imf1922a', 9, 3), -(6, 'gyy1983a', 28, 4), -(7, 'otm1902a', 28, 4), -(8, 'tnx1949a', 25, 3), -(9, 'sjl1937a', 12, 2), -(10, 'anj1991a', 4, 2), -(11, 'xdh1989a', 6, 4), -(12, 'agl1956a', 11, 1), -(13, 'mhu1946a', 17, 1), -(14, 'cvv1936a', 22, 2), -(15, 'mzh1955a', 27, 4), -(16, 'pdi1904a', 13, 3), -(17, 'cuk1947a', 23, 3), -(18, 'non1968a', 7, 1), -(19, 'hmn1970a', 16, 1), -(20, 'hth1975a', 22, 2), -(21, 'liw1940a', 11, 1), -(22, 'dtg1946a', 6, 4), -(23, 'oxz1985a', 12, 2), -(24, 'ono1984a', 27, 4), -(25, 'auy1966a', 10, 4), -(26, 'dui1946a', 27, 4), -(27, 'cyw1979a', 4, 2), -(28, 'pfv1965a', 11, 1), -(29, 'oqz1937a', 13, 3), -(30, 'aft1950a', 20, 2), -(31, 'bae1943a', 22, 2), -(32, 'kul1903a', 19, 1), -(33, 'rmj1965a', 9, 3), -(34, 'yyt1926a', 16, 1), -(35, 'ktz1997a', 27, 4), -(36, 'hku1995a', 5, 3), -(37, 'zgy1948a', 7, 1), -(38, 'vau1957a', 7, 1), -(39, 'hsx1927a', 5, 3), -(40, 'eca1977a', 11, 1), -(41, 'wpa1966a', 4, 2), -(42, 'qoe1974a', 16, 1), -(43, 'tkz1955a', 7, 1), -(44, 'wnx1995a', 16, 1), -(45, 'sft1994a', 9, 3), -(46, 'vgb1979a', 22, 2), -(47, 'wbt1993a', 11, 1), -(48, 'xtb1903a', 27, 4), -(49, 'msj1985a', 25, 3), -(50, 'wvn1982a', 20, 2), -(51, 'psg1965a', 25, 3), -(52, 'hpa1908a', 24, 3), -(53, 'maq1980a', 21, 2), -(54, 'agq1929a', 28, 4), -(55, 'gwe1975a', 6, 4), -(56, 'gdb1939a', 4, 2), -(57, 'jrc1974a', 17, 1), -(58, 'jfa1965a', 10, 4), -(59, 'buz1982a', 24, 3), -(60, 'mhr1952a', 10, 4), -(61, 'pos1958a', 7, 1), -(62, 'xdi1926a', 11, 1), -(63, 'awl1901a', 25, 3), -(64, 'uix1942a', 7, 1), -(65, 'ngz1932a', 26, 4), -(66, 'kpf1942a', 26, 4), -(67, 'aiv1989a', 23, 3), -(68, 'sjw1936a', 21, 2), -(69, 'fei1944a', 8, 2), -(70, 'zge1937a', 10, 4), -(71, 'rpl1936a', 4, 2), -(72, 'hrv1902a', 12, 2), -(73, 'djo1928a', 5, 3), -(74, 'scm1996a', 13, 3), -(75, 'ylq1926a', 26, 4), -(76, 'eme1913a', 5, 3), -(77, 'otv1930a', 27, 4), -(78, 'cda1951a', 20, 2), -(79, 'eee1933a', 26, 4), -(80, 'kfx1995a', 27, 4), -(81, 'jgd1966a', 19, 1), -(82, 'rwg1909a', 21, 2), -(83, 'ngw1997a', 20, 2), -(84, 'obg1973a', 24, 3), -(85, 'hzg1935a', 14, 4), -(86, 'iyh1918a', 10, 4), -(87, 'tdc1978a', 8, 2), -(88, 'swd1951a', 5, 3), -(89, 'vdj1905a', 12, 2), -(90, 'bit1985a', 8, 2), -(91, 'iah1936a', 6, 4), -(92, 'ypt1989a', 19, 1), -(93, 'ljc1902a', 26, 4), -(94, 'hcc1997a', 24, 3), -(95, 'bky1924a', 11, 1), -(96, 'vul1953a', 12, 2), -(97, 'ssr1906a', 21, 2), -(98, 'yjh1944a', 16, 1), -(99, 'ste1994a', 21, 2), -(100, 'ypo1964a', 9, 3); +(1, 'ydw1981a', 25, 3), +(2, 'ihf1991a', 26, 4), +(3, 'mma1990a', 23, 3), +(4, 'lme1952a', 9, 3), +(5, 'imf1922a', 9, 3), +(6, 'gyy1983a', 28, 4), +(7, 'otm1902a', 28, 4), +(8, 'tnx1949a', 25, 3), +(9, 'sjl1937a', 12, 2), +(10, 'anj1991a', 4, 2), +(11, 'xdh1989a', 6, 4), +(12, 'agl1956a', 11, 1), +(13, 'mhu1946a', 17, 1), +(14, 'cvv1936a', 22, 2), +(15, 'mzh1955a', 27, 4), +(16, 'pdi1904a', 13, 3), +(17, 'cuk1947a', 23, 3), +(18, 'non1968a', 7, 1), +(19, 'hmn1970a', 16, 1), +(20, 'hth1975a', 22, 2), +(21, 'liw1940a', 11, 1), +(22, 'dtg1946a', 6, 4), +(23, 'oxz1985a', 12, 2), +(24, 'ono1984a', 27, 4), +(25, 'auy1966a', 10, 4), +(26, 'dui1946a', 27, 4), +(27, 'cyw1979a', 4, 2), +(28, 'pfv1965a', 11, 1), +(29, 'oqz1937a', 13, 3), +(30, 'aft1950a', 20, 2), +(31, 'bae1943a', 22, 2), +(32, 'kul1903a', 19, 1), +(33, 'rmj1965a', 9, 3), +(34, 'yyt1926a', 16, 1), +(35, 'ktz1997a', 27, 4), +(36, 'hku1995a', 5, 3), +(37, 'zgy1948a', 7, 1), +(38, 'vau1957a', 7, 1), +(39, 'hsx1927a', 5, 3), +(40, 'eca1977a', 11, 1), +(41, 'wpa1966a', 4, 2), +(42, 'qoe1974a', 16, 1), +(43, 'tkz1955a', 7, 1), +(44, 'wnx1995a', 16, 1), +(45, 'sft1994a', 9, 3), +(46, 'vgb1979a', 22, 2), +(47, 'wbt1993a', 11, 1), +(48, 'xtb1903a', 27, 4), +(49, 'msj1985a', 25, 3), +(50, 'wvn1982a', 20, 2), +(51, 'psg1965a', 25, 3), +(52, 'hpa1908a', 24, 3), +(53, 'maq1980a', 21, 2), +(54, 'agq1929a', 28, 4), +(55, 'gwe1975a', 6, 4), +(56, 'gdb1939a', 4, 2), +(57, 'jrc1974a', 17, 1), +(58, 'jfa1965a', 10, 4), +(59, 'buz1982a', 24, 3), +(60, 'mhr1952a', 10, 4), +(61, 'pos1958a', 7, 1), +(62, 'xdi1926a', 11, 1), +(63, 'awl1901a', 25, 3), +(64, 'uix1942a', 7, 1), +(65, 'ngz1932a', 26, 4), +(66, 'kpf1942a', 26, 4), +(67, 'aiv1989a', 23, 3), +(68, 'sjw1936a', 21, 2), +(69, 'fei1944a', 8, 2), +(70, 'zge1937a', 10, 4), +(71, 'rpl1936a', 4, 2), +(72, 'hrv1902a', 12, 2), +(73, 'djo1928a', 5, 3), +(74, 'scm1996a', 13, 3), +(75, 'ylq1926a', 26, 4), +(76, 'eme1913a', 5, 3), +(77, 'otv1930a', 27, 4), +(78, 'cda1951a', 20, 2), +(79, 'eee1933a', 26, 4), +(80, 'kfx1995a', 27, 4), +(81, 'jgd1966a', 19, 1), +(82, 'rwg1909a', 21, 2), +(83, 'ngw1997a', 20, 2), +(84, 'obg1973a', 24, 3), +(85, 'hzg1935a', 14, 4), +(86, 'iyh1918a', 10, 4), +(87, 'tdc1978a', 8, 2), +(88, 'swd1951a', 5, 3), +(89, 'vdj1905a', 12, 2), +(90, 'bit1985a', 8, 2), +(91, 'iah1936a', 6, 4), +(92, 'ypt1989a', 19, 1), +(93, 'ljc1902a', 26, 4), +(94, 'hcc1997a', 24, 3), +(95, 'bky1924a', 11, 1), +(96, 'vul1953a', 12, 2), +(97, 'ssr1906a', 21, 2), +(98, 'yjh1944a', 16, 1), +(99, 'ste1994a', 21, 2), +(100, 'ypo1964a', 9, 3); -- -------------------------------------------------------- @@ -221,25 +221,25 @@ CREATE TABLE IF NOT EXISTS `module` ( -- INSERT INTO `module` (`id_module`, `nom`, `libelle`) VALUES -(1, 'M1101', 'Bases de l''algorithmique'), -- S1 - UE1 -(2, 'M1102', 'Programmation web'), -- S1 - UE1 -(3, 'M1201', 'Affiche'), -- S1 - UE2 -(4, 'M1202', 'Journal'), -- S1 - UE2 +(1, 'M1101', 'Bases de l''algorithmique' ), -- S1 - UE1 +(2, 'M1102', 'Programmation web' ), -- S1 - UE1 +(3, 'M1201', 'Affiche' ), -- S1 - UE2 +(4, 'M1202', 'Journal' ), -- S1 - UE2 -(5, 'M2101', 'Base de la POO'), -- S2 - UE1 -(6, 'M2102', 'Ada'), -- S2 - UE1 -(7, 'M2201', 'Revue de projet'), -- S2 - UE2 -(8, 'M2202', 'Magazine'), -- S2 - UE2 +(5, 'M2101', 'Base de la POO' ), -- S2 - UE1 +(6, 'M2102', 'Ada' ), -- S2 - UE1 +(7, 'M2201', 'Revue de projet' ), -- S2 - UE2 +(8, 'M2202', 'Magazine' ), -- S2 - UE2 (9, 'M3301', 'Algorithmique et structures de données'), -- S3 - UE3 -(10, 'M3302', 'POO avancée'), -- S3 - UE3 -(11, 'M3401', 'Curriculum Vitae'), -- S3 - UE4 -(12, 'M3402', 'Lettre de motivation'), -- S3 - UE4 +(10, 'M3302', 'POO avancée' ), -- S3 - UE3 +(11, 'M3401', 'Curriculum Vitae' ), -- S3 - UE4 +(12, 'M3402', 'Lettre de motivation' ), -- S3 - UE4 -(13, 'M4301', 'Programmation serveur: PHP'), -- S4 - UE3 -(14, 'M4302', 'Informatique en stage'); -- S4 - UE3 -(15, 'M4401', 'Entretien'); -- S4 - UE4 -(16, 'M4402', 'Communication en stage'); -- S4 - UE4 +(13, 'M4301', 'Programmation serveur: PHP' ), -- S4 - UE3 +(14, 'M4302', 'Informatique en stage' ), -- S4 - UE3 +(15, 'M4401', 'Entretien' ), -- S4 - UE4 +(16, 'M4402', 'Communication en stage' ); -- S4 - UE4 -- -------------------------------------------------------- @@ -271,26 +271,26 @@ CREATE TABLE IF NOT EXISTS `note` ( -- INSERT INTO `note` (`id_note`, `id_appartenance`, `id_programme`, `valeur`, `base`) VALUES -(1, 6, 1, 1, 20), -- 01/20 -(2, 7, 1, 2, 20), -- 02/20 -(3, 7, 1, 3, 20), -- 03/20 -(4, 7, 1, 4, 20), -- 04/20 -(5, 7, 1, 5, 20), -- 05/20 -(6, 7, 1, 6, 20), -- 06/20 -(7, 7, 1, 7, 20), -- 07/20 -(8, 7, 1, 8, 20), -- 08/20 -(9, 7, 1, 9, 20), -- 09/20 -(10, 7, 1, 10, 20), -- 10/20 -(11, 6, 1, 11, 20), -- 11/20 -(12, 7, 1, 12, 20), -- 12/20 -(13, 7, 1, 13, 20), -- 13/20 -(14, 7, 1, 14, 20), -- 14/20 -(15, 7, 1, 15, 20), -- 15/20 -(16, 7, 1, 16, 20), -- 16/20 -(17, 7, 1, 17, 20), -- 17/20 -(18, 7, 1, 18, 20), -- 18/20 -(19, 7, 1, 19, 20), -- 19/20 -(20, 7, 1, 20, 20); -- 20/20 +(1, 1, 1, 1, 20), -- 01/20 +(2, 1, 1, 2, 20), -- 02/20 +(3, 1, 1, 3, 20), -- 03/20 +(4, 1, 1, 4, 20), -- 04/20 +(5, 1, 1, 5, 20), -- 05/20 +(6, 1, 1, 6, 20), -- 06/20 +(7, 1, 1, 7, 20), -- 07/20 +(8, 1, 1, 8, 20), -- 08/20 +(9, 1, 1, 9, 20), -- 09/20 +(10, 1, 1, 10, 20), -- 10/20 +(11, 1, 1, 11, 20), -- 11/20 +(12, 1, 1, 12, 20), -- 12/20 +(13, 1, 1, 13, 20), -- 13/20 +(14, 1, 1, 14, 20), -- 14/20 +(15, 1, 1, 15, 20), -- 15/20 +(16, 1, 1, 16, 20), -- 16/20 +(17, 1, 1, 17, 20), -- 17/20 +(18, 1, 1, 18, 20), -- 18/20 +(19, 1, 1, 19, 20), -- 19/20 +(20, 1, 1, 20, 20); -- 20/20 -- -------------------------------------------------------- @@ -324,14 +324,25 @@ CREATE TABLE IF NOT EXISTS `programme` ( -- INSERT INTO `programme` (`id_programme`, `id_module`, `id_ue`, `id_semestre`) VALUES -(1, 1, 1, 1), -(2, 2, 1, 1), -(3, 3, 2, 2), -(4, 4, 2, 2), -(5, 5, 3, 3), -(6, 6, 3, 3), -(7, 7, 4, 4), -(8, 8, 4, 4); +(1, 1, 1, 1), -- M1101 - UE1 - S1 +(2, 2, 1, 1), -- M1102 - UE1 - S1 +(3, 3, 2, 1), -- M1201 - UE2 - S1 +(4, 4, 2, 1), -- M1202 - UE2 - S1 + +(5, 5, 1, 2), -- M2101 - UE1 - S2 +(6, 6, 1, 2), -- M2102 - UE1 - S2 +(7, 7, 2, 2), -- M2201 - UE2 - S2 +(8, 8, 2, 2), -- M2202 - UE2 - S2 + +(9, 9, 3, 3), -- M3301 - UE3 - S3 +(10, 10, 3, 3), -- M3302 - UE3 - S3 +(11, 11, 4, 3), -- M3401 - UE4 - S3 +(12, 12, 4, 3), -- M3402 - UE4 - S3 + +(13, 13, 3, 4), -- M4301 - UE3 - S4 +(14, 14, 3, 4), -- M4302 - UE3 - S4 +(15, 15, 4, 4), -- M4401 - UE4 - S4 +(16, 16, 4, 4); -- M4402 - UE4 - S4 -- -------------------------------------------------------- @@ -359,9 +370,9 @@ INSERT INTO `semestre` (`id_semestre`, `nom`, `rang`, `annee`) VALUES (4, 'S4', 4, 2015), (5, 'S1', 0, 2016), -(7, 'S2', 2, 2016), -(8, 'S3', 3, 2016), -(9, 'S4', 4, 2016); +(6, 'S2', 2, 2016), +(7, 'S3', 3, 2016), +(8, 'S4', 4, 2016); -- --------------------------------------------------------