From 9f1d953fbb8a08199efc05b815265f238c02634e Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 2 Jan 2016 20:59:31 +0100 Subject: [PATCH] =?UTF-8?q?delNumeric=20pour=20tous=20les=20fetch()=20de?= =?UTF-8?q?=201-deep=20+=20d=C3=A9but=20de=20passage=20de=20semestres?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/career.php | 36 ++++++++++++++++++++++++++++++ manager/database.php | 4 +++- manager/excel.php | 2 +- manager/repo/module.php | 2 +- manager/repo/note.php | 8 +++---- manager/repo/semestre.php | 8 +++---- manager/repo/ue.php | 2 +- src/files/admin2_export_jury.xlsx | Bin 6640 -> 9499 bytes test.php | 19 +++++++++++----- 9 files changed, 64 insertions(+), 17 deletions(-) diff --git a/manager/career.php b/manager/career.php index eb62ef7..de0e21e 100755 --- a/manager/career.php +++ b/manager/career.php @@ -345,6 +345,42 @@ class careerManager{ + + + /****************************************/ + /* Passage de semestre pour un étudiant */ + /****************************************/ + /* + * Cherche si un semestre de même formation + * et de rang supérieur existe pour cette même année A + * ou l'année suivante A+1 avec rang+1 + * + */ + case 'passageSemestre': if( permission('admin') ){ + + $areSetParam = isset($request->etudiant) && isset($request->semestre); // les arguments existent + $etudiantCheck = $areSetParam && checkParam($request->etudiant, 'utilisateur.identifiant'); // l'identifiant de l'étudiant est au bon format + $semestreCheck = $$etudiantCheck && checkParam($request->semestre, 'auto_increment_id'); // l'id du semestre est au bon format + + + if( $semestreCheck ){ // si tout les paramètres sont bons + $passageStatus = DataBase::getInstance()->passageSemestre($request->etudiant, $request->semestre); + if( $creationOk ) + $answer->request = 'success'; + else + $answer->request = 'error'; + + }else + $answer->request = 'param_error'; + + }else + $answer->request = 'permission_error'; + break; + + + + + /***********/ /* DEFAULT */ /***********/ diff --git a/manager/database.php b/manager/database.php index 4968a83..404bfd2 100755 --- a/manager/database.php +++ b/manager/database.php @@ -310,7 +310,9 @@ class DataBase{ /* retourne le semestre en cours d'un étudiant * - * @etudiant l'identifiant (UID) de l'étudiant à ajouter au groupe + * @etudiant L'identifiant (UID) de l'étudiant en question + * @semestre_pair VRAI si le rang semestre est pair, sinon FAUX + * @annee L'année scolaire en cours * * @return semestreUID l'UID du semestre courant * diff --git a/manager/excel.php b/manager/excel.php index 117fa2b..9f36979 100755 --- a/manager/excel.php +++ b/manager/excel.php @@ -458,7 +458,7 @@ class excelManager{ $sheet->setCellValue('A'.$index, $student->identifiant); $sheet->setCellValue('B'.$index, $group->formation); $sheet->setCellValue('C'.$index, $group->nom); - $sheet->setCellValue('D'.$index, 'À compléter'); + $sheet->setCellValue('D'.$index, '[À compléter]'); $index++; } } diff --git a/manager/repo/module.php b/manager/repo/module.php index 50a4564..61857ac 100755 --- a/manager/repo/module.php +++ b/manager/repo/module.php @@ -41,7 +41,7 @@ class moduleRepo{ $getModuleInfo->execute(array( ':moduleUID' => $moduleUID )); // on retourne le résultat en supprimant les doublons à indices numériques - return $getModuleInfo->fetch(); + return DataBase::delNumeric( $getModuleInfo->fetch(), true ); } diff --git a/manager/repo/note.php b/manager/repo/note.php index 1eecf8e..fc9720d 100755 --- a/manager/repo/note.php +++ b/manager/repo/note.php @@ -51,7 +51,7 @@ class noteRepo{ )); // on retourne le résultat en supprimant les doublons à indices numériques - return $getUtilisateurInfo->fetch(); + return DataBase::delNumeric( $getUtilisateurInfo->fetch(), true ); } @@ -191,7 +191,7 @@ class noteRepo{ ORDER BY g.nom ASC"); $getNoteList->execute(array( ':controle' => $controle, ':groupe' => $groupe )); - return $getNoteList->fetch(); + return DataBase::delNumeric( $getNoteList->fetch(), true ); } @@ -215,7 +215,7 @@ class noteRepo{ $getMoyenne->execute(array( ':controle' => $controle )); if( $fetchObj = $getMoyenne->fetch() ) - return $fetchObj['moyenne']; + return DataBase::delNumeric( $fetchObj['moyenne'], true ); else return null; } @@ -247,7 +247,7 @@ class noteRepo{ GROUP BY mcc_m.id_mcc_module"); $getMoyenneModule->execute(array( ':etudiant' => $etudiant, ':module' => $module, ':semestre' => $semestre )); - return $getMoyenneModule->fetch(); + return DataBase::delNumeric( $getMoyenneModule->fetch(), true ); } diff --git a/manager/repo/semestre.php b/manager/repo/semestre.php index 801e895..8d4b6e0 100755 --- a/manager/repo/semestre.php +++ b/manager/repo/semestre.php @@ -117,7 +117,7 @@ class semestreRepo{ AND nom = :nom"); $getFormationUID->execute(array( ':code' => $code, ':nom' => $nom )); - return $formationUID = $getFormationUID->fetch()['id']; + return $getFormationUID->fetch()['id']; } @@ -189,7 +189,7 @@ class semestreRepo{ $getSemestreInfo->execute(array( ':semestreUID' => $semestreUID )); // on retourne le résultat en supprimant les doublons à indices numériques - return $getSemestreInfo->fetch(); + return DataBase::delNumeric( $getSemestreInfo->fetch(), true ); } @@ -245,7 +245,7 @@ class semestreRepo{ )); // on retourne les infos du semestre courant - return $getSemestreInfos->fetch(); + return DataBase::delNumeric( $getSemestreInfos->fetch(), true ); } @@ -441,7 +441,7 @@ class semestreRepo{ FROM semestre as s, mcc_ue GROUP BY s.annee"); - return $getLastMccYear->fetch(); + return DataBase::delNumeric( $getLastMccYear->fetch(), true ); } } \ No newline at end of file diff --git a/manager/repo/ue.php b/manager/repo/ue.php index fd3b2dd..7fc8a1d 100755 --- a/manager/repo/ue.php +++ b/manager/repo/ue.php @@ -41,7 +41,7 @@ class ueRepo extends DBAccess{ $getUEInfo->execute(array( ':UEUID' => $UEUID )); // on retourne le résultat en supprimant les doublons à indices numériques - return $getUEInfo->fetch(); + return DataBase::delNumeric( $getUEInfo->fetch(), true ); } diff --git a/src/files/admin2_export_jury.xlsx b/src/files/admin2_export_jury.xlsx index aa912f5e9fbb7d06ba8fdfca2806acc9236d9258..2cd880a01a88b3a2674ba735d6996f177dc3dba4 100644 GIT binary patch delta 5038 zcmbW53pmq#|HnrpE0xofLJeVVhe}kAx6E;f&^?FTiZ*2ysWFG&zuh_H5SwFCW|&nD zIYipM+~tmNi!6#|64IJEHOGbj*7H2oUDyBlKiB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`b3S(yU7vKvDML7j>BvLD>;3a8-^!Nmc>zUlUV~yL>O1jDlXHIP$G7!1 zVs{NTu;XV7$uwA8Oe-@Gmj1yGK@#kwKjO41k|c@evPX0xl{vyD#_+}Wq@kc*L%)_; zx$*p=9m@w}6PH_iLzauDiPyK^vdGUBF#$jW+>XW&taosWEvluy(1Ib})|D4oV>Ezo z?-@3cB)2m`)DI_}x4bu}r56;_KiBeAHprjv@m1Ezp>E-H^I2ub$!1(TEvGsYkAS+k zmymOEPs!`4xSmZL8yV)L`ApZ6rmb0AyR6ADXIRE?*B(|tVz}}-da6P42)EjQylJYX z$!_w>5}O;Dg~JR!4nTx@xJ^=_v+Ocu#WAC$TVOW7`-C$6nuyQasO&J0vUfd$VV*wA zdQt}r^kGATNA$xBeWq>nLwz4M`z#k{hhKR8?!_GoOtM|!wFAbh550K;4-(x=GFGgy zRMq$vZ0TOv6{L)+Y%5USc@*Akb*JUF!6&3t1hz-wj@3FAtx*2$Hpyj1E$KS8RN~Is z5)$;?{urmA!$&?jMExQ_4KQbpAIrIt+Ixsv2lKrS!Gpz`mmD=3_L6Iyv(p%TE4BaAz}NtS!cGhZ@A`kX9lQNXB@s?2~U(W3`RS!oo-YVUWfNfQ2ozn z%w6jVu6d$7yVI+5*M!C5`G>EbC-EO}NVA>`_Q#zTpV4@|F}&7SRryLol>SElrbM}^ zZmnI-EhB#)xtYpM7+@($y4VM7l_o<{)XpT#mToNcu$L{SskDj zUv<3cB=#mrLt~0e$Oid z5k)4dz5SQzR3^i*JH11%z32R3`8+kxU!wHBoZZrj6s2rr3Bc6o_j*1Eqa8}B3&P~Q zsrKkiirMWYTovGpbGnenCg%d%a^YIsHSkxkQf?tzH+ey^M44|%49a**9-*wZL=b)O zmogetUEsEtudiant('mrd1609a', 16, 2015); -// var_dump( $uelist ); +/* [1] On récupère le semestre d'un étudiant */ +$semestre = DataBase::studentSemestre('Etud100', false, 2015); +var_dump($semestre); +/* [2] On cherche le semestre suivant */ +$req = DataBase::getPDO()->prepare("SELECT s.* + FROM semestre as s + WHERE s.id_formation = :id_formation + AND s.rang > :last_rang + AND + "); +$req->execute(array( + ':id_formation' => $semestre['id_formation'], + ':last_rang' => $semestre['rang'] +));