Source for file class.PDFADMIN.php
Documentation is available at class.PDFADMIN.php
* Verwaltet die Erstellung eines wöchentlichen PDF-Dokumentes
* @author Kay Koch, <kay.koch@gmx.de>
die('This file was generated for PHP 5');
* Interface zur Erstellung von pdf-Dokumenten
* @author Kay Koch, <kay.koch@gmx.de>
require_once ('src/interfaces/interface.PDFINTERFACE.php');
* @author Olivier PLATHEY
require_once ('src/pdf/class.FPDF.php');
/* user defined includes */
// section -64--88-122--2-1a4ded3:102c56edcaa:-7ff4-includes begin
// section -64--88-122--2-1a4ded3:102c56edcaa:-7ff4-includes end
/* user defined constants */
// section -64--88-122--2-1a4ded3:102c56edcaa:-7ff4-constants begin
// section -64--88-122--2-1a4ded3:102c56edcaa:-7ff4-constants end
* Verwaltet die Erstellung eines wöchentlichen PDF-Dokumentes
* @author Kay Koch, <kay.koch@gmx.de>
* Array mit Breiten der einzelnen Felder eines Eintrags
private $widthArray =
array (
* Kopfzeile des Dokumentes
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2-339007d5:1043cd4e8c9:-7fd5 begin
$this->Cell(0, 10, $this->pageTitle, 0, 0, 'R');
// section -64--88-122--2-339007d5:1043cd4e8c9:-7fd5 end
* Fußzeile des Dokumentes
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2-339007d5:1043cd4e8c9:-7fd3 begin
$this->Cell(22, $this->lineHeight, "Name, Vorname", 1, 0);
$this->Cell(24, $this->lineHeight, "Vereinsnummer", 1, 0);
$this->Cell(61, $this->lineHeight, "Gesamtanzahl / Gesamtpreis (" .
$this->prizePerPerson .
chr(128) .
" pro Person)", 1, 0);
// section -64--88-122--2-339007d5:1043cd4e8c9:-7fd3 end
* nimmt Daten für einen Tag auf und bearbeitet sie weiter
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2-339007d5:1043cd4e8c9:-7fd1 begin
$this->rowMaxFrei =
$this->tableMaxFrei[$this->oSee->see_id][$aktWeekDay];
if ($this->oSee->buchbarProTag OR isset
($this->arrBuchungen[$arrHour['see_id']][$datum]['00:00']))
$arrHour['00:00'] =
$arrHour['sumTag'];
unset
($arrHour['see_id']);
unset
($arrHour['datum']);
unset
($arrHour['sumTag']);
foreach ($arrHour as $key =>
$hour)
$this->createHour($hour, $key);
// section -64--88-122--2-339007d5:1043cd4e8c9:-7fd1 end
* Beginnt eine neues Dokument
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2-339007d5:1043cd4e8c9:-7fcc begin
// Seitenüberschrift erstellen
$this->pageTitle =
utf8_decode($oSee->name .
" --> " .
$oSee->oVorOrtKontakt->vorname .
" " .
$oSee->oVorOrtKontakt->name .
" | Tel: " .
$oSee->oVorOrtKontakt->telefon .
" | Email: " .
$oSee->oVorOrtKontakt->email);
$this->open(); // Dokument beginnen
// section -64--88-122--2-339007d5:1043cd4e8c9:-7fcc end
* Beginnt eine neue Seite
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2-339007d5:1043cd4e8c9:-7fc5 begin
$this->AddPage("L"); // Seite beginnen (Landscape)
// Schriftart für Tabellen
$this->SetFont('Arial', 'B', $this->fontHeight);
// section -64--88-122--2-339007d5:1043cd4e8c9:-7fc5 end
* setzt Breite pro Eintrag fest
* @author Kay Koch, <kay.koch@gmx.de>
public function __construct($arrBuchungen, $prizePerPerson) {
// section -64--88-122--2-1a4ded3:102c56edcaa:-7fed begin
$this->prizePerPerson =
$prizePerPerson;
$this->arrBuchungen =
$arrBuchungen;
$this->entryWitdh =
array_sum($this->widthArray) +
1; // max. Größe eines Eintrags errechnen, + 1px Abstand
$this->lineHeight =
$this->fontHeight /
2; // Zeilenhöhe (in mm)
$this->tableMaxFrei =
$oMaxFrei->getRow();
// section -64--88-122--2-1a4ded3:102c56edcaa:-7fed end
* Bearbeitet eine Stunde eines Eintrags
* Fügt an die leeren Einträge die Buchungen an
* überprüft einen möglichen Seitenumbruch
* @author Kay Koch, <kay.koch@gmx.de>
private function createHour($places, $keyHour) {
// section -64--88-122--2-66879486:104007981a3:-7fb0 begin
if (isset
($this->arrBuchungen[$this->oSee->see_id][$this->datum][$keyHour]))
$arrBuchungen =
$this->arrBuchungen[$this->oSee->see_id][$this->datum][$keyHour];
$arrBuchungen =
array ();
$nrOfEntries =
count($arrBuchungen) +
$places;
$nrOfLines =
$nrOfEntries /
5 +
1; // Zeilenanzahl des Arrays + 1 für Stundentitel
$h =
$nrOfLines *
$this->lineHeight; // benötigter Platz für diese Stunde
if ($keyHour ==
"00:00") // Ganztägige Anmeldung (z.B.: 09:00h - 20:00h)
$keyHour =
$this->oSee->getStartTime($this->datum) .
"h - " .
$this->oSee->getEndTime($this->datum) .
"h (" .
$places .
" von " .
$this->rowMaxFrei['sumTag'] .
" Plätzen frei)";
$keyHour =
$keyHour .
"h (" .
$places .
" von " .
$this->rowMaxFrei[$keyHour] .
" Plätzen frei)";
$this->Cell(0, 2, " ", 0, 1);
$this->YPos =
$this->GetY(); // Y-Position der aktuellen Zeile
$arrEntry =
array_pad($arrBuchungen, $nrOfEntries, array (
// section -64--88-122--2-66879486:104007981a3:-7fb0 end
* Schreibt einen Eintrag in das PDF
* @author Kay Koch, <kay.koch@gmx.de>
private function createPlaces($arrEntries, $counter) {
// section -64--88-122--2-66879486:104007981a3:-7fa8 begin
if (($counter %
5) ==
0) {
$this->Ln($this->lineHeight); // nach 5 Einträge erfolgt Zeilenumbruch
$this->YPos =
$this->GetY(); // Y-Position der neuen Zeile
if (!empty ($arrEntries['anzahl'])) {
$arrEntries['anzahl'] =
utf8_decode($arrEntries['anzahl'] .
"/" .
($arrEntries['anzahlZahler'] *
$this->prizePerPerson) .
chr(128));
} // Bei Eintrag, Preis ausrechnen
$this->SetXY($this->XPos, $this->YPos);
$this->Cell($this->widthArray[0], $this->lineHeight, $arrEntries['name'], 1, 0);
$this->Cell($this->widthArray[1], $this->lineHeight, $arrEntries['verein'], 1, 0);
$this->Cell($this->widthArray[2], $this->lineHeight, $arrEntries['anzahl'], 1, 0);
$this->XPos =
$this->GetX() +
1;
// section -64--88-122--2-66879486:104007981a3:-7fa8 end
} /* end of class src_pdf_PDFADMIN */
Documentation generated on Sat, 24 Mar 2007 09:59:49 +0100 by phpDocumentor 1.3.1