Modifications mineures

This commit is contained in:
xdrm-brackets 2015-11-06 11:13:32 +01:00
parent 8281ffe52c
commit 9a75ef5f9f
8 changed files with 206 additions and 65 deletions

View File

@ -145,4 +145,46 @@ span.link{
cursor: pointer;
}
span.link:hover{ color: #000; }
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; }*/

View File

@ -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

View File

@ -76,4 +76,12 @@ if( document.querySelector('#CONTAINER section[name=movestudents]') != null ){ /
});
});
}
}
/***************************************************/
/*** 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 );

View File

@ -25,7 +25,7 @@ require_once __ROOT__.'/manager/groups.php';
*
*/
if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'student' ){ // si connecté && utilisateur
echo "<section name='allgroups' title='tous les groupes' class='basic'>";
echo "<section name='studentallgroups' title='tous les groupes' class='basic'>";
$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>";
echo "<option>Choix du semestre</option>";
foreach($answer->grouplist as $group){
if( $lastSemestre == null || $lastSemestre != $group->semestre ){
echo '<option>'.$group->semestre.'</option>';
$lastSemestre = $group->semestre;
}
}
echo "<select>";
/* select pour GROUPES */
$lastGroupe = null;
echo "<select>";
echo "<option>Choix du groupe</option>";
foreach($answer->grouplist as $group){
if( $lastGroupe == null || $lastGroupe != $group->nom ){
echo '<option>'.$group->nom.'</option>';
$lastGroupe = $group->nom;
}
}
echo "<select>";
echo "<table class='basic col5'><thead><tr>";
echo '<th>Identifiant</td>';
echo '<th>Prenom</td>';
@ -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 "<section name='mygroup' title='Mon groupe' class='basic'>";
echo "<section name='studentsgroup' title='Mon groupe' class='basic'>";
$request = new stdClass(); $answer = new stdClass();
@ -236,19 +263,19 @@ if( $_SESSION['identifiant'] != null && $_SESSION['droits'] == 'student' ){ // s
<!-- mon groupe -->
<!-- mes groupeS -->
<?php
/******************/
/*** MON GROUPE ***/
/******************/
/*******************/
/*** MES GROUPES ***/
/*******************/
/*
*
* PROFESSEUR -> 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 "<section name='mygroup' title='Mon groupe' class='basic'>";
echo "<section name='teachersgroups' title='Mes groupes' class='basic'>";
$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 "<table class='basic col1'><thead>";
echo '<tr>';
echo '<th colspan=5>';
echo 'Groupe '.$monGroupe;
echo '</th>';
echo '</tr>';
echo '</thead></table>';
echo "<select>";
echo "<option>Choix du semestre</option>";
foreach($answer->grouplist as $group){
if( $lastSemestre == null || $lastSemestre != $group->semestre ){
echo '<option>'.$group->semestre.'</option>';
$lastSemestre = $group->semestre;
}
}
echo "<select>";
echo "<table class='basic col5'><tbody>";
/* select pour GROUPES */
$lastGroupe = null;
echo "<select>";
echo "<option>Choix du groupe</option>";
foreach($answer->grouplist as $group){
if( $lastGroupe == null || $lastGroupe != $group->nom ){
echo '<option>'.$group->nom.'</option>';
$lastGroupe = $group->nom;
}
}
echo "<select>";
echo "<table class='basic col5'><thead><tr>";
echo '<th>Identifiant</td>';
echo '<th>Prenom</td>';
echo '<th>Nom</td>';
echo '<th>Semestre</td>';
echo '<th>Groupe</td>';
echo '</tr></thead></table>';
foreach($answer->grouplist as $group){ // pour chaque groupe
if( count($group->userlist) > 0 ){ // s'il y a des utilisateurs
echo "<table class='basic margin col5'>";
echo '<tbody>';
// pour chaque utilisateur
foreach($group->userlist as $user){
echo '<tr>';
echo "<td><span class=link>".$user['identifiant'].'</span></td>';
echo '<td>'.$user['prenom'].'</td>';
echo '<td>'.$user['nom'].'</td>';
echo '<td>'.$group->semestre.'</td>';
echo '<td>Groupe <span class=stressed>'.$group->nom.'</span></td>';
echo '</tr>';
}
// echo '<tr><td colspan=5 class=more></td></tr>';
echo '</tbody>';
echo '</table>';
// pour chaque utilisateur
foreach($answer->userlist as $user){
echo '<tr>';
echo "<td><span class=link>".$user['identifiant'].'</span></td>';
echo '<td>'.$user['prenom'].'</td>';
echo '<td>'.$user['nom'].'</td>';
echo '<td>'.$user['semestre'].'</td>';
echo '<td>Groupe <span class=stressed>'.$monGroupe.'</span></td>';
echo '</tr>';
}
// echo '<tr><td colspan=5 class=more></td></tr>';
echo '</tbody>';
echo '</table>';
}
////////////////////////////////////////////////////////////////////////////////
}else
echo "Erreur interne.";

View File

@ -33,11 +33,16 @@ require_once __ROOT__.'/manager/groups.php';
- Saisir des notes si vous en avez l'accès</p>
</section>
<?php /* [2] Notifications
=======================================================*/
if( $_SESSION['identifiant'] != null ){ // si on est connecté ?>
<section name='notifications' title='Notifications'>
<p>Notification 3</p>
<p>Notification 2</p>
<p>Notification 1</p>
</section>
<?php } ?>

View File

@ -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 '<br><br><br><br>';
// var_dump( $answer );
// echo '<br><br><br><br>';
foreach($answer->grouplist as $group){
echo "<br><br>================";
echo "<br>=== GROUPE ".$group->nom." ===<br>";
echo "================<br>";
foreach($group as $userlist)
foreach($userlist as $user){
foreach($user as $key=>$value)
echo $key.' = '.$value.' | ';
echo '<br>';
}
}
// foreach($answer->grouplist as $group){
// echo "<br><br>================";
// echo "<br>=== GROUPE ".$group->nom." ===<br>";
// echo "================<br>";
// foreach($group as $userlist)
// foreach($userlist as $user){
// foreach($user as $key=>$value)
// echo $key.' = '.$value.' | ';
// echo '<br>';
// }
// }
echo "<br><br><br><br><br><br><br>It works !";
// echo "<br><br><br><br><br><br><br>It works !";
phpinfo();

View File

@ -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;

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`
--