$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
} catch (\Exception $e) { Main::setFlashMessage($e->getMessage(), "error"); } break; case 'voirAjouterSpectacle': $listSaison = MSaison::getSaisons(); $actuel = MSaison::getSaisonCourante(); require_once ROOT . 'views/kiosqueadmin/shows/v_SpectacleAdd.php'; break; case 'AjouterSpectacle': 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(1, $_POST['nomSpectacle'], $_POST['nbPlaceSpectacle'], $_POST['typeClasse'], $saison, $_POST['typeSpectacle']); MSpectacle::addSpectacle($spectacle); $spec = MSpectacle::getSpectacleByName($_POST['nomSpectacle']); MSaison::AjoutSaisonSpectacle($saison, $spec); Main::setFlashMessage("Le spectacle a bien été ajouté à la saison " . $saison->getNom(), "valid"); echo '<script>document.location.href ="?uc=spectacle"</script>'; } else { throw new \Exception("Impossible d'ajouter le spectacle (mauvais formats entrés)"); } } catch (\Exception $e) { Main::setFlashMessage($e->getMessage(), "error"); } break; case 'SupprimerSpectacle': try { $spectacle = MSpectacle::getSpectacleById($_GET['shows']); MSpectacle::rmSpectacle($spectacle); Main::setFlashMessage("Le spectacle {$spectacle->getId}() a bien été supprimé", "valid");