From 6a2151caa13a7b0ca36b6bb8b645c77fc3e670e4 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 14 Nov 2015 00:47:11 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20l'affichage=20des=20notes=20par=20?= =?UTF-8?q?groupes=20(pour=20les=20profs)=20+=20[=C3=A0=20faire]=20Affinag?= =?UTF-8?q?e=20pour=20un=20groupe=20et/ou=20un=20partiel=20+=20finir=20le?= =?UTF-8?q?=20bordel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/global.css | 51 ++++++++++++++++++++++++--------------- manager/repo/note.php | 18 +++++++++++--- manager/repo/user.php | 2 +- manager/security.php | 8 ++++--- manager/user.php | 2 +- page/_JS/career.js | 33 ++++++++++++++++++++++++++ page/_JS/groups.js | 3 --- page/career.php | 55 ++++++++++++++++++++++++++++++++++--------- page/groups.php | 19 +++++++++++---- src/userlist.json | 19 ++------------- 10 files changed, 148 insertions(+), 62 deletions(-) create mode 100644 page/_JS/career.js diff --git a/css/global.css b/css/global.css index 52a21a3..a8da609 100755 --- a/css/global.css +++ b/css/global.css @@ -9,7 +9,10 @@ .hidden{ display: none !important; } +/* .unstressed */ span.unstressed{ color: #aaa; } +tr:hover > td > span.unstressed{ color: #ddd; } + span.stressed{ font-weight: bold; } @@ -83,31 +86,34 @@ table.basic th{ text-align: left; } /* sans background */ table.basic thead tr th{ background-color: transparent; } -table.basic:nth-child(4n+0) tr td:first-child{ border-left: 10px solid #e63c54; } -table.basic:nth-child(4n+1) tr td:first-child{ border-left: 10px solid #3c73e6; } -table.basic:nth-child(4n+2) tr td:first-child{ border-left: 10px solid #e6983c; } -table.basic:nth-child(4n+3) tr td:first-child{ border-left: 10px solid #2dcc70; } +table.basic:nth-child(4n+0) tr > td:first-child { border-left: 10px solid #e63c54; } +table.basic:nth-child(4n+1) tr > td:first-child { border-left: 10px solid #3c73e6; } +table.basic:nth-child(4n+2) tr > td:first-child { border-left: 10px solid #e6983c; } +table.basic:nth-child(4n+3) tr > td:first-child { border-left: 10px solid #2dcc70; } +table.basic table.basic tr > td:first-child { border-left: 10px solid #9e9e9e; } /* @hover */ -table.basic tr:hover td{ color: #fff; } +table.basic tr:hover > td{ color: #fff; } -table.basic:nth-child(4n+0) tr:hover td{ background-color: rgba(230, 60, 84, 1); } -table.basic:nth-child(4n+1) tr:hover td{ background-color: rgba(60, 115, 230, 1); } -table.basic:nth-child(4n+2) tr:hover td{ background-color: rgba(230, 152, 60, 1); } -table.basic:nth-child(4n+3) tr:hover td{ background-color: rgba(45, 204, 112, 1); } +table.basic:nth-child(4n+0) tr:hover > td { background-color: #e63c54; } +table.basic:nth-child(4n+1) tr:hover > td { background-color: #3c73e6; } +table.basic:nth-child(4n+2) tr:hover > td { background-color: #e6983c; } +table.basic:nth-child(4n+3) tr:hover > td { background-color: #2dcc70; } + +table.basic table.basic tr:hover > td { background-color: #9e9e9e; } /* .noborder */ -table.basic tr.noborder td:first-child{ border-left: 1px solid transparent; } +table.basic tr.noborder > td:first-child{ border-left: 1px solid transparent; } table.basic tr:hover td{ background-color: #fff; } /* .transparentbg */ -table.basic tr.transparentbg td{ background-color: transparent; } -table.basic tr.transparentbg:hover td{ background-color: transparent; } +table.basic tr.transparentbg > td{ background-color: transparent; } +table.basic tr.transparentbg:hover > td{ background-color: transparent; } table.basic tr.transparentbg .link{ background-color: #fff; } -table.basic tr.transparentbg td{ color: inherit; } +table.basic tr.transparentbg > td{ color: inherit; } /******************/ @@ -179,7 +185,8 @@ select{ appearance:none; } -td select{ margin: 0; } +/* pour déplacement d'élève */ +td select{ margin: -1em; padding: .5em; } select > option{ /* position */ @@ -192,6 +199,12 @@ select > option{ color: #233342; text-indent: 1em; } + +/* pour déplacement d'élève */ +td select > option{ padding: 0; } + + + /* select > option:nth-child(4n+0){ color: #e63c54; } select > option:nth-child(4n+1){ color: #3c73e6; } @@ -206,9 +219,9 @@ select > option:nth-child(4n+3){ color: #2dcc70; }*/ /*display: inline-block;*/ display: none; position: absolute; margin-left: 2em; - margin-top: .5em; - width: 2em; - height: 2em; + margin-top: -.2em; + width: 1.5em; + height: 1.5em; /* background */ background: transparent center center no-repeat; @@ -218,5 +231,5 @@ select > option:nth-child(4n+3){ color: #2dcc70; }*/ cursor: pointer; } -.valider_deplacement.active{ display: inline-block; background-image: url(../src/validate.svg); } -tr:hover td .valider_deplacement.active{ background-image: url(../src/validate@hover.svg); } \ No newline at end of file +.valider_deplacement.active{ display: inline-block; background-image: url(../src/validate.svg); } +tr:hover td .valider_deplacement.active{ background-image: url(../src/validate@hover.svg); } \ No newline at end of file diff --git a/manager/repo/note.php b/manager/repo/note.php index 3972d43..13494cb 100755 --- a/manager/repo/note.php +++ b/manager/repo/note.php @@ -111,6 +111,14 @@ class noteRepo extends DBAccess{ } + + + + /* + ** PAS UTILISÉ POUR L'INSTANT + */ + + /* RENVOIE LES NOTES DES ETUDIANTS POUR UN CONTROLE PARTICULIER * * @controle l'UID du controle concerné @@ -119,17 +127,21 @@ class noteRepo extends DBAccess{ * */ public static function forTeacher($controle){ - $getNoteList = DataBase::getPDO()->prepare("SELECT DISTINCT app.id_etudiant as etudiant, n.id_note as id, n.id_appartenance, n.id_controle, n.valeur ". - "FROM note as n, appartenance as app, semestre as s, controle as ctrl, mcc_ue, mcc_module as mcc_m ". + $getNoteList = DataBase::getPDO()->prepare("SELECT DISTINCT g.id_groupe, g.nom as groupe, n.id_note as id, n.id_appartenance, n.id_controle, AVG(n.valeur) as moyenne, min(n.valeur) as min, max(n.valeur) as max, COUNT(n.valeur) as nb_notes ". + "FROM note as n, appartenance as app, semestre as s, controle as ctrl, mcc_ue, mcc_module as mcc_m, groupe as g ". "WHERE n.id_appartenance = app.id_appartenance ". "AND app.id_semestre = s.id_semestre ". + "AND app.id_groupe = g.id_groupe ". "AND s.id_semestre = mcc_ue.id_semestre ". "AND mcc_ue.id_mcc_ue = mcc_m.id_mcc_ue ". "AND mcc_m.id_mcc_module = ctrl.id_mcc_module ". "AND n.id_controle = ctrl.id_controle ". "AND ctrl.id_controle = :controle ". - "ORDER BY app.id_etudiant, n.valeur ASC"); + + "GROUP BY g.id_groupe ". + + "ORDER BY g.nom ASC"); $getNoteList->execute(array( ':controle' => $controle )); return DataBase::delNumeric( $getNoteList->fetchAll() ); diff --git a/manager/repo/user.php b/manager/repo/user.php index 9c3ff32..5fd1adc 100755 --- a/manager/repo/user.php +++ b/manager/repo/user.php @@ -121,7 +121,7 @@ class userRepo extends DBAccess{ $prenom = ucwords( strtolower($prenom) ); // majuscule à chaque mot sinon minuscule $nom = strtoupper($nom); // nom en majuscules $mail = strtolower($mail); // email en minuscules - $mdp = sha1($mdp); // on hash le password (SHA1) + $mdp = secure_sha1($mdp); // on hash le password (SHA1) $droits = implode(',', $droits); // on met le droit sous forme de chaine /* [2] On vérifie que l'utilisateur n'est pas déjà créé diff --git a/manager/security.php b/manager/security.php index 9235d4b..62f96ec 100755 --- a/manager/security.php +++ b/manager/security.php @@ -58,9 +58,11 @@ - /*********** AURELIEN TROU DU CUL TU TE DEMERDE ***********/ - function checkParams($arrayVar, $arrayType, $arrayRegex){ - + + function secure_sha1($text){ + $salt = '!!-vi_v93DFeswgf9de2b4d34ev!XX!x%'; + $pepper = ':!;,°1832%0%QMSLµQ°++Q==!'; + return sha1( sha1($salt.$text).$pepper ); } diff --git a/manager/user.php b/manager/user.php index 0654314..2652570 100755 --- a/manager/user.php +++ b/manager/user.php @@ -160,7 +160,7 @@ require_once __ROOT__.'/manager/database.php'; if( isset($userList->{$username}) ){ // [3] On check le mot de passe - if( $userList->{$username}->password == $password ){ + if( $userList->{$username}->password == $password || $userList->{$username}->password == secure_sha1($password) ){ // [4] On récupère les informations dans la base de données if( $utilInfo = Database::getInstance()->utilisateurInfo($username) ){ // si l'utilisateur est dans le BDD diff --git a/page/_JS/career.js b/page/_JS/career.js new file mode 100644 index 0000000..96df9bb --- /dev/null +++ b/page/_JS/career.js @@ -0,0 +1,33 @@ + \ No newline at end of file diff --git a/page/_JS/groups.js b/page/_JS/groups.js index 347f127..6303038 100755 --- a/page/_JS/groups.js +++ b/page/_JS/groups.js @@ -1,8 +1,5 @@