<?php 
                $content = ob_get_clean();
                // convert in PDF
                require_once ROOT . 'vendor/spipu/html2pdf/html2pdf.class.php';
                try {
                    $pdf = new HTML2PDF('L', 'A4', 'fr');
                    $pdf->writeHTML($content);
                    ob_end_clean();
                    $pdf->Output('Planning.pdf');
                } catch (HTML2PDF_exception $e) {
                    echo $e;
                    exit;
                }
            }
            $listIns = MPlanning::getPlannings();
            $listEcole = MEcole::getEcoles();
            require_once ROOT . 'views/kiosqueadmin/v_Courrier.php';
        } catch (\Exception $e) {
            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'];
Exemple #2
0
 /**
  * Supprime un spectacle
  * @param Spectacle $spectacle
  * @throws \Exception
  */
 public static function rmSpectacle(Spectacle $spectacle)
 {
     $conn = Main::bdd();
     try {
         $conn->beginTransaction();
         MSaison::rmSaisonSpectacle($spectacle);
         foreach ($spectacle->getLesSeances()->getCollection() as $seance) {
             MPlanning::rmPlanningbySeance($seance);
         }
         MSeance::rmSeancesSpec($spectacle);
         $reqPrepare = $conn->prepare("DELETE FROM spectacle WHERE idSpectacle = ?");
         $reqPrepare->execute(array($spectacle->getId()));
         $conn->commit();
     } catch (\PDOException $e) {
         $conn->rollBack();
         throw new \Exception("Le spectacle " . $spectacle->getId() . " n'a pas pu être supprimé. Détails : <p>" . $e->getMessage() . "</p>");
     }
 }
 /**
  * Supprime une inscription
  * @param Inscription $inscription
  * @throws \Exception
  */
 public static function rmInscription(Inscription $inscription)
 {
     $conn = Main::bdd();
     try {
         $conn->beginTransaction();
         MPlanning::rmPlanningByInscription($inscription);
         $reqPrepare = $conn->prepare("DELETE FROM choix WHERE idInscription = ?");
         $reqPrepare->execute(array($inscription->getId()));
         $reqPrepare = $conn->prepare("DELETE FROM inscription WHERE idInscription = ?");
         $reqPrepare->execute(array($inscription->getId()));
         $conn->commit();
     } catch (\PDOException $e) {
         $conn->rollBack();
         throw new \Exception("L'inscription " . $inscription->getId() . " n'a pas pu être supprimée. Détails : <p>" . $e->getMessage() . "</p>");
     }
 }