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()); } }
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; }
} 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"); 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)"); }
$listSpectacle = MSpectacle::getSpectacles(); require_once ROOT . 'views/kiosqueadmin/CollegeLycee/v_SeancePDF.php'; } catch (\Exception $e) { Main::setFlashMessage($e->getMessage(), "error"); } break; case 'JaugePDFCL': try { if (isset($_GET['spectacle'])) { $spectacle = MSpectacle::getSpectacleById($_GET['spectacle']); $listJaugeSpectacle = MPlanning::getJaugeRestanteJeunePublicBySpec($spectacle); $_SESSION['idSpectacle'] = $_GET['spectacle']; $_SESSION['seance'] = $listJaugeSpectacle; } if (isset($_POST['valider'])) { $spectacle = MSpectacle::getSpectacleById($_SESSION['idSpectacle']); $listJaugeSpectacle = MPlanning::getJaugeRestanteJeunePublicBySpec($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;