コード例 #1
0
ファイル: MChoix.php プロジェクト: AlfaBrisingr/Kiosque
 /**
  * Récupère tous les choix
  * @return Collection
  * @throws \Exception
  */
 public static function getChoixs()
 {
     try {
         $conn = Main::bdd();
         $reqPrepare = $conn->query("SELECT * FROM choix");
         $tabs = $reqPrepare->fetchAll();
         $coll = new Collection();
         foreach ($tabs as $tab) {
             $inscription = MInscription::getInscriptionByIdInscription($tab['idInscription']);
             $inscription->setLesChoix(MChoix::getChoixBySub($inscription));
             $spectacle = MSpectacle::getSpectacleById($tab['idSpectacle']);
             $choix = new Choix($inscription, $spectacle, $tab['prioriteChoix']);
             $coll->ajouter($choix);
         }
         return $coll;
     } catch (\PDOException $e) {
         throw new \Exception("Il n'y a aucun choix");
     } catch (KeyHasUseException $ex) {
         throw new \Exception($ex->getMessage());
     }
 }
コード例 #2
0
ファイル: MSeance.php プロジェクト: AlfaBrisingr/Kiosque
 public static function getSeanceByIns($idInscription)
 {
     $conn = Main::bdd();
     $lesSeances = new Collection();
     try {
         $reqPrepare = $conn->prepare("SELECT choix.idInscription, spectacle.idSpectacle, seance.idSeance, seance.idLieu, seance.date_heure, choix.prioriteChoix\n            FROM choix\n            INNER JOIN spectacle ON choix.idSpectacle = spectacle.idSpectacle\n            INNER JOIN seance ON seance.idSeance = spectacle.idSpectacle\n\n            WHERE choix.idInscription = ?\n            ORDER BY choix.prioriteChoix");
         $reqPrepare->execute(array($idInscription));
         $tabs = $reqPrepare->fetchAll();
         foreach ($tabs as $tab) {
             $spectacle = MSpectacle::getSpectacleById($tab['idSpectacle']);
             $inscription = MInscription::getInscriptionByIdInscription($idInscription);
             $lieu = MLieu::getLieuById($tab['idLieu']);
             $seance = new Seance($tab['idSeance'], $spectacle, new \DateTime($tab['date_heure']), $lieu);
             $choix = MChoix::getChoixBySub($inscription);
             $lesSeances->ajouter($seance);
         }
     } catch (\PDOException $e) {
         throw new \Exception($e->getMessage());
     }
     return $lesSeances;
 }
コード例 #3
0
 $date = new DateTime();
 $classe = implode(", ", $_SESSION['classe']);
 $UneInscription = new Inscription(1, $_SESSION['enseignant'], $date, $divers, $impo, $_SESSION['nbrEleve'], $_SESSION['nbrAccom'], $classe);
 $IdInscription = MInscription::addInscription($UneInscription);
 $_SESSION['Spectacle1'] = MSpectacle::getSpectacleByName($_SESSION['choix1']);
 $UneInscription->setId($IdInscription);
 $unChoix = new Choix($UneInscription, $_SESSION['Spectacle1'], 1);
 MChoix::addChoix($unChoix);
 if ($_SESSION['choix2'] != 'non') {
     $_SESSION['Spectacle2'] = MSpectacle::getSpectacleByName($_SESSION['choix2']);
     $unChoix2 = new Choix($UneInscription, $_SESSION['Spectacle2'], 2);
     MChoix::addChoix($unChoix2);
     if ($_SESSION['choix3'] != 'non') {
         $_SESSION['Spectacle3'] = MSpectacle::getSpectacleByName($_SESSION['choix3']);
         $unChoix3 = new Choix($UneInscription, $_SESSION['Spectacle3'], 3);
         MChoix::addChoix($unChoix3);
     }
 }
 $mail = $_SESSION['ecole']->getMailDirecteur();
 $passage_ligne = "\n";
 $boundary = "-----=" . md5(rand());
 // ==== Cr�ation header mail
 $header = "From: kiosque-noreply@kiosque-mayenne.org" . $passage_ligne;
 $header .= "Reply-to: \"" . $_SESSION['ecole']->getNom() . "\" " . $_SESSION['ecole']->getMailDirecteur() . $passage_ligne;
 $header .= "MIME-Version: 1.0" . $passage_ligne;
 $header .= 'Content-Type: text/html; charset=UTF-8' . $passage_ligne;
 $header .= "Content-Transfer-Encoding: 8bit" . $passage_ligne;
 // ====
 // ==== Cr�ation diff�rents messages
 $classes = implode(", ", $_SESSION['classe']);
 $message_html = "<html><head><meta charset='UTF-8'></head><body>Bonjour,<br><br>\n        Nous avons bien reçu l'inscription de votre classe pour la\n        saison spectacles du Kiosque.<br>\n        Nous vous remercions pour votre contribution\n        et espérons vivement pouvoir vous donner entière satisfaction.<br>\n        Valérie Martin reste à votre disposition pour tout complèment d'information.\n        N'hésitez pas à la contacter, par mail de préférence à v.martin@kiosque-mayenne.org\n        ou par téléphone au 02 43 30 10 16.<br>Voici le récapitulatif de votre demande : <br>\n        <br><strong>Etablissment</strong> :<br>Nom : " . $_SESSION['ecole']->getNom() . "<br>Adresse 1 : " . $_SESSION['ecole']->getAdresse() . "<br>\n        Code postal : " . $_SESSION['ecole']->getCp() . "<br>Ville : " . $_SESSION['ecole']->getVille() . "<br>T�l�phone : " . $_SESSION['ecole']->getDirecteur()->getTel() . "<br>\n        Mail : " . $_SESSION['ecole']->getMailDirecteur() . "<br><br><strong>Chef d'Etablissement</strong> : <br>\n        Civilité : " . $_SESSION['enseignant']->getCivilite() . "<br>Nom : " . $_SESSION['enseignant']->getNom() . "<br>Prénom : " . $_SESSION['enseignant']->getPrenom() . "<br>Facture libellée à : " . $_SESSION['facture'] . "<br>\n        <br><br><strong>Enseignant</strong> : <br>\n        Civilité : " . $_SESSION['enseignant']->getCivilite() . "<br>Nom : " . $_SESSION['enseignant']->getNom() . "<br>Prénom : " . $_SESSION['enseignant']->getPrenom() . "<br>Téléphone : " . $_SESSION['enseignant']->getTel() . "<br>\n        Mail : " . $_SESSION['enseignant']->getMail() . "<br>Classe : " . $classes . "<br>Divers : " . $_SESSION['divers'] . "<br>Elèves : " . $_SESSION['nbrEleve'] . "<br>Accompagnateurs : " . $_SESSION['nbrAccom'] . "<br>\n        <br><strong>Choix : </strong><br>\n        Premier choix : " . $_SESSION['choix1'] . "<br>Deuxième choix : " . $_SESSION['choix2'] . "<br>Troisième choix : " . $_SESSION['choix3'] . "<br>\n        <br>A très bientôt.<br>\n        L'équipe du Kiosque.</body></html>";
