Import MCC fonctionnel et opé

This commit is contained in:
xdrm-brackets 2015-11-22 11:16:03 +01:00
parent 12128eb5a5
commit bb0088e09f
2 changed files with 5 additions and 13 deletions

View File

@ -125,23 +125,16 @@ class DataBase{
*/ */
public static function setMCC($semestre, $mcc){ public static function setMCC($semestre, $mcc){
foreach($mcc as $ue){ 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 '&nbsp&nbsp'.$module['nom'].'<br>';
foreach($module['controles'] as $controle){ foreach($module->controles as $controle)
$controle_uid = controleRepo::forMCC($mcc_module, $controle->nom, $controle->libelle, $controle->coefficient);
$controle_uid = controleRepo::forMCC($mcc_module, $controle['nom'], $controle['libelle'], $controle['coefficient']);
// var_dump( $controle_uid );
// echo '&nbsp&nbsp&nbsp&nbsp'.$controle['nom'].'<br>';
}
} }

View File

@ -165,7 +165,6 @@ class controleRepo extends DBAccess{
/* [1] SI LE CONTRÔLE N'EXISTE PAS => ON LE CRÉÉ /* [1] SI LE CONTRÔLE N'EXISTE PAS => ON LE CRÉÉ
=====================================================*/ =====================================================*/
echo "$mcc_module|$nom|$libelle|$coefficient<br>";
$creerControle = DataBase::getPDO()->prepare("INSERT INTO controle(id_controle, id_mcc_module, nom, libelle, base, coefficient, date_publication) $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())"); VALUES(DEFAULT, :mcc_module, :nom, :libelle, 20, :coefficient, NOW())");
$creerControle->execute(array( ':mcc_module' => $mcc_module, ':nom' => $nom, ':libelle' => $libelle, ':coefficient' => $coefficient )); $creerControle->execute(array( ':mcc_module' => $mcc_module, ':nom' => $nom, ':libelle' => $libelle, ':coefficient' => $coefficient ));