Rectification de l'affichage des modules/notes

This commit is contained in:
xdrm-brackets 2015-11-03 21:59:16 +01:00
parent beba5bb708
commit 802c4061e7
6 changed files with 129 additions and 231 deletions

View File

@ -124,5 +124,6 @@ table.basic:nth-child(4n+3) tr:hover td{ background-color: rgba(45, 204, 112, 1)
} }
/*********************/
/*** LIENS BOUTONS ***/
/*********************/

View File

@ -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 <thead> */
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;
}

View File

@ -291,16 +291,30 @@ class DataBase{
else else
return 'unknown_semestre'; 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é // on cherche le groupe associé
$getNomGroupe = $this->pdo->prepare("SELECT g.nom ". $getNomGroupe = $this->pdo->prepare("SELECT g.nom ".
"FROM utilisateur as u, groupe as g, appartenance as app ". "FROM utilisateur as u, groupe as g, appartenance as app ".
"WHERE u.identifiant = app.id_etudiant ". "WHERE app.identifiant = u.id_etudiant ".
"AND g.id_groupe = app.id_groupe ". "AND app.id_groupe = g.id_groupe ".
"AND app.id_semestre = :semestreUID ".
"AND u.identifiant = :etudiant ". "AND u.identifiant = :etudiantUID ".
"ORDER BY g.nom"); "ORDER BY g.nom");
$getNomGroupe->execute(array( $getNomGroupe->execute(array(
':etudiant' => $etudiant ':etudiantUID' => $etudiantUID,
':semestreUID' => $semestreUID
)); ));
// si on a un résultat // si on a un résultat
@ -315,6 +329,20 @@ class DataBase{
/*** retourne les modules d'un étudiant ***/ /*** retourne les modules d'un étudiant ***/
/******************************************/ /******************************************/
public function getModulesEtudiant($etudiant, $semestre, $annee){ 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 ***/ /*** on cherche un utilisateur avec cet identifiant ***/
$getEtudiantUID = $this->pdo->prepare("SELECT identifiant as id FROM utilisateur WHERE identifiant = :etudiant"); $getEtudiantUID = $this->pdo->prepare("SELECT identifiant as id FROM utilisateur WHERE identifiant = :etudiant");
$getEtudiantUID->execute(array( $getEtudiantUID->execute(array(
@ -332,15 +360,12 @@ class DataBase{
"FROM utilisateur as u, groupe as g, appartenance as app, semestre as s ". "FROM utilisateur as u, groupe as g, appartenance as app, semestre as s ".
"WHERE app.id_etudiant = u.identifiant ". "WHERE app.id_etudiant = u.identifiant ".
"AND app.id_groupe = g.id_groupe ". "AND app.id_groupe = g.id_groupe ".
"AND app.id_semestre = s.id_semestre ". "AND app.id_semestre = :semestreUID ".
"AND u.identifiant = :etudiant ". "AND u.identifiant = :etudiantUID");
"AND s.rang = :semestre ".
"AND s.annee = :annee");
$getGroupeUID->execute(array( $getGroupeUID->execute(array(
':etudiant' => $etudiant, ':etudiantUID' => $etudiantUID,
':semestre' => $semestre, ':semestreUID' => $semestreUID
':annee' => $annee
)); ));
// si on trouve, on le définit, sinon on retourne "unknown_user" // 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 // 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 ". $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 ". "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 = prog.id_semestre ". "WHERE app.id_semestre = s.id_semestre ".
"AND app.id_semestre = s.id_semestre ".
"AND app.id_groupe = g.id_groupe ". "AND app.id_groupe = g.id_groupe ".
"AND prog.id_ue = ue.id_ue ". "AND app.id_semestre = mcc_ue.id_semestre ".
"AND prog.id_module = m.id_module ".
"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 g.id_groupe = :groupeUID ".
"AND s.rang = :semestre ". "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 // 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 ". $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 ". "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 = prog.id_semestre ". "WHERE app.id_semestre = s.id_semestre ".
"AND app.id_semestre = s.id_semestre ".
"AND app.id_groupe = g.id_groupe ". "AND app.id_groupe = g.id_groupe ".
"AND prog.id_ue = ue.id_ue ". "AND app.id_semestre = mcc_ue.id_semestre ".
"AND prog.id_module = m.id_module ".
"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 g.id_groupe = :groupeUID ".
"AND app.id_semestre = :semestreUID ". "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 ***/ /*** 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 ". $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 prog.id_module = m.id_module ". "WHERE app.id_etudiant = :etudiantUID ".
"AND prog.id_semestre = app.id_semestre ".
"AND m.nom = :module ". "AND mcc_ue.id_ue = ue.id_ue ".
"AND app.id_etudiant = :etudiantUID ". "AND mcc_ue.id_semestre = app.id_semestre ".
"AND app.id_semestre = :semestreUID"); "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( $getModuleUID->execute(array(
':module' => $module, ':module' => $module,
':etudiantUID' => $etudiantUID, ':etudiantUID' => $etudiantUID,
@ -630,15 +666,21 @@ class DataBase{
else else
return 'unknown_module'; return 'unknown_module';
// si on a l'UID utilisateur & l'UID groupe => on récupère les modules // 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 ". $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 ". "WHERE note.id_appartenance = app.id_appartenance ".
"AND note.id_programme = prog.id_programme ". "AND note.id_mcc_module = mcc_m.id_mcc_module ".
"AND prog.id_module = m.id_module ".
"AND prog.id_semestre = s.id_semestre ".
"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 app.id_etudiant = :etudiantUID ".
"AND s.id_semestre = :semestreUID ". "AND s.id_semestre = :semestreUID ".
"ORDER BY note.valeur, note.base ASC"); "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 ***/ /*** 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 ". $getUEUID = $this->pdo->prepare("SELECT ue.id_ue as id ".
"FROM module as m, appartenance as app, programme as prog, ue ". "FROM module as m, appartenance as app, ue, mcc_ue, mcc_module as mcc_m ".
"WHERE prog.id_module = m.id_module ". "WHERE mcc_ue.id_ue = ue.id_ue ".
"AND prog.id_semestre = app.id_semestre ". "AND mcc_ue.id_semestre = app.id_semestre ".
"AND prog.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 ue.nom = :UE ". "AND ue.nom = :UE ".
"AND app.id_etudiant = :etudiantUID ". "AND app.id_etudiant = :etudiantUID ".
@ -720,16 +764,21 @@ class DataBase{
else else
return 'unknown_UE'; return 'unknown_UE';
// si on a l'UID utilisateur & l'UID UE => on récupère les notes // 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 ". $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 ". "WHERE note.id_appartenance = app.id_appartenance ".
"AND note.id_programme = prog.id_programme ". "AND note.id_mcc_module = mcc_m.id_mcc_module ".
"AND prog.id_module = m.id_module ".
"AND prog.id_semestre = s.id_semestre ".
"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 app.id_etudiant = :etudiantUID ".
"AND s.id_semestre = :semestreUID ". "AND s.id_semestre = :semestreUID ".
"ORDER BY m.nom, note.valeur, note.base ASC"); "ORDER BY m.nom, note.valeur, note.base ASC");

View File

@ -73,9 +73,9 @@ if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'student' ){ // s
<!-- mes UEs --> <!-- mes UEs -->
<?php <?php
/**************************************/ /**********************************/
/*** MES UEs (version étudiant) ***/ /*** MES UEs (version étudiant) ***/
/**************************************/ /**********************************/
if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'student' ){ // si l'utilisateur est connecté et que c'est un élève 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(); $request = new stdClass(); $answer = new stdClass();
@ -104,7 +104,7 @@ if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'student' ){ // s
echo '<tbody>'; echo '<tbody>';
foreach($UE['notes'] as $note){ foreach($UE['notes'] as $note){
echo '<tr>'; echo '<tr>';
echo '<td>'.$note['module'].'</td>'; echo "<td><span class=link>".$note['module']."</span></td>";
echo '<td>'.$note['intitule'].'</td>'; echo '<td>'.$note['intitule'].'</td>';
echo '<td>'.$note['valeur'].'/'.$note['base'].'</td>'; echo '<td>'.$note['valeur'].'/'.$note['base'].'</td>';
echo '</tr>'; echo '</tr>';

View File

@ -145,46 +145,49 @@ ORDER BY ue.nom, s.nom, m.nom, m.libelle ASC;
/*** AFFICHER LES ANNES AVEC LES MODULES ET LES UE ***/ /*** AFFICHER LES ANNES AVEC LES MODULES ET LES UE ***/
/*****************************************************/ /*****************************************************/
SELECT DISTINCT semestre.annee as annee, ue.nom as UE, module.nom as module SELECT DISTINCT semestre.annee as annee, ue.nom as UE, module.nom as module
FROM module, ue, semestre, programme as p FROM module, ue, semestre, mcc_ue, mcc_module as mcc_m
WHERE p.id_module = module.id_module WHERE mcc_m.id_module = module.id_module
AND p.id_semestre = semestre.id_semestre AND mcc_ue.id_semestre = semestre.id_semestre
AND p.id_ue = ue.id_ue 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; ORDER BY semestre.annee DESC, ue.nom ASC;
/************************************/ /************************************/
/*** AFFICHE LES UE PAR SEMESTRES ***/ /*** AFFICHE LES UE PAR SEMESTRES ***/
/************************************/s /************************************/s
SELECT DISTINCT s.nom as semestre, ue.nom as UE SELECT DISTINCT s.annee as annee, s.nom as semestre, ue.nom as UE
FROM semestre as s, ue, programme as prog FROM semestre as s, ue, mcc_ue
WHERE prog.id_semestre = s.id_semestre WHERE mcc_ue.id_semestre = s.id_semestre
AND prog.id_ue = ue.id_ue AND mcc_ue.id_ue = ue.id_ue
AND s.annee = '2015' -- AND s.annee = '2015'
ORDER BY s.nom, ue.nom ASC ORDER BY s.annee, s.nom, ue.nom ASC;
/****************************************/ /****************************************/
/*** AFFICHE LES MODULES PAR SEMESTRE ***/ /*** AFFICHE LES MODULES PAR SEMESTRE ***/
/****************************************/ /****************************************/
SELECT DISTINCT s.annee as annee, ue.nom as UE, m.nom as module 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 FROM module as m, semestre as s, ue, mcc_ue, mcc_module as mcc_m
WHERE prog.id_semestre = s.id_semestre WHERE mcc_ue.id_semestre = s.id_semestre
AND prog.id_ue = ue.id_ue AND mcc_ue.id_ue = ue.id_ue
AND prog.id_module = m.id_module 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 ***/ /*** AFFICHE LE NOMBRE DE MODULES PAR SEMESTRE ***/
/*************************************************/ /*************************************************/
SELECT DISTINCT s.annee as annee, ue.nom as UE, count(m.nom) as nb_modules 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 FROM module as m, semestre as s, ue, mcc_ue, mcc_module as mcc_m
WHERE prog.id_semestre = s.id_semestre WHERE mcc_ue.id_semestre = s.id_semestre
AND prog.id_ue = ue.id_ue AND mcc_ue.id_ue = ue.id_ue
AND prog.id_module = m.id_module 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 GROUP BY s.annee, ue.nom
ORDER BY s.annee, ue.nom, m.nom ASC ORDER BY s.annee, ue.nom, m.nom ASC;
/******************************************/ /******************************************/

View File

@ -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` -- Structure de la table `semestre`
-- --