/** * Récupère les spectacles de la saison courante * @return Collection * @throws \Exception */ public static function getSpectaclesSaisonCouranteCollegeLycee() { try { $conn = Main::bdd(); $reqPrepare = $conn->query("SELECT sp.idSpectacle, nomSpectacle, nbPlaceSpectacle, typeClasse, typeSpectacle, s.idSaison, nomSaison, courante\n FROM spectacle sp\n INNER JOIN saison_spectacle ss ON ss.idSpectacle = sp.idSpectacle\n INNER JOIN saison s ON s.idSaison = ss.idSaison\n WHERE courante = 1\n AND typeSpectacle = 2"); $tabs = $reqPrepare->fetchAll(); $coll = new Collection(); $saison = MSaison::getSaisonCourante(); foreach ($tabs as $tab) { $spectacle = new Spectacle($tab['idSpectacle'], $tab['nomSpectacle'], $tab['nbPlaceSpectacle'], $tab['typeClasse'], $saison, $tab['typeSpectacle']); $lesSeances = MSeance::getSeancesBySpec($spectacle); $spectacle->setLesSeances($lesSeances); $coll->ajouter($spectacle); } return $coll; } catch (\PDOException $e) { throw new \Exception("Il n'y a aucun spectacle"); } catch (KeyHasUseException $ex) { throw new \Exception($ex->getMessage()); } }
require_once ROOT . 'views/kiosqueadmin/CollegeLycee/v_PlanningPDF.php'; } catch (\Exception $e) { Main::setFlashMessage($e->getMessage(), "error"); } break; case 'SeancePDFCL': try { if (isset($_GET['spectacle'])) { $spectacle = MSpectacle::getSpectacleById($_GET['spectacle']); $listSeanceSpectacle = MSeance::getSeancesBySpec($spectacle); $_SESSION['idSpectacle'] = $_GET['spectacle']; $_SESSION['seance'] = $listSeanceSpectacle; } if (isset($_POST['valider'])) { $spectacle = MSpectacle::getSpectacleById($_SESSION['idSpectacle']); $listSeanceSpectacle = MSeance::getSeancesBySpec($spectacle); // get the HTML ob_start(); ?> <style type="text/css"> table{ text-align: center; vertical-align: middle; line-height: 6px; font-family: helvetica; font-size: 12pt; width: 100%; border-collapse: collapse; margin:auto; }