コード例 #4
0
         MChoix::rmChoix($inscription);
         $inscription->setClasse($_POST['classe']);
         $inscription->setNbAdultes($_POST['nbrAdultes']);
         $inscription->setNbEnfants($_POST['nbrEnfants']);
         $spectacle1 = MSpectacle::getSpectacleById($_POST['idSpectacleC1']);
         $choix1 = new Choix($inscription, $spectacle1, 1);
         MChoix::addChoix($choix1);
         if ($_POST['idSpectacleC2'] != "non") {
             $spectacle2 = MSpectacle::getSpectacleById($_POST['idSpectacleC2']);
             $choix2 = new Choix($inscription, $spectacle2, 2);
             MChoix::addChoix($choix2);
         }
         if ($_POST['idSpectacleC3'] != "non") {
             $spectacle3 = MSpectacle::getSpectacleById($_POST['idSpectacleC3']);
             $choix3 = new Choix($inscription, $spectacle3, 3);
             MChoix::addChoix($choix3);
         }
         MInscription::editInscription($inscription);
         Main::setFlashMessage("La modification de l'inscription a réussi", "valid");
         echo '<script>document.location.href ="?uc=admin&action=voirInscriptionCL")</script>';
     } else {
         $listIns = MInscription::getInscriptionByIdInscription($_GET['ins']);
         $listSpec = MSpectacle::getSpectacles();
         $listSpec2 = MSpectacle::getSpectacles();
         $listSpec3 = MSpectacle::getSpectacles();
         require_once ROOT . 'views/kiosqueadmin/CollegeLycee/v_InscriptionEdit.php';
     }
 } catch (\Exception $e) {
     Main::setFlashMessage($e->getMessage(), "error");
 }
 break;
コード例 #5
0
ファイル: MInscription.php プロジェクト: AlfaBrisingr/Kiosque
 /**
  * Récupère l'inscription dont le numéro est passé en paramètre
  * @param int $id idInscription
  * @return Inscription
  * @throws \Exception
  */
 public static function getInscriptionByIdInscription($id)
 {
     try {
         $conn = Main::bdd();
         $reqPrepare = $conn->prepare("SELECT * FROM inscription WHERE idInscription = ?");
         $reqPrepare->execute(array($id));
         $tab = $reqPrepare->fetch();
         $enseignant = MEnseignant::getEnseignantById($tab['idEns']);
         $inscription = new Inscription($tab['idInscription'], $enseignant, new \DateTime($tab['dateInscription']), $tab['diversInscription'], $tab['impoInscription'], $tab['nbEnfantsInscription'], $tab['nbAdultesInscription'], $tab['classe']);
         $lesChoix = MChoix::getChoixBySub($inscription);
         $inscription->setLesChoix($lesChoix);
         return $inscription;
     } catch (\PDOException $e) {
         throw new \Exception("L'inscription {$id} n'existe pas.");
     }
 }