Correction déplacement d'élèves sur admin@tous_les_groupes

This commit is contained in:
xdrm-brackets 2015-11-17 09:07:53 +01:00
parent df1f23a1da
commit d96ace86b3
2 changed files with 5 additions and 5 deletions

View File

@ -280,10 +280,10 @@ class DataBase{
public function deplacerEtudiant($etudiant, $groupe, $semestre){
// on vérifie que le semestre et que le groupe de destination existent
if( !($semestreUID=semestreRepo::info($semestre)['id']) ) return 'unknown_semestre';
if( !($destGroupeUID=groupRepo::UID($groupe)) ) return 'unknown_newgroup';
if( !($semestreInfo=semestreRepo::info($semestre)) ) return 'unknown_semestre';
if( !($destGroupeUID=groupRepo::UID($groupe)) ) return 'unknown_newgroup';
if( groupRepo::ajouterMembre($etudiant, $destGroupeUID, $semestreUID) )
if( groupRepo::ajouterMembre($etudiant, $destGroupeUID, $semestreInfo['id']) )
return 'success';
else
return 'error';

View File

@ -57,10 +57,10 @@ class semestreRepo extends DBAccess{
*/
public static function info($semestreUID){
// on considère que le semestre existe
$getSemestreInfo = DataBase::getPDO()->prepare("SELECT s.id_semestre as s.id, f.id_formation, f.code as formation, f.nom as nom_formation, s.nom, s.rang, s.annee ".
$getSemestreInfo = DataBase::getPDO()->prepare("SELECT s.id_semestre as id, s.nom, s.rang, s.annee, f.id_formation, f.code as formation, f.nom as nom_formation ".
"FROM semestre as s, formation as f ".
"WHERE s.id_formation = f.id_formation ".
"AND id_semestre = :semestreUID");
"AND s.id_semestre = :semestreUID");
$getSemestreInfo->execute(array( ':semestreUID' => $semestreUID ));
// on retourne le résultat en supprimant les doublons à indices numériques