diff --git a/css/global.css b/css/global.css index 7e49900..0141612 100755 --- a/css/global.css +++ b/css/global.css @@ -124,5 +124,6 @@ table.basic:nth-child(4n+3) tr:hover td{ background-color: rgba(45, 204, 112, 1) } - - +/*********************/ +/*** LIENS BOUTONS ***/ +/*********************/ \ No newline at end of file diff --git a/css/global2.css b/css/global2.css deleted file mode 100755 index 6b6aba3..0000000 --- a/css/global2.css +++ /dev/null @@ -1,163 +0,0 @@ -.no-select{ - user-select: none; - -moz-user-select: none; - -webkit-user-select: none; - -ms-user-select: none; - -o-user-select: none; -} - -.hidden{ display: none !important; } - - - - - - - - - - - - - - - - -/**********************/ -/*** TABLEAU .BASIC ***/ -/**********************/ - -/* STYLE "BASIC" DES TABLEAUX */ -table.basic{ - /* position */ - /*width: calc( 100% - 2*1em );*/ - margin: 2em 1em; - - /* border */ - border-radius: 5px; - border-spacing: 0; - box-shadow: 0 0 4px #e3e3e3; -} - -/* affichage du corps si tête activée */ -table.basic thead + tbody td{ display: none; } -table.basic thead + tbody td.more{ display: block; } -table.basic thead.active + tbody td{ display: table-cell; } - - - - -table.basic tr td, -table.basic tr th, -#DRAGNDROP td, -#DRAGNDROP th{ - /* position */ - padding: 1em 1.5em; - - /* border */ - border-width: 1px 1px 0 0; - border-style: solid; - border-color: #e0e1e3; - - /* backgroud */ - background-color: #fff; - - /* foreground */ - color: #4e4e4e; - - /* animation */ - transition: all .2s ease-in-out; - -moz-transition: all .2s ease-in-out; - -webkit-transition: all .2s ease-in-out; - -ms-transition: all .2s ease-in-out; - -o-transition: all .2s ease-in-out; - - /* extra */ - cursor: default; -} - -/* la ligne "Voir plus" */ -table.basic tr td.more{ - /* background */ - background: #f7f8fc url(../src/more.svg) right 1em center no-repeat; - background-size: auto 1.5em; - - /* foreground */ - color: #b7b7b7; - text-align: right; - padding-right: 3em; - - /* extra */ - cursor: pointer; -} - -table.basic tr td.more:before{ content: 'Voir plus'; } -table.basic thead.active + tbody tr td.more:before{ content: 'Voir moins'; } - -/* on cache "voir plus" quand le tableau est déroulé */ -table.basic thead.active + td.more{ display: none; } - - -/* différence avec */ -table.basic tr th{ background-color: #f7f8fc; font-size: 1.05em; } -table.basic tr th:first-letter{ text-transform: uppercase; } - - -/* on ajoute les rebords pour ceux à gauche */ -table.basic tr td:first-child, -table.basic tr th:first-child{ border-left-width: 1px; } -/* on ajoute les rebords pour ceux en bas */ -table.basic tr:last-child td { border-bottom-width: 1px; } - - -/* angle haut gauche */ -table.basic tr:first-child th:first-child{ border-radius: 5px 0 0 0; } -/* angle haut droit */ -table.basic tr:first-child th:last-child { border-radius: 0 5px 0 0; } -/* angle bas gauche */ -table.basic tr:last-child td:first-child { border-radius: 0 0 0 5px; } -/* angle bas droit */ -table.basic tr:last-child td:last-child { border-radius: 0 0 5px 0; } - -/* @hover */ -table.basic tr:hover td:not(.more){ - background-color: #2dcc70; - color: #fff; -} - - -table.basic:nth-child(4n+0) thead th{ color: #e63c54; } -table.basic:nth-child(4n+0) tr:hover td:not(.more) { background-color: #e63c54; } -table.basic:nth-child(4n+1) thead th{ color: #3c73e6; } -table.basic:nth-child(4n+1) tr:hover td:not(.more) { background-color: #3c73e6; } -table.basic:nth-child(4n+2) thead th{ color: #e6983c; } -table.basic:nth-child(4n+2) tr:hover td:not(.more) { background-color: #e6983c; } -table.basic:nth-child(4n+3) thead th{ color: #2dcc70; } -table.basic:nth-child(4n+3) tr:hover td:not(.more) { background-color: #2dcc70; } - - - - -/******************/ -/*** PARAGRAPHS ***/ -/******************/ -#CONTAINER section > p{ - /* position */ - padding: 1em; - margin: 1em; - - /* border */ - border-radius: 3px; - border: 1px solid #ddd; - - /* background */ - background-color: #fff; -} - -#CONTAINER section > p:hover{ - box-shadow: 1px 1px 3px #ddd; -} - - - - diff --git a/manager/database.php b/manager/database.php index 134c016..672b63f 100755 --- a/manager/database.php +++ b/manager/database.php @@ -291,16 +291,30 @@ class DataBase{ 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 associé $getNomGroupe = $this->pdo->prepare("SELECT g.nom ". "FROM utilisateur as u, groupe as g, appartenance as app ". - "WHERE u.identifiant = app.id_etudiant ". - "AND g.id_groupe = app.id_groupe ". + "WHERE app.identifiant = u.id_etudiant ". + "AND app.id_groupe = g.id_groupe ". + "AND app.id_semestre = :semestreUID ". - "AND u.identifiant = :etudiant ". + "AND u.identifiant = :etudiantUID ". "ORDER BY g.nom"); $getNomGroupe->execute(array( - ':etudiant' => $etudiant + ':etudiantUID' => $etudiantUID, + ':semestreUID' => $semestreUID )); // si on a un résultat @@ -315,6 +329,20 @@ class DataBase{ /*** retourne les modules d'un étudiant ***/ /******************************************/ public function getModulesEtudiant($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( @@ -332,15 +360,12 @@ class DataBase{ "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 app.id_semestre = :semestreUID ". - "AND u.identifiant = :etudiant ". - "AND s.rang = :semestre ". - "AND s.annee = :annee"); + "AND u.identifiant = :etudiantUID"); $getGroupeUID->execute(array( - ':etudiant' => $etudiant, - ':semestre' => $semestre, - ':annee' => $annee + ':etudiantUID' => $etudiantUID, + ':semestreUID' => $semestreUID )); // si on trouve, on le définit, sinon on retourne "unknown_user" @@ -351,12 +376,14 @@ class DataBase{ // si on a l'UID utilisateur & l'UID groupe => on récupère les modules $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 ". + "FROM module as m, groupe as g, semestre as s, ue, appartenance as app, mcc_ue, mcc_module as mcc_m ". + "WHERE 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 app.id_semestre = mcc_ue.id_semestre ". + + "AND mcc_ue.id_ue = ue.id_ue ". + "AND mcc_ue.id_mcc_ue = mcc_m.id_mcc_ue ". + "AND mcc_m.id_module = m.id_module ". "AND g.id_groupe = :groupeUID ". "AND s.rang = :semestre ". @@ -434,12 +461,15 @@ class DataBase{ // 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 ". + "FROM module as m, groupe as g, semestre as s, ue, appartenance as app, mcc_ue, mcc_module as mcc_m ". + "WHERE 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 app.id_semestre = mcc_ue.id_semestre ". + + "AND mcc_ue.id_ue = ue.id_ue ". + "AND mcc_ue.id_mcc_ue = mcc_m.id_mcc_ue ". + + "AND mcc_m.id_module = m.id_module ". "AND g.id_groupe = :groupeUID ". "AND app.id_semestre = :semestreUID ". @@ -612,12 +642,18 @@ class DataBase{ /*** 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 = $this->pdo->prepare("SELECT m.id_module as id FROM module as m, appartenance as app, ue, mcc_ue, mcc_module as mcc_m ". + "WHERE app.id_etudiant = :etudiantUID ". + + "AND mcc_ue.id_ue = ue.id_ue ". + "AND mcc_ue.id_semestre = app.id_semestre ". + "AND mcc_ue.id_semestre = :semestreUID ". + + "AND mcc_ue.id_mcc_ue = mcc_m.id_mcc_ue ". + + "AND mcc_m.id_module = m.id_module ". + + "AND m.nom = :module "); $getModuleUID->execute(array( ':module' => $module, ':etudiantUID' => $etudiantUID, @@ -630,15 +666,21 @@ class DataBase{ 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 ". + "FROM note, appartenance as app, semestre as s, module as m, mcc_ue, mcc_module as mcc_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 note.id_mcc_module = mcc_m.id_mcc_module ". - "AND prog.id_module = :moduleUID ". + "AND mcc_ue.id_semestre = app.id_semestre ". + "AND 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 m.id_module = :moduleUID ". "AND app.id_etudiant = :etudiantUID ". "AND s.id_semestre = :semestreUID ". "ORDER BY note.valeur, note.base ASC"); @@ -700,10 +742,12 @@ class DataBase{ /*** 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 ". + "FROM module as m, appartenance as app, ue, mcc_ue, mcc_module as mcc_m ". + "WHERE mcc_ue.id_ue = ue.id_ue ". + "AND mcc_ue.id_semestre = app.id_semestre ". + "AND mcc_ue.id_mcc_ue = mcc_m.id_mcc_ue ". + + "AND mcc_m.id_module = m.id_module ". "AND ue.nom = :UE ". "AND app.id_etudiant = :etudiantUID ". @@ -720,16 +764,21 @@ class DataBase{ else return 'unknown_UE'; - // si on a l'UID utilisateur & l'UID UE => on récupère les notes $getUEList = $this->pdo->prepare("SELECT m.nom as module, note.intitule, note.valeur, note.base ". - "FROM note, appartenance as app, programme as prog, semestre as s, module as m ". + "FROM note, appartenance as app, semestre as s, module as m, ue, mcc_ue, mcc_module as mcc_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 note.id_mcc_module = mcc_m.id_mcc_module ". - "AND prog.id_ue = :UEUID ". + "AND mcc_ue.id_ue = ue.id_ue ". + "AND mcc_ue.id_semestre = app.id_semestre ". + "AND 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 ue.id_ue = :UEUID ". "AND app.id_etudiant = :etudiantUID ". "AND s.id_semestre = :semestreUID ". "ORDER BY m.nom, note.valeur, note.base ASC"); diff --git a/page/career.php b/page/career.php index b188361..70c5e24 100755 --- a/page/career.php +++ b/page/career.php @@ -73,9 +73,9 @@ if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'student' ){ // s '; foreach($UE['notes'] as $note){ echo ''; - echo ''.$note['module'].''; + echo "".$note['module'].""; echo ''.$note['intitule'].''; echo ''.$note['valeur'].'/'.$note['base'].''; echo ''; diff --git a/xdoc/requêtes_sql_types.sql b/xdoc/requêtes_sql_types.sql index 4d46b58..4708c18 100755 --- a/xdoc/requêtes_sql_types.sql +++ b/xdoc/requêtes_sql_types.sql @@ -145,46 +145,49 @@ ORDER BY ue.nom, s.nom, m.nom, m.libelle ASC; /*** AFFICHER LES ANNES AVEC LES MODULES ET LES UE ***/ /*****************************************************/ SELECT DISTINCT semestre.annee as annee, ue.nom as UE, module.nom as module -FROM module, ue, semestre, programme as p -WHERE p.id_module = module.id_module -AND p.id_semestre = semestre.id_semestre -AND p.id_ue = ue.id_ue +FROM module, ue, semestre, mcc_ue, mcc_module as mcc_m +WHERE mcc_m.id_module = module.id_module +AND mcc_ue.id_semestre = semestre.id_semestre +AND mcc_ue.id_ue = ue.id_ue +AND mcc_ue.id_mcc_ue = mcc_m.id_mcc_ue ORDER BY semestre.annee DESC, ue.nom ASC; /************************************/ /*** AFFICHE LES UE PAR SEMESTRES ***/ /************************************/s -SELECT DISTINCT s.nom as semestre, ue.nom as UE -FROM semestre as s, ue, programme as prog -WHERE prog.id_semestre = s.id_semestre -AND prog.id_ue = ue.id_ue +SELECT DISTINCT s.annee as annee, s.nom as semestre, ue.nom as UE +FROM semestre as s, ue, mcc_ue +WHERE mcc_ue.id_semestre = s.id_semestre +AND mcc_ue.id_ue = ue.id_ue -AND s.annee = '2015' -ORDER BY s.nom, ue.nom ASC +-- AND s.annee = '2015' +ORDER BY s.annee, s.nom, ue.nom ASC; /****************************************/ /*** AFFICHE LES MODULES PAR SEMESTRE ***/ /****************************************/ SELECT DISTINCT s.annee as annee, ue.nom as UE, m.nom as module -FROM module as m, semestre as s, ue, programme as prog -WHERE prog.id_semestre = s.id_semestre -AND prog.id_ue = ue.id_ue -AND prog.id_module = m.id_module +FROM module as m, semestre as s, ue, mcc_ue, mcc_module as mcc_m +WHERE mcc_ue.id_semestre = s.id_semestre +AND mcc_ue.id_ue = ue.id_ue +AND mcc_m.id_module = m.id_module +AND mcc_m.id_mcc_ue = mcc_ue.id_mcc_ue -ORDER BY s.annee, ue.nom, m.nom ASC +ORDER BY s.annee, ue.nom, m.nom ASC; /*************************************************/ /*** AFFICHE LE NOMBRE DE MODULES PAR SEMESTRE ***/ /*************************************************/ SELECT DISTINCT s.annee as annee, ue.nom as UE, count(m.nom) as nb_modules -FROM module as m, semestre as s, ue, programme as prog -WHERE prog.id_semestre = s.id_semestre -AND prog.id_ue = ue.id_ue -AND prog.id_module = m.id_module +FROM module as m, semestre as s, ue, mcc_ue, mcc_module as mcc_m +WHERE mcc_ue.id_semestre = s.id_semestre +AND mcc_ue.id_ue = ue.id_ue +AND mcc_m.id_module = m.id_module +AND mcc_m.id_mcc_ue = mcc_ue.id_mcc_ue GROUP BY s.annee, ue.nom -ORDER BY s.annee, ue.nom, m.nom ASC +ORDER BY s.annee, ue.nom, m.nom ASC; /******************************************/ diff --git a/xdoc/structure.sql b/xdoc/structure.sql index 43dbe49..bb6bdc7 100755 --- a/xdoc/structure.sql +++ b/xdoc/structure.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` --