コード例 #1
0
 public function pdf_action()
 {
     $auswahlgeb = Request::option('gebaude');
     if (isset($auswahlgeb)) {
         $doc = new ExportPDF();
         $doc->addPage();
         if (isset($_GET["von"]) and $_GET["von"] != "00.00.0000") {
             $von = raumbelegung::dateToUnix($_GET["von"]);
         } else {
             $von = time();
         }
         if (isset($_GET["bis"]) and $_GET["bis"] != "00.00.0000") {
             $bis = raumbelegung::dateToUnix($_GET["bis"], "24");
         } else {
             $bis = $von;
         }
         if ($_GET["nextwe"] == "1") {
             $we = raumbelegung::getNextWeekEnd();
             $von = raumbelegung::dateToUnix($we["wevon"]);
             $bis = raumbelegung::dateToUnix($we["webis"]);
         }
         $termine = $this->getTermine($von, $bis, $auswahlgeb);
         $doc->SetFont('arial', '', 12, '', true);
         $doc->addContent("Raumbuchungen von " . $_GET["von"] . " bis " . $_GET["bis"] . " f&uumlr das Gebäude: " . raumbelegung::getGebaeude($auswahlgeb));
         $doc->SetFont('arial', '', 8, '', true);
         $i = 0;
         foreach ($termine as $termin) {
             if ($i == 0) {
                 $doc->SetFont('arial', '', 11, '', true);
                 $doc->addContent("Von - Bis - Raum - Vorlesungstitel - Dozent");
             }
             $content = $termin["von"] . " - " . $termin["bis"] . " - " . $termin["raum"] . " - " . $termin["titel"] . " - ";
             if (is_array($termin["Dozent"])) {
                 foreach ($termin["Dozent"] as $dozent) {
                     $content .= $dozent["title_front"] . " " . $dozent["vorname"] . " " . $dozent["nachname"];
                 }
             }
             $doc->SetFont('arial', '', 8, '', true);
             $doc->addContent($content);
             if ($i >= 35) {
                 $doc->AddPage();
                 $i = 0;
             } else {
                 $i++;
             }
         }
         $doc->dispatch(raumbelegung::getGebaeude($auswahlgeb) . "-" . $von . "-" . $bis);
     }
 }