From bb0088e09f9f74bbd78e15cfdc4a034aa8f26df4 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 22 Nov 2015 11:16:03 +0100 Subject: [PATCH] =?UTF-8?q?Import=20MCC=20fonctionnel=20et=20op=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/database.php | 17 +++++------------ manager/repo/controle.php | 1 - 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/manager/database.php b/manager/database.php index 191f74c..3f8be06 100755 --- a/manager/database.php +++ b/manager/database.php @@ -125,23 +125,16 @@ class DataBase{ */ public static function setMCC($semestre, $mcc){ - foreach($mcc as $ue){ + $mcc_ue = ueRepo::forMCC($semestre, $ue->nom, $ue->libelle, $ue->coefficient); - $mcc_ue = ueRepo::forMCC($semestre, $ue['nom'], $ue['libelle'], $ue['coefficient']); - foreach($ue['modules'] as $module){ + foreach($ue->modules as $module){ + $mcc_module = moduleRepo::forMCC($mcc_ue, $module->nom, $module->libelle, $module->coefficient); - $mcc_module = moduleRepo::forMCC($mcc_ue, $module['nom'], $module['libelle'], $module['coefficient']); - // echo '  '.$module['nom'].'
'; - foreach($module['controles'] as $controle){ - - $controle_uid = controleRepo::forMCC($mcc_module, $controle['nom'], $controle['libelle'], $controle['coefficient']); - // var_dump( $controle_uid ); - // echo '    '.$controle['nom'].'
'; - - } + foreach($module->controles as $controle) + $controle_uid = controleRepo::forMCC($mcc_module, $controle->nom, $controle->libelle, $controle->coefficient); } diff --git a/manager/repo/controle.php b/manager/repo/controle.php index c63f549..99a5d9a 100755 --- a/manager/repo/controle.php +++ b/manager/repo/controle.php @@ -165,7 +165,6 @@ class controleRepo extends DBAccess{ /* [1] SI LE CONTRÔLE N'EXISTE PAS => ON LE CRÉÉ =====================================================*/ - echo "$mcc_module|$nom|$libelle|$coefficient
"; $creerControle = DataBase::getPDO()->prepare("INSERT INTO controle(id_controle, id_mcc_module, nom, libelle, base, coefficient, date_publication) VALUES(DEFAULT, :mcc_module, :nom, :libelle, 20, :coefficient, NOW())"); $creerControle->execute(array( ':mcc_module' => $mcc_module, ':nom' => $nom, ':libelle' => $libelle, ':coefficient' => $coefficient ));