diff --git a/css/global.css b/css/global.css index c3e5a51..cfc4578 100755 --- a/css/global.css +++ b/css/global.css @@ -24,6 +24,15 @@ span.stressed{ font-weight: bold; } thead.normal > tr > th{ font-weight: normal; } + +/* input dans import/export */ +div.p.center input{ + margin: .2em; + padding: .8em; + border-radius: 3px; + border: 1px solid #989898 +} + /*************************/ /*** TITLE PERSONALISÉ ***/ /*************************/ @@ -216,7 +225,8 @@ select{ } /* select grisé => selection modules existants par exemple */ -tr.grayscale select{ +tr.grayscale select, +select.grayscale{ border-color: #bdbdbd; background-image: url(../src/expand@grayscale.svg); color: #4e4e4e; diff --git a/page/_JS/modules.js b/page/_JS/modules.js index 578043a..b30139d 100755 --- a/page/_JS/modules.js +++ b/page/_JS/modules.js @@ -82,4 +82,15 @@ for( var i = 0 ; i < selectList.length ; i++ ){ } + + +/* LIEN VERS LA PAGE "CREER UN SEMESTRE" */ +var creerSemestre = document.getElementById('creer_semestre'); +creerSemestre.addEventListener('click', function(e){ + + pageM.vars[0] = 'createsemestre'; + reload(); + +}, false); + --> \ No newline at end of file diff --git a/page/modules.php b/page/modules.php index 313b50d..06d93bd 100755 --- a/page/modules.php +++ b/page/modules.php @@ -493,11 +493,11 @@ if( permission('admin') ){ // si l'utilisateur est un admin +function anneeScolaire($year){ return $year.' - '.($year+1); } if( permission('admin') ){ -function anneeScolaire($year){ return $year.' - '.($year+1); } // require_once __ROOT__.'/manager/phpExcel.php'; // require_once __ROOT__.'/manager/database.php'; @@ -554,7 +554,7 @@ function anneeScolaire($year){ return $year.' - '.($year+1); } /*************************/ /* AFFINAGE PAR SEMESTRE */ /*************************/ - foreach($answer->yearList as $annee){ if( $anneeOpt == $annee['annee'] ){ // on récupère la liste des ids + foreach($answer->yearList as $annee){ if( in_array($annee['annee'], $anneesListe) ){ // on récupère la liste des ids foreach($annee['semestres'] as $semestre){ if( !in_array($semestre['id'], $semestresListe) ){ array_push($semestresListe, $semestre['id']); }} @@ -563,35 +563,45 @@ function anneeScolaire($year){ return $year.' - '.($year+1); } // si semestreOpt n'est pas cohérent (pas pour cette année) if( !in_array($semestreOpt, $semestresListe) ) $semestreOpt = null; - echo "
"; - if( $semestreOpt == null ) echo "Tous"; - else echo "Tous"; + $count = 0; + echo "
"; /* On récupère la liste des SEMESTRES en accord avec l'ANNEE sélectionnée */ foreach($answer->yearList as $annee){ if( $anneeOpt == $annee['annee'] ){ foreach($annee['semestres'] as $semestre){ if( in_array($semestre['id'], $semestresListe) ){ + $count++; + + if( $semestreOpt == null ) $semestreOpt = $semestre['id']; if( $semestre['id'] == $semestreOpt ) // si c'est le semestre séléctionné echo "".$semestre['formation']." - ".$semestre['nom'].''; else // sinon on affiche normalement echo "".$semestre['formation']." - ".$semestre['nom'].''; + }} }} echo "


"; - // si on a selectionné un semestre - if( $semestreOpt != null ) - foreach($answer->yearList as $annee){ if( $anneeOpt == $annee['annee'] ){ foreach($annee['semestres'] as $semestre){ if( $semestreOpt == $semestre['id'] ){ - echo "".$semestre['nb_etudiants']." étudiants

"; - }}}} - else{ // si on a selectionné "Tous" - $nbTotal = 0; - foreach($answer->yearList as $annee){ if( $anneeOpt == $annee['annee'] ){ foreach($annee['semestres'] as $semestre){ - $nbTotal += $semestre['nb_etudiants']; - }}} - echo "".$nbTotal." étudiants

"; + if( $count == 0 ) // si on a trouvé aucun semestre + echo "Aucun semestre pour cette année

"; + else{ + + // si on a selectionné un semestre + if( $semestreOpt != null ) + foreach($answer->yearList as $annee){ if( $anneeOpt == $annee['annee'] ){ foreach($annee['semestres'] as $semestre){ if( $semestreOpt == $semestre['id'] ){ + echo "".$semestre['nb_etudiants']." étudiants

"; + }}}} + else{ // si on a selectionné "Tous" + $nbTotal = 0; + foreach($answer->yearList as $annee){ if( $anneeOpt == $annee['annee'] ){ foreach($annee['semestres'] as $semestre){ + $nbTotal += $semestre['nb_etudiants']; + }}} + echo "".$nbTotal." étudiants

"; + } + } + echo "
Générer le fichier
"; @@ -600,10 +610,6 @@ function anneeScolaire($year){ return $year.' - '.($year+1); } echo "
"; - }else - echo "

Erreur interne

"; - - @@ -625,15 +631,14 @@ function anneeScolaire($year){ return $year.' - '.($year+1); } // if( $answer->request == 'success' ){ // si pas d'erreur echo "
"; - - $anneesListe = array(); - - /**********************/ - /* AFFINAGE PAR ANNEE */ - /**********************/ echo "Importation des MCC d'un semestre
"; echo "(Fichier .xlsx suivant le modèle : modèle de fichier)
"; + + /**********************/ + /**********************/ + /* AFFINAGE PAR ANNEE */ + /* AFFINAGE POUR LES 5 ANNEES SUIVANTES */ echo ""; + for($i = 0 ; $i < 5 ; $i++) + echo ""; + echo "
"; + + echo "
"; + echo "
"; + echo "
"; + echo "
"; + + echo "
Créer le semestre
"; + + + + echo "
"; + + echo ""; + +} + + ?>