Example #1
0
 public static function getChoixBySub(Inscription $inscription)
 {
     try {
         $conn = Main::bdd();
         $reqPrepare = $conn->prepare("SELECT * FROM choix WHERE idInscription = ? ORDER BY PrioriteChoix");
         $reqPrepare->execute(array($inscription->getId()));
         $tabs = $reqPrepare->fetchAll();
         $coll = new Collection();
         foreach ($tabs as $tab) {
             $spectacle = MSpectacle::getSpectacleById($tab['idSpectacle']);
             $choix = new Choix($inscription, $spectacle, $tab['prioriteChoix']);
             $coll->ajouter($choix);
         }
         return $coll;
     } catch (\PDOException $e) {
         throw new \Exception($e->getMessage());
     } catch (KeyHasUseException $ex) {
         throw new \Exception($ex->getMessage());
     }
 }
Example #2
0
 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;
 }
Example #3
0
     $impo = '1 : ' . $_SESSION['impo1'] . '<br> 2 : ' . $_SESSION['impo2'] . '<br> 3 : ' . $_SESSION['impo3'];
 }
 $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
Example #4
0
        try {
            $spectacle = MSpectacle::getSpectacleById($_GET['shows']);
            MSpectacle::rmSpectacle($spectacle);
            Main::setFlashMessage("Le spectacle {$spectacle->getId}() a bien été supprimé", "valid");
            echo '<script>document.location.href ="?uc=spectacle"</script>';
        } catch (\Exception $e) {
            Main::setFlashMessage($e->getMessage(), "error");
        }
        break;
    case 'voirModifierSpectacle':
        $listSpec = MSpectacle::getSpectacleById($_GET['shows']);
        $listSaison = MSaison::getSaisons();
        $actuel = MSaison::getSaisonCourante();
        require_once ROOT . 'views/kiosqueadmin/shows/v_SpectacleEdit.php';
        break;
    case 'ModifierSpectacle':
        try {
            if (!is_numeric($_POST['nomSpectacle']) && is_numeric($_POST['nbPlaceSpectacle']) && !is_numeric($_POST['typeClasse']) && (!empty($_POST['typeClasse']) && !empty($_POST['nomSpectacle']) && !empty($_POST['nbPlaceSpectacle']) && !empty($_POST['idSaison']) && !empty($_POST['typeClasse']))) {
                $saison = MSaison::getSaisonById($_POST['idSaison']);
                $spectacle = new Spectacle($_GET['shows'], $_POST['nomSpectacle'], $_POST['nbPlaceSpectacle'], $_POST['typeClasse'], $saison, $_POST['typeSpectacle']);
                MSpectacle::editSpectacle($saison, $spectacle);
                Main::setFlashMessage("Le spectacle a bien été modifié à la saison " . $saison->getNom(), "valid");
                echo '<script>document.location.href ="?uc=spectacle"</script>';
            } else {
                throw new \Exception("Impossible de modifier le spectacle (mauvais formats entrés)");
            }
        } catch (\Exception $e) {
            Main::setFlashMessage($e->getMessage(), "error");
        }
        break;
}
Example #5
0
            Main::setFlashMessage($e->getMessage(), "error");
        }
        break;
    case 'Ecole':
        if ($_GET['type'] == 1) {
            $ListEcoleChoix = MEcole::getEcolesJeunePublic();
            $_SESSION['idType'] = $_GET['type'];
            $_SESSION['type'] = $ListEcoleChoix;
        }
        if ($_GET['type'] == 2) {
            $ListEcoleChoix = MEcole::getEcolesCollegeLycee();
            $_SESSION['idType'] = $_GET['type'];
            $_SESSION['type'] = $ListEcoleChoix;
        }
        require_once ROOT . 'views/kiosqueadmin/schools/v_School.php';
        break;
    case 'Spectacle':
        if ($_GET['type'] == 1) {
            $listSpecEcole = MSpectacle::getSpectaclesSaisonCouranteJeunePublic();
            $_SESSION['idType'] = $_GET['type'];
            $_SESSION['type'] = $listSpecEcole;
        }
        if ($_GET['type'] == 2) {
            $listSpecEcole = MSpectacle::getSpectaclesSaisonCouranteCollegeLycee();
            $_SESSION['idType'] = $_GET['type'];
            $_SESSION['type'] = $listSpecEcole;
        }
        $actuel = MSaison::getSaisonCourante();
        require_once ROOT . 'views/kiosqueadmin/shows/v_Spectacle.php';
        break;
}
Example #6
0
 public static function getSaisonDuSpectacle(Spectacle $spectacle)
 {
     try {
         $conn = Main::bdd();
         $reqPrepare = $conn->prepare("SELECT * FROM spectacle as spec\n\t\t\t\tINNER JOIN saison_spectacle as ss ON ss.idSpectacle = spec.idSpectacle\n\t\t\t\tINNER JOIN saison as s ON s.idSaison = ss.idSaison\n\t\t\t\tWHERE spec.idSpectacle = ?\n\t\t\t\tORDER BY nomSpectacle");
         $reqPrepare->execute(array($spectacle->getId()));
         $tab = $reqPrepare->fetch();
         $saison = new Saison($tab['idSaison'], $tab['nomSaison'], $tab['courante']);
         $lesSpectacles = MSpectacle::getSpectaclesBySaison($saison);
         $saison->setLesSpectacles($lesSpectacles);
         return $saison;
     } catch (\PDOException $e) {
         throw new \Exception($e->getMessage());
     }
 }