1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| while ($donnee = $query->fetch()) {
//echo $donnee['lastname']."<br/>";
//$this->promo[$increment][] = $donnee['id'];
/*
* ON ENREGISTRE CHAQUE ETUDIANT DANS LEURS COHORTES
*/
switch ($annee) {
case 1:
$enrol_cohort = "INSERT INTO cohort_members (cohortid,userid,timeadded)
VALUES(" . $this->cohorte_1a . "," . $donnee['id'] . "," . $this->timestamp_now . ")";
$this->promo_1[] = $donnee['id'];
$this->bdd->exec($enrol_cohort);
break;
case 2:
$enrol_cohort = "INSERT INTO cohort_members (cohortid,userid,timeadded)
VALUES(" . $this->cohorte_2a . "," . $donnee['id'] . "," . $this->timestamp_now . ")";
$this->promo_2[] = $donnee['id'];
$this->bdd->exec($enrol_cohort);
break;
case 3:
$enrol_cohort = "INSERT INTO cohort_members (cohortid,userid,timeadded)
VALUES(" . $this->cohorte_3a . "," . $donnee['id'] . "," . $this->timestamp_now . ")";
$this->promo_3[] = $donnee['id'];
$this->bdd->exec($enrol_cohort);
break;
case 4:
$enrol_cohort = "INSERT INTO cohort_members (cohortid,userid,timeadded)
VALUES(" . $this->cohorte_4a . "," . $donnee['id'] . "," . $this->timestamp_now . ")";
$this->promo_4[] = $donnee['id'];
$this->bdd->exec($enrol_cohort);
break;
case 5:
$enrol_cohort = "INSERT INTO cohort_members (cohortid,userid,timeadded)
VALUES(" . $this->cohorte_5a . "," . $donnee['id'] . "," . $this->timestamp_now . ")";
$this->promo_5[] = $donnee['id'];
$this->bdd->exec($enrol_cohort);
break;
}
} |
Partager