From 9a75ef5f9fd17ad29808ed67e4f9b70117337c19 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 6 Nov 2015 11:13:32 +0100 Subject: [PATCH] Modifications mineures --- css/global.css | 44 ++++++++++++- manager/database.php | 24 ++++--- page/_JS/groups.js | 10 ++- page/groups.php | 122 +++++++++++++++++++++++++++--------- page/home.php | 5 ++ test.php | 43 ++++++------- xdoc/requêtes_sql_types.sql | 13 ++-- xdoc/sid.sql | 10 ++- 8 files changed, 206 insertions(+), 65 deletions(-) diff --git a/css/global.css b/css/global.css index 4f99ef2..ae98d21 100755 --- a/css/global.css +++ b/css/global.css @@ -145,4 +145,46 @@ span.link{ cursor: pointer; } -span.link:hover{ color: #000; } \ No newline at end of file +span.link:hover{ color: #000; } + +/*********************/ +/*** SELECT/OPTION ***/ +/*********************/ +select{ + /* position */ + margin: 2em 0; + padding: 0 1em; + + /* border */ + border-radius: 5px; + border: 1px solid #ddd; + + /* background */ + background-color: #fff; + + /* foreground */ + color: #233342; + + /* select */ + -webkit-appearance:none; + -moz-appearance:none; + appearance:none; + +} + +select > option{ + /* position */ + padding: 1em 0; + + /* background */ + background-color: #fff; + + /* foreground */ + color: #233342; + text-indent: 1em; +} +/* +select > option:nth-child(4n+0){ color: #e63c54; } +select > option:nth-child(4n+1){ color: #3c73e6; } +select > option:nth-child(4n+2){ color: #e6983c; } +select > option:nth-child(4n+3){ color: #2dcc70; }*/ \ No newline at end of file diff --git a/manager/database.php b/manager/database.php index 8644d9e..055d999 100755 --- a/manager/database.php +++ b/manager/database.php @@ -347,16 +347,26 @@ class DataBase{ // on cherche tout les groupes du même semestre de la même année - $getGroupesUID = $this->pdo->prepare("SELECT DISTINCT g.nom, s.rang, s.nom as semestre ". - "FROM groupe as g, semestre as s, appartenance as app, enseignement as ens, mcc_ue, mcc_module as mcc_m ". - "WHERE g.id_groupe = app.id_groupe ". - "AND s.id_semestre = app.id_semestre ". + $getGroupesUID = $this->pdo->prepare("SELECT DISTINCT s.nom as semestre, s.rang, g.nom as nom ". + "FROM module as m, utilisateur as u, utilisateur as eleve, groupe as g, enseignement as ens, mcc_ue, mcc_module as mcc_m, semestre as s, appartenance as app ". + "WHERE mcc_ue.id_semestre = s.id_semestre ". + "AND mcc_ue.id_mcc_ue = mcc_m.id_mcc_ue ". + + "AND mcc_m.id_module = m.id_module ". + "AND mcc_m.id_mcc_module = ens.id_mcc_module ". + + "AND ens.id_enseignant = u.identifiant ". + + "AND app.id_etudiant = eleve.identifiant ". + "AND app.id_semestre = s.id_semestre ". + "AND app.id_groupe = g.id_groupe ". - "AND s.annee = :annee ". - "ORDER BY g.nom"); + "AND u.identifiant = :enseignantUID ". + "ORDER BY s.rang, g.nom"); $getGroupesUID->execute(array( - ':annee' => $annee + ':annee' => $annee, + ':enseignantUID' => $enseignantUID )); $grouplist = array(); // contiendra tout les groupes diff --git a/page/_JS/groups.js b/page/_JS/groups.js index 0ad5b99..151a848 100755 --- a/page/_JS/groups.js +++ b/page/_JS/groups.js @@ -76,4 +76,12 @@ if( document.querySelector('#CONTAINER section[name=movestudents]') != null ){ / }); }); -} \ No newline at end of file +} + +/***************************************************/ +/*** GESTION DES SELECT POUR AFFINER LES GROUPES ***/ +/***************************************************/ +var selectGroupes = document.querySelectorAll("#CONTAINER > section[name] > select"); +for( var i = 0 ; i < selectGroupes.length ; i++ ) + selectGroupes[i].associatedSection = selectGroupes[i].parentNode.getAttribute('name'); +console.log( selectGroupes ); \ No newline at end of file diff --git a/page/groups.php b/page/groups.php index d3bad8a..98a0722 100755 --- a/page/groups.php +++ b/page/groups.php @@ -25,7 +25,7 @@ require_once __ROOT__.'/manager/groups.php'; * */ if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'student' ){ // si connecté && utilisateur - echo "
"; + echo "
"; $request = new stdClass(); $answer = new stdClass(); @@ -108,6 +108,33 @@ if( $_SESSION['identifiant'] != null && ($_SESSION['droits'] == 'teacher' || $_S if( $answer->request == 'success' ){ // si pas d'erreur ////////////////////////////////////////////////////////////// + /* select pour SEMESTRES */ + $lastSemestre = null; + + echo ""; + + /* select pour GROUPES */ + $lastGroupe = null; + + echo ""; + + echo ""; echo ''; - echo "'; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; } - // echo ''; - - echo ''; - - echo '
Identifiant'; echo 'Prenom'; @@ -172,7 +199,7 @@ if( $_SESSION['identifiant'] != null && ($_SESSION['droits'] == 'teacher' || $_S * */ if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'student' ){ // si l'utilisateur est connecté et que c'est un élève - echo "
"; + echo "
"; $request = new stdClass(); $answer = new stdClass(); @@ -236,19 +263,19 @@ if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'student' ){ // s - + les groupes inscrits aux modules qu'il enseigne * */ if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'teacher' ){ // si l'utilisateur est connecté et que c'est un élève - echo "
"; + echo "
"; $request = new stdClass(); $answer = new stdClass(); $request->level_1 = 'grouplistForTeacher'; /******************************************************************************************************** A FAIRE **/ @@ -258,33 +285,70 @@ if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'teacher' ){ // s if( $answer->request == 'success' ){ // si on a bien récupéré les membres du groupe //////////////////////////////////////////////////////////////////////////////// + + /* select pour SEMESTRES */ + $lastSemestre = null; - echo ""; - echo ''; - echo ''; - echo ''; - echo '
'; - echo 'Groupe '.$monGroupe; - echo '
'; + echo ""; - echo ""; + /* select pour GROUPES */ + $lastGroupe = null; + + echo ""; + + echo "
"; + echo '
Identifiant'; + echo 'Prenom'; + echo 'Nom'; + echo 'Semestre'; + echo 'Groupe'; + echo '
'; + + foreach($answer->grouplist as $group){ // pour chaque groupe + + if( count($group->userlist) > 0 ){ // s'il y a des utilisateurs + + echo ""; + + echo ''; + + + // pour chaque utilisateur + foreach($group->userlist as $user){ + echo ''; + echo "'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + + // echo ''; + + echo ''; + + echo '
".$user['identifiant'].''.$user['prenom'].''.$user['nom'].''.$group->semestre.'Groupe '.$group->nom.'
'; - // pour chaque utilisateur - foreach($answer->userlist as $user){ - echo '
".$user['identifiant'].''.$user['prenom'].''.$user['nom'].''.$user['semestre'].'Groupe '.$monGroupe.'
'; + } //////////////////////////////////////////////////////////////////////////////// }else echo "Erreur interne."; diff --git a/page/home.php b/page/home.php index 629ca5a..4c03378 100755 --- a/page/home.php +++ b/page/home.php @@ -33,11 +33,16 @@ require_once __ROOT__.'/manager/groups.php'; - Saisir des notes si vous en avez l'accès

+ +

Notification 3

Notification 2

Notification 1

+ diff --git a/test.php b/test.php index 6bfd1dc..e573efa 100755 --- a/test.php +++ b/test.php @@ -186,38 +186,39 @@ require_once __ROOT__.'/manager/security.php'; /*** AFFICHER LES MEMBRES DE TOUS LES GROUPES (d'un semestre particulier) ***/ - require('manager/groups.php'); + // require('manager/groups.php'); - $request = new stdClass(); - $answer = new stdClass(); + // $request = new stdClass(); + // $answer = new stdClass(); - $request->level_1 = 'grouplist'; - $request->semestre = '3'; - $request->annee = '2015'; + // $request->level_1 = 'grouplist'; + // $request->semestre = '3'; + // $request->annee = '2015'; - groups_switch_level_1($request, $answer); + // groups_switch_level_1($request, $answer); - var_dump( $answer ); - echo '



'; + // var_dump( $answer ); + // echo '



'; - foreach($answer->grouplist as $group){ - echo "

================"; - echo "
=== GROUPE ".$group->nom." ===
"; - echo "================
"; - foreach($group as $userlist) - foreach($userlist as $user){ - foreach($user as $key=>$value) - echo $key.' = '.$value.' | '; - echo '
'; - } - } + // foreach($answer->grouplist as $group){ + // echo "

================"; + // echo "
=== GROUPE ".$group->nom." ===
"; + // echo "================
"; + // foreach($group as $userlist) + // foreach($userlist as $user){ + // foreach($user as $key=>$value) + // echo $key.' = '.$value.' | '; + // echo '
'; + // } + // } - echo "






It works !"; + // echo "






It works !"; + phpinfo(); diff --git a/xdoc/requêtes_sql_types.sql b/xdoc/requêtes_sql_types.sql index 4708c18..34e3827 100755 --- a/xdoc/requêtes_sql_types.sql +++ b/xdoc/requêtes_sql_types.sql @@ -225,11 +225,14 @@ ORDER BY u.identifiant, u.prenom, u.nom ASC; /*** AFFICHE LES MODULES D'UN ENSEIGNANT ***/ /*******************************************/ SELECT DISTINCT u.prenom, u.nom, m.nom, m.libelle -FROM module as m, utilisateur as u, enseignement as e, programme as prog, semestre as s -WHERE prog.id_module = m.id_module -AND prog.id_semestre = s.id_semestre -AND prog.id_programme = e.id_programme -AND e.id_enseignant = u.identifiant +FROM module as m, utilisateur as u, enseignement as ens, mcc_ue, mcc_module as mcc_m, semestre as s +WHERE mcc_ue.id_semestre = s.id_semestre +AND mcc_ue.id_mcc_ue = mcc_m.id_mcc_ue + +AND mcc_m.id_module = m.id_module +AND mcc_m.id_mcc_module = ens.id_mcc_module + +AND ens.id_enseignant = u.identifiant AND s.annee = 2015 ORDER BY u.prenom, u.nom, m.nom, m.libelle ASC; diff --git a/xdoc/sid.sql b/xdoc/sid.sql index 43dbe49..bb6bdc7 100755 --- a/xdoc/sid.sql +++ b/xdoc/sid.sql @@ -371,7 +371,15 @@ CREATE TABLE IF NOT EXISTS `note` ( -- -- -------------------------------------------------------- - +INSERT INTO `note` (`id_note`, `id_appartenance`, `id_mcc_module`, `date`, `intitule`, `valeur`, `base`, `coefficient`) VALUES +(1, 1, 5, '0000-00-00 00:00:00', 'Partiel 1', 1, 10, 1), +(2, 1, 5, '0000-00-00 00:00:00', 'Partiel 2', 2, 10, 1), +(3, 1, 6, '0000-00-00 00:00:00', 'Partiel 3', 3, 10, 1), +(4, 1, 6, '0000-00-00 00:00:00', 'Partiel 4', 4, 10, 1), +(5, 1, 7, '0000-00-00 00:00:00', 'Partiel 5', 5, 10, 1), +(6, 1, 7, '0000-00-00 00:00:00', 'Partiel 6', 6, 10, 1), +(7, 1, 8, '0000-00-00 00:00:00', 'Partiel 7', 7, 10, 1), +(8, 1, 8, '0000-00-00 00:00:00', 'Partiel 8', 8, 10, 1); -- -- Structure de la table `semestre` --