function createPage($pdf, $d, $sprache, $gastro_id, $date, $cellWidth, $cellHigh)
{
    $gast_id = $d->GAST_ID;
    $gast = getMieterVorname($gast_id) . " " . getNachnameOfMieter($gast_id);
    $pdf->Cell($cellWidth, $cellHigh, $gast, "LR");
    $tisch_id = $d->TISCH_ID;
    $raum_id = getRaumOfTisch($tisch_id);
    $position = getRaumBezeichnung($raum_id) . "/" . getUebersetzungGastro("Tisch", $sprache, $gastro_id) . " " . $tisch_id;
    $position = utf8_decode($position);
    $pdf->Cell($cellWidth, $cellHigh, $position, "LR");
    $zeitraum = getYearFromBooklineDate($date) . "-" . getMonthFromBooklineDate($date) . "-" . getDayFromBooklineDate($date) . " " . getHourFromBooklineDate($date) . ":" . " " . getMinuteFromBooklineDate($date) . " " . getUebersetzungGastro("bis", $sprache, $gastro_id) . " ";
    $pdf->Cell($cellWidth, $cellHigh, $zeitraum, "LR", 1);
    return $pdf;
}
</li>
	        </ul>
     
    </td>
  </tr>
</table>
<hr/>	
  <?php 
    //sodala, nun alle reservierungen mit status=1 auslesen, wenn
    $res = getReservationsOfVermieter($gastro_id, STATUS_RESERVIERT);
    while ($d = $res->FetchNextObject()) {
        $reservierungs_id = $d->RESERVIERUNG_ID;
        $mieter_id = $d->GAST_ID;
        $mieter = getMieterVorname($mieter_id) . " " . getNachnameOfMieter($mieter_id) . ", " . getMieterOrt($mieter_id);
        $date = getDatumVonOfReservierung($reservierungs_id);
        $zeitraum = getYearFromBooklineDate($date) . "-" . getMonthFromBooklineDate($date) . "-" . getDayFromBooklineDate($date) . " " . getHourFromBooklineDate($date) . ":" . getMinuteFromBooklineDate($date);
        $tisch_id = $d->TISCH_ID;
        $raum_id = getRaumOfTisch($tisch_id);
        $mietobjekt = getRaumBezeichnung($raum_id) . " " . $tisch_id;
        ?>
<table>
  <tr></tr><tr></tr>
        <tr>
          <td><span><?php 
        echo getUebersetzung("Reservierungsanfrage von");
        ?>
:</span> <?php 
        echo $mieter;
        ?>
</td>
        </tr>
            $size[] = $y;
            $size[] = $x;
        } else {
            $size = $dimension;
        }
        //create the pdf with constructor:
        $pdf = new FPDF($pageOrientation, $measureUnit, $size);
        if ($showName || $showTime) {
            //get the confirmed booking
            $res = getReservationsOfVermieter($gastro_id, STATUS_BELEGT);
            while ($d = $res->FetchNextObject()) {
                $reservierungs_id = $d->RESERVIERUNG_ID;
                $gast_id = $d->GAST_ID;
                $gast = getMieterVorname($gast_id) . " " . getNachnameOfMieter($gast_id);
                $date = getDatumVonOfReservierung($reservierungs_id);
                $year = getYearFromBooklineDate($date);
                $month = getMonthFromBooklineDate($date);
                $day = getDayFromBooklineDate($date);
                if ($choice_date == null) {
                    createPage($pdf, $root . $temp_url, getUebersetzungGastro("Zeit", $sprache, $gastro_id) . ": " . $year . "-" . $month . "-" . $day . " " . getHourFromBooklineDate($date) . ":" . getMinuteFromBooklineDate($date) . " " . getUebersetzungGastro("bis", $sprache, $gastro_id) . " ", getUebersetzungGastro("Name", $sprache, $gastro_id) . ": " . $gast, $headingText, $fontText, $fontTextStyle, $fontTextSize, $fontHeading, $fontHeadingStyle, $fontHeadingSize, $root, $x, $y);
                } else {
                    if ($choice_date == $day . "/" . $month . "/" . $year) {
                        createPage($pdf, $root . $temp_url, getUebersetzungGastro("Zeit", $sprache, $gastro_id) . ": " . $year . "-" . $month . "-" . $day . " " . getHourFromBooklineDate($date) . ":" . getMinuteFromBooklineDate($date) . " " . getUebersetzungGastro("bis", $sprache, $gastro_id) . " ", getUebersetzungGastro("Name", $sprache, $gastro_id) . ": " . $gast, $headingText, $fontText, $fontTextStyle, $fontTextSize, $fontHeading, $fontHeadingStyle, $fontHeadingSize, $root, $x, $y);
                    }
                }
            }
        }
        $pdf->Output();
    }
    //end if tableCardId exists
}
/**
@author coster
@date 17.7.2007
get the date in the form YYYY-MM-DD HH:MM from a bookline formated date
@return date
*/
function getFormatedDateFromBooklineDate($date)
{
    $zeitraum = getYearFromBooklineDate($date) . "-" . getMonthFromBooklineDate($date) . "-" . getDayFromBooklineDate($date) . " " . getHourFromBooklineDate($date) . ":" . getMinuteFromBooklineDate($date);
    return $zeitraum;
}
/**
 * datum 17. Apr. 06
 * @author coster
 * @param mietobject_id
 * @param $tag Kurzform aus datumFunctions.inc.php
 * prueft ob an einem tag eine buchungseinschr�nkung existiert
 */
