コード例 #1
0
                <?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;
                }
            }
            $listSeance = MSeance::getSeances();
            $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'])) {