function hasBuchungseinschraenkungOnDay($mietobjekt_id, $tag)
{
    global $root;
    include_once $root . "/include/datumFunctions.inc.php";
    $typ = BE_TYP_TAG;
    $res = getBuchungseinschraenkungZeitBis($mietobjekt_id, $typ);
    while ($d = $res->FetchNextObject()) {
        $timestamp = $d->VON;
        $day = getDayFromBooklineDate($timestamp);
        if ($tag == $day) {
            return true;
        }
    }
    return false;
}
function isBlock($raum_id, $tisch_id, $vonMinute, $vonStunde, $vonTag, $vonMonat, $vonJahr, $bisMinute, $bisStunde, $bisTag, $bisMonat, $bisJahr)
{
    global $gastro_id;
    global $root;
    include_once $root . "/include/buchungseinschraenkung.inc.php";
    include_once $root . "/include/mietobjektFunctions.inc.php";
    if (getStatusOfTisch($tisch_id) == "Tisch gesperrt") {
        return true;
    }
    //Keine Reservierungen möglich in der Uhrzeit
    $typ = BE_TYP_ZEIT;
    $res = getBuchungseinschraenkungen($gastro_id, $typ);
    while ($d = $res->FetchNextObject()) {
        $einschraenkungs_id = $d->RESERVIERUNGSEINSCHRAENKUNG_ID;
        if ($tisch_id == $d->TISCHNUMMER && $raum_id == getRaumOfTisch($d->TISCHNUMMER)) {
            $vonZeit = $vonStunde * 60 + $vonMinute;
            $bisZeit = $bisStunde * 60 + $bisMinute;
            $vonZeitSchr = getVonStundeOfBuchungseinschraenkung($einschraenkungs_id) * 60 + getVonMinuteOfBuchungseinschraenkung($einschraenkungs_id);
            $bisZeitSchr = getBisStundeOfBuchungseinschraenkung($einschraenkungs_id) * 60 + getBisMinuteOfBuchungseinschraenkung($einschraenkungs_id);
            if ($vonZeit >= $vonZeitSchr && $vonZeit < $bisZeitSchr) {
                return true;
            } else {
                if ($bisZeit >= $vonZeitSchr && $bisZeit < $bisZeitSchr) {
                    return true;
                } else {
                    if ($bisZeit >= $bisZeitSchr && $vonZeit <= $vonZeitSchr) {
                        return true;
                    }
                }
            }
        }
    }
    //Keine Reservierungen möglich an folgenden Tagen
    if (isDayEingeschraenkt($tisch_id, getDayName($vonTag, $vonMonat, $vonJahr))) {
        return true;
    }
    //Keine Reservierungen möglich zu folgendem Datum
    $typ = BE_TYP_DATUM_VON_BIS;
    $res = getBuchungseinschraenkungenOfTisch($tisch_id, $typ);
    while ($d = $res->FetchNextObject()) {
        $einschraenkungs_id = $d->RESERVIERUNGSEINSCHRAENKUNG_ID;
        $einschrVon = $d->VON;
        $einschrBis = $d->BIS;
        if ($vonJahr >= getYearFromBooklineDate($einschrVon) && $vonJahr <= getYearFromBooklineDate($einschrBis) && ($vonMonat >= getMonthFromBooklineDate($einschrVon) && $vonMonat <= getMonthFromBooklineDate($einschrBis)) && ($vonTag >= getDayFromBooklineDate($einschrVon) && $vonTag <= getDayFromBooklineDate($einschrBis))) {
            $vonZeit = $vonStunde * 60 + $vonMinute;
            $bisZeit = $bisStunde * 60 + $bisMinute;
            $vonZeitSchr = getHourFromBooklineDate($einschrVon) * 60 + getMinuteFromBooklineDate($einschrVon);
            $bisZeitSchr = getHourFromBooklineDate($einschrBis) * 60 + getMinuteFromBooklineDate($einschrBis);
            if ($vonZeit >= $vonZeitSchr && $vonZeit < $bisZeitSchr) {
                return true;
            } else {
                if ($bisZeit >= $vonZeitSchr && $bisZeit < $bisZeitSchr) {
                    return true;
                }
            }
        }
    }
    return false;
}