/**
 * @author: coster
 * @date: 30.9.06
 * listet alle zimmer auf und erzeugt die tabellenzeilen 
 * */
function showAllRooms($month, $year, $unterkunft_id, $link, $saAktiviert, $sprache)
{
    $zimmerart = getUebersetzungUnterkunft(getZimmerart_EZ($unterkunft_id, $link), $sprache, $unterkunft_id, $link);
    $attResult = false;
    if (getPropertyValue(SHOW_ZIMMER_ATTRIBUTE_GESAMTUEBERSICHT, $unterkunft_id, $link) == "true") {
        $attResult = getAttributes();
    }
    ?>

	<table border="0" cellspacing="0" cellpadding="0" class="tableColor">
		<tr>
			<td></td>
			<?php 
    //ausgeben von leeren spalten wenn zusaetzlich attribute da sind:
    if ($attResult != false) {
        for ($i = 0; $i < mysqli_num_rows($attResult); $i++) {
            ?>
<td></td><?php 
        }
    }
    //ausgeben der tage in namen:
    $anzahlTageMo = getNumberOfDays($month, $year);
    for ($i = 1; $i <= $anzahlTageMo; $i++) {
        $tagName = getDayName($i, $month, $year);
        ?>
				<td align="center"><?php 
        echo getUebersetzung($tagName, $sprache, $link);
        ?>
</td>
			<?php 
    }
    ?>
		</tr>	
		<tr>
			<td><?php 
    echo $zimmerart;
    ?>
&nbsp;</td>
			<?php 
    //ausgeben der spaltenüberschriften wenn zusaetzlich attribute da sind:
    if ($attResult != false) {
        while ($d = mysqli_fetch_array($attResult)) {
            $bezeichnung = $d["Bezeichnung"];
            ?>
<td align="center"><?php 
            echo $bezeichnung;
            ?>
&nbsp;</td><?php 
        }
    }
    //ausgeben der tage in ziffern:
    $anzahlTageMo = getNumberOfDays($month, $year);
    for ($i = 1; $i <= $anzahlTageMo; $i++) {
        ?>
				<td align="center"><?php 
        echo $i;
        ?>
</td>
			<?php 
    }
    ?>
		</tr>
      <?php 
    $res = getZimmer($unterkunft_id, $link);
    while ($d = mysqli_fetch_array($res)) {
        $zimmer_id = $d["PK_ID"];
        $zimmer_value = $d["Zimmernr"];
        ?>
		  <tr> 
			<td align="center">
				<?php 
        echo getUebersetzungUnterkunft($zimmer_value, $sprache, $unterkunft_id, $link);
        ?>
			</td>
			<?php 
        //ausgeben der spaltenwerte wenn zusaetzlich attribute da sind:
        if ($attResult != false) {
            $attResult = getAttributes();
            while ($d = mysqli_fetch_array($attResult)) {
                $attribut_id = $d["PK_ID"];
                $wert = getAttributValue($attribut_id, $zimmer_id);
                ?>
<td align="center"><?php 
                echo $wert;
                ?>
</td><?php 
            }
        }
        for ($i = 1; $i <= $anzahlTageMo; $i++) {
            ?>
				<td width="20"
					<?php 
            $statusString = getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
 
					class="<?php 
            echo $statusString;
            ?>
">
					<?php 
            printResAdmin($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
				</td>
			<?php 
        }
        ?>
		  </tr>
	  <?php 
    }
    ?>
	</table>
	
<?php 
}
Ejemplo n.º 2
0
<!--ZOOMSTOP-->
<?
require_once($_SERVER["DOCUMENT_ROOT"]."/constants.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/../Common/miscellaneous/date_utils.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/../Common/miscellaneous/string_utils.php");


$params = array(":usuario" => getWindowsLoginName(true));
$sql =
	"SELECT 1
		 FROM use_usuarios
		WHERE se_usuario IN ('ALAPACO', 'FPEREZ')
			AND se_usuario = :usuario";
$isSegInfo = existeSql($sql, $params);

$today = stringToUpper(getDayName(date("N")))." ".date("j")." DE ".stringToUpper(getMonthName(date("n")))." DE ".date("Y");
?>
<div>
	<div id="divImagenCabecera"><img id="imgImagenCabecera" src="/images/header/header_logo_1.jpg" usemap="#inicio" /></div>
<?
if (isset($_REQUEST["vistaprevia"])) {
?>
	<div id="divVistaPrevia">
		<div><img src="/modules/portada/images/vista_previa.png" title="Vista Previa" /></div>
		<div><a href="javascript:limpiarVistaPrevia()"><img src="/modules/portada/images/limpiar_vista_previa.png" title="Limpiar Vista Previa" /></a></div>
	</div>
<?
}

if ($isSegInfo) {
?>
Ejemplo n.º 3
0
function date_intl($date_format, $stamp)
{
    $ret = str_replace('D', '$1', $date_format);
    $ret = str_replace('F', '$2', $ret);
    $ret = str_replace('l', '$4', $ret);
    $ret = str_replace('M', '$5', $ret);
    $ret = date('$3' . $ret . '$3', $stamp);
    // Workaround for a PHP 4.0.4 problem
    $ret = str_replace('$1', substr(getDayName(date('w', $stamp)), 0, 3), $ret);
    $ret = str_replace('$5', substr(getMonthName(date('m', $stamp)), 0, 3), $ret);
    $ret = str_replace('$2', getMonthName(date('m', $stamp)), $ret);
    $ret = str_replace('$4', getDayName(date('w', $stamp)), $ret);
    $ret = str_replace('$3', '', $ret);
    return $ret;
}
function getFullDayName($tag, $monat, $jahr)
{
    $day = getDayName($tag, $monat, $jahr);
    if ($day == "Mon") {
        $day = "Montag";
    } elseif ($day == "Tue") {
        $day = "Dienstag";
    } elseif ($day == "Wed") {
        $day = "Mittwoch";
    } elseif ($day == "Thu") {
        $day = "Donnerstag";
    } elseif ($day == "Fri") {
        $day = "Freitag";
    } elseif ($day == "Sat") {
        $day = "Samstag";
    } elseif ($day == "Sun") {
        $day = "Sonntag";
    }
    return $day;
}
function printResAdmin($zimmer_id, $i, $month, $year, $saAktiviert, $link)
{
    global $unterkunft_id;
    if (getDayName($i, $month, $year) == "SA" && $saAktiviert) {
        $isSamstag = true;
    } else {
        $isSamstag = false;
    }
    $status = getStatus($zimmer_id, $i, $month, $year, $link);
    if (sizeof($status) < 1 && hasChildRooms($zimmer_id) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true") {
        //if room is a parent, check if the child has another status:
        $childs = getChildRooms($zimmer_id);
        while ($c = mysqli_fetch_array($childs)) {
            $child_zi_id = $c['PK_ID'];
            $status = getStatus($child_zi_id, $i, $month, $year, $link);
            if (sizeof($status) > 0) {
                break;
            }
        }
    }
    /////////////////////////////////////////////////////////
    //urlauberwechsel genau an diesem tag:
    /////////////////////////////////////////////////////////
    if (isset($status) && sizeof($status) > 1) {
        ?>
			<table border="0" cellspacing="0" cellpadding="0" width="100%">
				<tr>
					<td class="<?php 
        echo parseStatus($status[0], $isSamstag);
        ?>
" 
						align="right" width="50%"><?php 
        echo $i;
        ?>
</td>
					<td class="<?php 
        echo parseStatus($status[1], $isSamstag);
        ?>
" 
						align="right" width="50%">&nbsp;</td>
				</tr>
			</table>
		<?php 
    } else {
        if (isset($status) && sizeof($status) == 1) {
            //schauen ob der letzte tag halb-frei ist:
            $nTag = $i + 1;
            $nMonat = $month;
            $nJahr = $year;
            $anzahlTage = getNumberOfDays($month, $year);
            if ($nTag > $anzahlTage) {
                $nTag = 1;
                $nMonat = $month + 1;
            }
            //ende if tag zu gross
            if ($nMonat > 12) {
                $nMonat = 1;
                $nJahr = $year + 1;
            }
            //ende if monat zu gross
            $nStatus = getStatus($zimmer_id, $nTag, $nMonat, $nJahr, $link);
            if (sizeof($nStatus) < 1 && hasChildRooms($zimmer_id) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true") {
                //if room is a parent, check if the child has another status:
                $childs = getChildRooms($zimmer_id);
                while ($c = mysqli_fetch_array($childs)) {
                    $child_zi_id = $c['PK_ID'];
                    $nStatus = getStatus($child_zi_id, $nTag, $nMonat, $nJahr, $link);
                    if (sizeof($nStatus) > 0) {
                        break;
                    }
                }
            }
            if (sizeof($nStatus) == 0) {
                //am nächsten tag ist es frei:
                ?>
					<table border="0" cellspacing="0" cellpadding="0" width="100%">
						<tr>
							<td class="<?php 
                echo parseStatus($status[0], $isSamstag);
                ?>
" align="right" width="50%">&nbsp;</td>
							<td class="<?php 
                echo parseStatus(0, $isSamstag);
                ?>
" align="right" width="50%"><?php 
                echo $i;
                ?>
</td>
						</tr>
					</table>
				<?php 
            } else {
                //schauen ob der tag vorher frei ist:
                $vTag = $i - 1;
                $vMonat = $month;
                $vJahr = $year;
                if ($vTag < 1) {
                    $vMonat = $month - 1;
                    if ($vMonat < 1) {
                        $vMonat = 12;
                        $vJahr = $year - 1;
                    }
                    //ende if monat zu klein
                    $vTag = getNumberOfDays($vMonat, $vJahr);
                }
                //ende if tag zu klein
                $vStatus = getStatus($zimmer_id, $vTag, $vMonat, $vJahr, $link);
                if (sizeof($vStatus) < 1 && hasChildRooms($zimmer_id) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true") {
                    //if room is a parent, check if the child has another status:
                    $childs = getChildRooms($zimmer_id);
                    while ($c = mysqli_fetch_array($childs)) {
                        $child_zi_id = $c['PK_ID'];
                        $vStatus = getStatus($child_zi_id, $vTag, $vMonat, $vJahr, $link);
                        if (sizeof($vStatus) > 0) {
                            break;
                        }
                    }
                }
                if (sizeof($vStatus) == 0) {
                    //am vorherigen tag ist es frei:
                    ?>
						<table border="0" cellspacing="0" cellpadding="0" width="100%">
							<tr>
								<td class="<?php 
                    echo parseStatus(0, $isSamstag);
                    ?>
" align="right" width="50%"><?php 
                    echo $i;
                    ?>
</td>
								<td class="<?php 
                    echo parseStatus($status[0], $isSamstag);
                    ?>
" align="right" width="50%">&nbsp;</td>
							</tr>
						</table>
					<?php 
                } else {
                    echo $i;
                }
            }
            //ende else schauen ob tag vorher frei
        } else {
            //tag ausgeben:
            echo $i;
        }
    }
    //ende else tag ausgeben
}
Ejemplo n.º 6
0
         $s_css_left_array[] = $row['css_left'];
         $s_css_width_array[] = $row['width'];
         $s_days_array[] = getDayName($fh, $connection, $row['on_day']);
     }
 } else {
     fwrite($fh, date("m/d/Y h:i:s a", time()) . "...ERROR Line#57 (get_data.php): Can't get classes: " . $sql . " == " . $connection->error . PHP_EOL);
 }
 // get teachers
 $sql = "SELECT teacher_name, bg_color, fore_color, on_day FROM teachers";
 $result = mysqli_query($connection, $sql);
 if (mysqli_num_rows($result) > 0) {
     while ($row = mysqli_fetch_assoc($result)) {
         $teachers_array[] = $row['teacher_name'];
         $t_bg_color_array[] = $row['bg_color'];
         $t_fore_color_array[] = $row['fore_color'];
         $t_days_array[] = getDayName($fh, $connection, $row['on_day']);
     }
 } else {
     fwrite($fh, date("m/d/Y h:i:s a", time()) . "...ERROR Line#71 (get_data.php): Can't get teachers: " . $sql . " == " . $connection->error . PHP_EOL);
 }
 // prepare final data and send back
 $final_data = array();
 $final_data["classes"] = $classes_array;
 $final_data["s_bg_colors"] = $s_bg_color_array;
 $final_data["s_fore_colors"] = $s_fore_color_array;
 $final_data["s_css_top"] = $s_css_top_array;
 $final_data["s_css_left"] = $s_css_left_array;
 $final_data["s_css_width"] = $s_css_width_array;
 $final_data["s_days"] = $s_days_array;
 $final_data["teachers"] = $teachers_array;
 $final_data["t_bg_colors"] = $t_bg_color_array;
function isDayEingeschraenkt($mietobjekt_id, $day)
{
    global $root;
    include_once $root . "/include/datumFunctions.inc.php";
    $typ = BE_TYP_TAG;
    $res = getBuchungseinschraenkungZeitVon($mietobjekt_id, $typ);
    while ($d = $res->FetchNextObject()) {
        $timestamp = $d->VON;
        $tag = getDayFromBooklineDate($timestamp);
        $monat = getMonthFromBooklineDate($timestamp);
        $jahr = getYearFromBooklineDate($timestamp);
        $dayName = getDayName($tag, $monat, $jahr);
        if ($dayName == $day) {
            return true;
        }
    }
    return false;
}
/**
 * author:coster
 * date:21.10.05
 * zeigt einen einzelnen tag 
 * */
function showDay($day, $month, $year, $vermieter_id, $mietobjekt_id, $modus)
{
    global $root;
    //anzahl der tage des monats:
    $anzahlTage = getNumberOfDaysOfMonth($month, $year);
    include_once $root . "/include/reservierungFunctions.inc.php";
    include_once $root . "/include/mieterFunctions.inc.php";
    include_once $root . "/templates/constants.inc.php";
    $ansicht = TAGESANSICHT;
    ?>
			<table border="0" width="100%" cellspacing="1" cellpadding="0" class="<?php 
    echo TABLE_COLOR;
    ?>
">
			<?php 
    $status = getStatus($mietobjekt_id, 0, 0, $day, $month, $year, 59, 23, $day, $month, $year);
    if (isset($status) && sizeof($status) >= 1) {
        $statusString = BELEGT;
    } else {
        $statusString = FREI;
    }
    $mieter_id = -1;
    ?>
					<tr class="<?php 
    echo TABLE_COLOR;
    ?>
"> 
						<!-- wochentag anzeigen -->
						<td class="<?php 
    echo TABLE_COLOR;
    ?>
" valign="middle">
							<?php 
    echo getUebersetzung(getDayName($day, $month, $year));
    ?>
				 		</td>
						<!-- datum anzeigen -->
						<td class="<?php 
    echo TABLE_COLOR;
    ?>
" valign="middle">
							<?php 
    echo $day . ".";
    echo $month . ".";
    echo $year;
    ?>
						</td>	
						<!-- grafische reservierung anzeigen -->
						<td class="<?php 
    echo TABLE_COLOR;
    ?>
">
							<?php 
    //wie viele reservierungen sind an diesem tag?
    $resIds = getReservierungIDs($mietobjekt_id, 0, 0, $day, $month, $year, 59, 23, $day, $month, $year);
    $anzahlRes = mysqli_num_rows($resIds);
    ?>
					
						  <table cellpadding="0" cellspacing="0" border="0">
						    <tr>
						    	<td width="5" class="<?php 
    echo FREI;
    ?>
">&nbsp;</td>
							    <?php 
    for ($l = 0; $l < $anzahlRes; $l++) {
        ?>
							      <td width="5" class="<?php 
        echo BELEGT;
        ?>
">&nbsp;</td>
							    <?php 
    }
    ?>
						    </tr>
						  </table>
						</td>
					</tr>
			</table>
			<br/>
			<?php 
    if ($anzahlRes > 0) {
        ?>
					<table cellpadding="3" cellspacing="0" border="0" class="<?php 
        echo TABLE;
        ?>
">
						<?php 
        while ($d = mysqli_fetch_array($resIds)) {
            $reservierungs_id = $d["RESERVIERUNG_ID"];
            $mieter_id = getMieterIdOfReservierung($reservierungs_id);
            $mietdauer = getNumberOfDaysOfReservation($reservierungs_id);
            $isFirstDay = isFirstDayOfReservation($reservierungs_id, $day, $month, $year);
            $isLastDay = isLastDayOfReservation($reservierungs_id, $day, $month, $year);
            $timeVon = getTimeVonOfReservierung($reservierungs_id);
            $timeBis = getTimeBisOfReservierung($reservierungs_id);
            ?>
						<form action="./mieterInfos/index.php" method="post" name="form<?php 
            echo $day;
            ?>
" target="_self">
						<input type="hidden" name="mietobjekt_id" value="<?php 
            echo $mietobjekt_id;
            ?>
" />
						<input type="hidden" name="monat" value="<?php 
            echo $month;
            ?>
" />
						<input type="hidden" name="jahr" value="<?php 
            echo $year;
            ?>
" />
						<input type="hidden" name="tag" value="<?php 
            echo $day;
            ?>
" />
						<input type="hidden" name="ansicht" value="<?php 
            echo $ansicht;
            ?>
" />
						<tr>
							<?php 
            if ($modus == MODUS_WEBINTERFACE) {
                ?>
							<td>
								<input name="mieter_id" type="hidden" value="<?php 
                echo $mieter_id;
                ?>
">						  
								 <?php 
                //gast-namen ausgeben:
                if ($mieter_id != ANONYMER_MIETER_ID) {
                    echo getNachnameOfMieter($mieter_id);
                    echo ", ";
                    echo getMieterOrt($mieter_id);
                } else {
                    echo getUebersetzung("anonymer Mieter");
                }
                ?>
							</td>
							<?php 
            } else {
                if ($modus == MODUS_BELEGUNGSPLAN) {
                    ?>
								<td>
									<?php 
                    echo getUebersetzung("reserviert");
                    ?>
								</td>
							<?php 
                }
            }
            ?>
							<td>
								<?php 
            //zeit ausgeben:
            //wenn mietdauer mehr als 3 tage, braucht nur bei
            //tag 1 und tag 3 die zeit ausgegeben werden:
            if ($mietdauer >= 2) {
                if ($isFirstDay) {
                    echo $timeVon . " - 24:00 " . getUebersetzung("Uhr");
                } else {
                    if ($isLastDay) {
                        echo "00:00 - " . $timeBis . " " . getUebersetzung("Uhr");
                    } else {
                        ?>
										00:00 - 24:00 <?php 
                        echo getUebersetzung("Uhr");
                        ?>
										<?php 
                    }
                }
            } else {
                echo getTimeVonOfReservierung($reservierungs_id) . " - " . getTimeBisOfReservierung($reservierungs_id);
            }
            //ende else
            ?>
							</td>
							<td>
								<?php 
            //button für mieter infos  ausgeben:
            if ($mieter_id != ANONYMER_MIETER_ID && $modus == MODUS_WEBINTERFACE) {
                ?>
								<input type="submit" name="Submit" class="<?php 
                echo BUTTON;
                ?>
" 
									onMouseOver="this.className='<?php 
                echo BUTTON_HOVER;
                ?>
';"
			   						onMouseOut="this.className='<?php 
                echo BUTTON;
                ?>
';" 
			   						value="<?php 
                echo getUebersetzung("Mieter-Info");
                ?>
"/>
		   						<?php 
            }
            ?>
							</td>
						</tr>
						</form>	
						<?php 
        }
        ?>
					</table>
					<?php 
    } else {
        ?>
						<table cellpadding="3" class="<?php 
        echo TABLE_COLOR;
        ?>
">
							<tr>
								<td><?php 
        echo getUebersetzung("Keine Reservierung an diesem Tag vorhanden");
        ?>
.</td>
							</tr>
						</table>
						<?php 
    }
}
Ejemplo n.º 9
0
		WHERE ba_fechabaja IS NULL
			AND ba_id = :id
 ORDER BY ba_fecha DESC";
$stmt = DBExecSql($conn, $sql, $params);
$row = DBGetQuery($stmt);

$imgPortada = "/modules/mantenimiento/abm_arteria_noticias/images/portada.jpg";
if ($row["BA_EXTENSIONIMAGEN"] != "") {
	$imgPortada = IMAGES_ARTERIA_PATH."portada\\".$row["BA_ID"].".".$row["BA_EXTENSIONIMAGEN"];
	$imgPortada = "/modules/arteria_noticias/get_image.php?file=".base64_encode($imgPortada);
}

$fecha = '<span style="color:#f00;">Escoja una fecha</span>';
if ($row["BA_FECHA"] != "") {
	$vals = explode("/", $row["BA_FECHA"]);
	$fecha = getDayName(date("N", strtotime($vals[2]."-".$vals[1]."-".$vals[0])))." ".$vals[0]." de ".GetMonthName($vals[1])." de ".$vals[2];
}

$ano = '<span style="color:#f00;">Escoja una año</span>';
if ($row["BA_ANO"] != "")
	$ano = "Año ".decimalToRomana($row["BA_ANO"]);

$numero = '<span style="color:#f00;">Escoja una número</span>';
if ($row["BA_NUMERO"] != "")
	$numero = "Número ".decimalToRomana($row["BA_NUMERO"]);

$idEstadistica = logUrlIn($_SERVER["REQUEST_URI"]);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
Ejemplo n.º 10
0
/**
 * formatDate 
 * 
 * Formats a date with translation.
 *
 * @param string $dateFormat
 * @param date   $date 
 *
 * @return string
 */
function formatDate($dateFormat, $date)
{
    // Get translatable parts of the date
    $m = date('n', strtotime($date));
    # month 1-12
    $d = date('w', strtotime($date));
    # weekday 0-6
    $a = date('a', strtotime($date));
    # meridiem am or pm
    $A = date('A', strtotime($date));
    # merideim AM or PM
    // Get translated forms
    $month = getMonthName($m);
    $month_abbr = getMonthAbbr($m);
    $day = getDayName($d);
    $day_abbr = getDayAbbr($d);
    $l_meridiem = getMeridiem($a);
    $u_meridiem = getMeridiem($A);
    // Replace translatable parts of date with the translated versions
    $dateFormat = preg_replace("/(?<!\\\\)F/", addBackSlashes($month), $dateFormat);
    # full month
    $dateFormat = preg_replace("/(?<!\\\\)l/", addBackSlashes($day), $dateFormat);
    # full weekday
    $dateFormat = preg_replace("/(?<!\\\\)M/", addBackSlashes($month_abbr), $dateFormat);
    # 3 letter month
    $dateFormat = preg_replace("/(?<!\\\\)D/", addBackSlashes($day_abbr), $dateFormat);
    # 3 letter weekday
    $dateFormat = preg_replace("/(?<!\\\\)a/", addBackSlashes($l_meridiem), $dateFormat);
    # lowercase merideim
    $dateFormat = preg_replace("/(?<!\\\\)A/", addBackSlashes($u_meridiem), $dateFormat);
    # uppercase merideim
    // Format date with translated data
    $fixedDate = date($dateFormat, strtotime($date));
    return $fixedDate;
}
Ejemplo n.º 11
0
function getTheNextAppointment($appointment_date, $freq)
{
    $day_arr = explode(",", $freq);
    $date_arr = array();
    foreach ($day_arr as $day) {
        $day = getDayName($day);
        $date = date('Y-m-d', strtotime("next " . $day, strtotime($appointment_date)));
        array_push($date_arr, $date);
    }
    $next_appointment = getEarliestDate($date_arr);
    return $next_appointment;
}
function showMonth($month, $year, $unterkunft_id, $zimmer_id, $sprache, $saAktiviert, $link)
{
    //anzahl der tage des monats:
    $anzahlTage = getNumberOfDays($month, $year);
    ?>

    <?php 
    for ($i = 1; $i <= $anzahlTage; $i++) {
        $res_id = getReservierungID($zimmer_id, $i, $month, $year, $link);
        $statusString = getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
        $gast_id = -1;
        ?>
        <div class="row">
            <!-- wochentag anzeigen -->
            <div class="col-sm-1">
                <label class="control-label">
                    <?php 
        echo getUebersetzung(getDayName($i, $month, $year), $sprache, $link);
        ?>
                </label>
            </div>
            <!-- datum anzeigen -->
            <div class="col-sm-1 <?php 
        echo $statusString;
        ?>
">
                <label class="control-label">
                    <?php 
        printResAdmin($zimmer_id, $i, $month, $year, $saAktiviert, $link);
        ?>
                </label>
            </div>
            <!-- gast anzeigen -->
            <div class="col-sm-3">
                <?php 
        if ($statusString != "frei") {
            ?>
                    <?php 
            //gast-id auslesen:
            //$gast_id = getReservierungGastID($zimmer_id,$i,$month,$year,$link);
            $gast_ids = getReservierungGastIDs($zimmer_id, $i, $month, $year, $link);
            while ($h = mysqli_fetch_array($gast_ids)) {
                $gast_id = $h["FK_Gast_ID"];
                //if child rooms available, check also childs:
                if (($gast_id == 1 || empty($gast_id)) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true" && hasChildRooms($zimmer_id)) {
                    //if room is a parent, check if the child has another status:
                    $childs = getChildRooms($zimmer_id);
                    while ($c = mysqli_fetch_array($childs)) {
                        $child_zi_id = $c['PK_ID'];
                        $gast_id = getReservierungGastID($child_zi_id, $i, $month, $year, $link);
                        if ($gast_id != 1 && $gast_id != "") {
                            break;
                        }
                    }
                }
                //gast-namen ausgeben:
                if ($gast_id != 1 && $gast_id != "") {
                    ?>
                            <a href="./gastInfo/index.php?gast_id=<?php 
                    echo $gast_id;
                    ?>
&zimmer_id=<?php 
                    echo $zimmer_id;
                    ?>
&jahr=<?php 
                    echo $year;
                    ?>
&monat=<?php 
                    echo $month;
                    ?>
">
                            <?php 
                    echo getGuestNachname($gast_id, $link);
                    ?>
                            </a>
                            <?php 
                    echo ", ";
                    echo getGuestOrt($gast_id, $link);
                    echo ", EW " . getErwachsene($res_id, $link) . ", K " . getKinder($res_id, $link) . ", " . getPension($res_id, $link);
                } else {
                    if ($gast_id == "") {
                    } else {
                        echo getUebersetzung("anonymer Gast", $sprache, $link);
                    }
                }
            }
            //ende while gast ids
        } else {
            echo "&nbsp;";
        }
        ?>
            </div>
        </div>
    <?php 
    }
    //ende for
    ?>
    <?php 
}
Ejemplo n.º 13
0
$this->load->helper('form');
echo validation_errors();
echo form_open(current_url());
$dropdown = 'class="dropdown"';
$clear = 'class="cleardefault"';
$buton = 'class="submit"';
?>
<div class="clearBoth" style="height:10px;"></div>
<div id="PageContent">
    <div id="header" style="background-image: url(<?php 
echo IMAGES_PATH;
?>
banner/evenimente.png)"></div>
    <div id="continut">
   <!--     <div><?php 
echo getDayName($ziuaSaptamanii);
?>
, <?php 
echo prepareDateWithYear($data);
?>
</div>-->
        <?php 
if (isset($evenimente) && count($evenimente) > 0) {
    ?>

        <div class="p_text" style="margin-bottom: 20px;">
            <div class="i_title">
                Calendar evenimente
            </div>
        </div>     <div class="clearBoth"></div>
        <?php 
function printResAdminAJAX($zimmer_id, $i, $month, $year, $saAktiviert, $link, $unterkunft_id)
{
    //global $unterkunft_id;
    $response = "";
    $status = getStatus($zimmer_id, $i, $month, $year, $link);
    if (sizeof($status) < 1 && hasChildRooms($zimmer_id) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true") {
        //if room is a parent, check if the child has another status:
        $childs = getChildRooms($zimmer_id);
        while ($c = mysqli_fetch_array($childs)) {
            $child_zi_id = $c['PK_ID'];
            $status = getStatus($child_zi_id, $i, $month, $year, $link);
            if (sizeof($status) > 0) {
                break;
            }
        }
    }
    if (getDayName($i, $month, $year) == "SA" && $saAktiviert) {
        $isSamstag = true;
    } else {
        $isSamstag = false;
    }
    if (isset($status) && sizeof($status) > 1) {
        //an diesem tag ist ein urlauberwechsel:
        $response .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
        $response .= "<tr>";
        $response .= "<td class=\"" . parseStatus($status[0], $isSamstag) . "\" align=\"right\" width=\"50%\">";
        $response .= $i;
        $response .= "</td>";
        $response .= "<td class=\"" . parseStatus($status[1], $isSamstag) . "\" align=\"right\" width=\"50%\">&nbsp;";
        $response .= "</td>";
        $response .= "</tr>";
        $response .= "</table>";
    } else {
        if (isset($status) && sizeof($status) == 1) {
            //schauen ob der letzte tag halb-frei ist:
            $nTag = $i + 1;
            $nMonat = $month;
            $nJahr = $year;
            $anzahlTage = getNumberOfDays($month, $year);
            if ($nTag > $anzahlTage) {
                $nTag = 1;
                $nMonat = $month + 1;
            }
            //ende if tag zu gross
            if ($nMonat > 12) {
                $nMonat = 1;
                $nJahr = $year + 1;
            }
            //ende if monat zu gross
            $nStatus = getStatus($zimmer_id, $nTag, $nMonat, $nJahr, $link);
            //echo("nächster Tag: ");var_dump($nStatus);
            if (sizeof($nStatus) < 1 && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true" && hasChildRooms($zimmer_id)) {
                //if room is a parent, check if the child has another status:
                $childs = getChildRooms($zimmer_id);
                while ($c = mysqli_fetch_array($childs)) {
                    $child_zi_id = $c['PK_ID'];
                    $nStatus = getStatus($child_zi_id, $nTag, $nMonat, $nJahr, $link);
                    if (sizeof($nStatus) > 0) {
                        break;
                    }
                }
            }
            if (sizeof($nStatus) == 0) {
                $response .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                $response .= "<tr>";
                $response .= "<td class=\"" . parseStatus($status[0], $isSamstag) . "\" align=\"right\" width=\"50%\">";
                $response .= "</td>";
                $response .= "<td class=\"frei\" align=\"right\" width=\"50%\">&nbsp;";
                $response .= $i;
                $response .= "</td>";
                $response .= "</tr>";
                $response .= "</table>";
            } else {
                //schauen ob der tag vorher frei ist:
                $vTag = $i - 1;
                $vMonat = $month;
                $vJahr = $year;
                if ($vTag < 1) {
                    $vMonat = $month - 1;
                    if ($vMonat < 1) {
                        $vMonat = 12;
                        $vJahr = $year - 1;
                    }
                    //ende if monat zu klein
                    $vTag = getNumberOfDays($vMonat, $vJahr);
                }
                //ende if tag zu klein
                $vStatus = getStatus($zimmer_id, $vTag, $vMonat, $vJahr, $link);
                if (sizeof($vStatus) < 1 && hasChildRooms($zimmer_id) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true") {
                    //if room is a parent, check if the child has another status:
                    $childs = getChildRooms($zimmer_id);
                    while ($c = mysqli_fetch_array($childs)) {
                        $child_zi_id = $c['PK_ID'];
                        $vStatus = getStatus($child_zi_id, $vTag, $vMonat, $vJahr, $link);
                        if (sizeof($vStatus) > 0) {
                            break;
                        }
                    }
                }
                if (sizeof($vStatus) == 0) {
                    //am vorherigen tag ist es frei:
                    $response .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                    $response .= "<tr>";
                    $response .= "<td class=\"frei\" align=\"right\" width=\"50%\">";
                    $response .= $i;
                    $response .= "</td>";
                    $response .= "<td class=\"" . parseStatus($status[0], $isSamstag) . "\" align=\"right\" width=\"50%\">&nbsp;";
                    $response .= "</td>";
                    $response .= "</tr>";
                    $response .= "</table>";
                } else {
                    $response .= $i;
                }
            }
            //ende else schauen ob tag vorher frei
        } else {
            //tag ausgeben:
            $response .= $i;
        }
    }
    //ende else tag ausgeben
    return $response;
}
/**
 * author:coster
 * date:21.10.05
 * zeigt ein einzelnes monat für das webinterface in einer tabelle
 * */
function showWeek($day, $month, $year, $vermieter_id, $mietobjekt_id, $modus)
{
    global $root;
    global $ansicht;
    //anzahl der tage des monats:
    $anzahlTage = getNumberOfDaysOfMonth($month, $year);
    include_once $root . "/include/reservierungFunctions.inc.php";
    include_once $root . "/include/mieterFunctions.inc.php";
    $lastDayOfWeek = getLastDayOfWeek($day, $month, $year);
    $lastDayMonth = $month;
    $lastDayYear = $year;
    if ($lastDayOfWeek < $day) {
        $lastDayMonth++;
    }
    if ($lastDayMonth > 12) {
        $lastDayMonth = 1;
        $lastDayYear++;
    }
    $firstDayOfWeek = getFirstDayOfWeek($day, $month, $year);
    $firstDayMonth = $month;
    $firstDayYear = $year;
    if ($firstDayOfWeek > $day) {
        $firstDayMonth--;
    }
    if ($firstDayMonth < 1) {
        $firstDayMonth = 12;
        $firstDayYear--;
    }
    ?>
			<table border="0" width="100%" cellspacing="1" cellpadding="0" class="<?php 
    echo TABLE_COLOR;
    ?>
">
			<?php 
    $status = getStatus($mietobjekt_id, 0, 0, $day, $month, $year, 59, 23, $day, $month, $year);
    if (isset($status) && sizeof($status) >= 1) {
        $statusString = BELEGT;
    } else {
        $statusString = FREI;
    }
    $mieter_id = -1;
    ?>
					<tr class="<?php 
    echo TABLE_COLOR;
    ?>
"> 
						<!-- wochentag anzeigen -->
						<td class="<?php 
    echo TABLE_COLOR;
    ?>
" valign="left" class="<?php 
    echo TABLE_STANDARD;
    ?>
">
							<?php 
    echo getUebersetzung("Woche") . " ";
    echo getUebersetzung("von") . " ";
    echo getUebersetzung(getDayName($firstDayOfWeek, $firstDayMonth, $firstDayYear));
    ?>
				 		</td>
						<!-- datum anzeigen -->
						<td class="<?php 
    echo TABLE_COLOR;
    ?>
" valign="left" class="<?php 
    echo TABLE_STANDARD;
    ?>
">
							<?php 
    echo $firstDayOfWeek . ".";
    echo $firstDayMonth . ".";
    echo $firstDayYear;
    ?>
						</td>	
						<td class="<?php 
    echo TABLE_COLOR;
    ?>
" valign="left" class="<?php 
    echo TABLE_STANDARD;
    ?>
">
							<?php 
    echo getUebersetzung("bis") . " ";
    echo getUebersetzung(getDayName($lastDayOfWeek, $lastDayMonth, $lastDayYear));
    ?>
				 		</td>
						<!-- datum anzeigen -->
						<td class="<?php 
    echo TABLE_COLOR;
    ?>
" valign="left" class="<?php 
    echo TABLE_STANDARD;
    ?>
">
							<?php 
    echo $lastDayOfWeek . ".";
    echo $lastDayMonth . ".";
    echo $lastDayYear;
    ?>
						</td>							
						<!-- grafische reservierung anzeigen -->
						<td class="<?php 
    echo TABLE_COLOR;
    ?>
" class="<?php 
    echo TABLE_STANDARD;
    ?>
">
							<?php 
    //wie viele reservierungen sind in dieser Woche?
    $resIds = getReservierungIDs($mietobjekt_id, 0, 0, $firstDayOfWeek, $firstDayMonth, $firstDayYear, 59, 23, $lastDayOfWeek, $lastDayMonth, $lastDayYear);
    $anzahlRes = mysqli_num_rows($resIds);
    ?>
					
						  <table cellpadding="0" cellspacing="0" border="0">
						    <tr>
						    	<td width="5" class="<?php 
    echo FREI;
    ?>
">&nbsp;</td>
							    <?php 
    for ($l = 0; $l < $anzahlRes; $l++) {
        ?>
							      <td width="5" class="<?php 
        echo BELEGT;
        ?>
">&nbsp;</td>
							    <?php 
    }
    ?>
						    </tr>
						  </table>
						</td>
					</tr>
			</table>
			<br/>	
			<table cellpadding="0" cellspacing="1" border="0" class="<?php 
    echo TABLE;
    ?>
" width="100%">
			<tr>
				<th>Tag</th>
				<th>Datum</th>
				<th></th>
				<th></th>
				<th></th>
				<th></th>
			</tr>		
			<?php 
    //anzeige der einzelnen wochentage:
    for ($iz = $firstDayOfWeek; $iz < $firstDayOfWeek + 7; $iz++) {
        $i_month = $firstDayMonth;
        $i_year = $firstDayYear;
        $i_day = $iz;
        if ($i_day > getNumberOfDaysOfMonth($firstDayMonth, $firstDayYear)) {
            $i_month++;
            $i_day = $iz - getNumberOfDaysOfMonth($firstDayMonth, $firstDayYear);
        }
        if ($i_month > 12) {
            $i_year++;
        }
        $anzahlResOnDayI = countReservierungIDs($mietobjekt_id, 0, 0, $i_day, $i_month, $i_year, 59, 23, $i_day, $i_month, $i_year);
        if ($anzahlResOnDayI > 0) {
            $resIds = getReservierungIDs($mietobjekt_id, 0, 0, $i_day, $i_month, $i_year, 59, 23, $i_day, $i_month, $i_year);
            while ($d = mysqli_fetch_array($resIds)) {
                $reservierungs_id = $d["RESERVIERUNG_ID"];
                $mieter_id = getMieterIdOfReservierung($reservierungs_id);
                $mietdauer = getNumberOfDaysOfReservation($reservierungs_id);
                $isFirstDay = isFirstDayOfReservation($reservierungs_id, $i_day, $i_month, $i_year);
                $isLastDay = isLastDayOfReservation($reservierungs_id, $i_day, $i_month, $i_year);
                $timeVon = getTimeVonOfReservierung($reservierungs_id);
                $timeBis = getTimeBisOfReservierung($reservierungs_id);
                $allDay = false;
                if ($mietdauer > 1 && !$isFirstDay && !$isLastDay) {
                    $allDay = true;
                } else {
                    if ($timeVon == "00:00" && $timeBis == "24:00") {
                        $allDay = true;
                    }
                }
                ?>
						<form action="./mieterInfos/index.php" method="post" name="form<?php 
                echo $day;
                ?>
" target="_self">
						<input type="hidden" name="mietobjekt_id" value="<?php 
                echo $mietobjekt_id;
                ?>
" />
						<input type="hidden" name="monat" value="<?php 
                echo $month;
                ?>
" />
						<input type="hidden" name="jahr" value="<?php 
                echo $year;
                ?>
" />
						<input type="hidden" name="tag" value="<?php 
                echo $day;
                ?>
" />
						<input type="hidden" name="ansicht" value="<?php 
                echo $ansicht;
                ?>
" />
						<tr>
							<!-- wochentag anzeigen -->
							<td class="<?php 
                echo TABLE_STANDARD;
                ?>
" valign="left" class="<?php 
                echo TABLE_STANDARD;
                ?>
">
								<?php 
                echo getUebersetzung(getDayName($i_day, $i_month, $i_year));
                ?>
					 		</td>
							<!-- datum anzeigen -->
							<td class="<?php 
                echo TABLE_STANDARD;
                ?>
" valign="left" class="<?php 
                echo TABLE_STANDARD;
                ?>
">
								<?php 
                echo $i_day . ".";
                echo $i_month . ".";
                echo $i_year;
                ?>
							</td>	
							<!-- grafische reservierung anzeigen -->
							<td class="<?php 
                echo TABLE_STANDARD;
                ?>
">				
							  <table cellpadding="0" cellspacing="0" border="0">
							    <tr>
							    	<?php 
                if (!$allDay) {
                    ?>
							    	<td width="5" class="<?php 
                    echo FREI;
                    ?>
">&nbsp;</td>
								    <?php 
                }
                for ($z = 0; $z < $anzahlResOnDayI; $z++) {
                    ?>
								      <td width="5" class="<?php 
                    echo BELEGT;
                    ?>
">&nbsp;</td>
								    <?php 
                }
                ?>
							    </tr>
							  </table>
							</td>
							<!-- text -->
							<?php 
                if ($modus == MODUS_WEBINTERFACE) {
                    ?>
							<td class="<?php 
                    echo TABLE_STANDARD;
                    ?>
">
								<input name="mieter_id" type="hidden" value="<?php 
                    echo $mieter_id;
                    ?>
">						  
								 <?php 
                    //gast-namen ausgeben:
                    if ($mieter_id != ANONYMER_MIETER_ID) {
                        echo getNachnameOfMieter($mieter_id);
                        echo ", ";
                        echo getMieterOrt($mieter_id);
                    } else {
                        echo getUebersetzung("anonymer Mieter");
                    }
                    ?>
							</td>
							<?php 
                } else {
                    if ($modus == MODUS_BELEGUNGSPLAN) {
                        ?>
							<td class="<?php 
                        echo TABLE_STANDARD;
                        ?>
">
								<?php 
                        echo getUebersetzung("reserviert");
                        ?>
							</td>
							<?php 
                    }
                }
                if ($modus == MODUS_BELEGUNGSPLAN && $mieter_id != ANONYMER_MIETER_ID) {
                    ?>
							<td class="<?php 
                    echo TABLE_STANDARD;
                    ?>
">
							<?php 
                } else {
                    ?>
							<td class="<?php 
                    echo TABLE_STANDARD;
                    ?>
" colspan="2">
							<?php 
                }
                //zeit ausgeben:
                //wenn mietdauer mehr als 3 tage, braucht nur bei
                //tag 1 und tag 3 die zeit ausgegeben werden:
                if ($mietdauer >= 2) {
                    if ($isFirstDay) {
                        echo $timeVon . " - 24:00 " . getUebersetzung("Uhr");
                    } else {
                        if ($isLastDay) {
                            echo "00:00 - " . $timeBis . " " . getUebersetzung("Uhr");
                        } else {
                            ?>
										00:00 - 24:00 <?php 
                            echo getUebersetzung("Uhr");
                            ?>
										<?php 
                        }
                    }
                }
                ?>
							</td>
							<?php 
                if ($modus == MODUS_WEBINTERFACE) {
                    ?>
							<td class="<?php 
                    echo TABLE_STANDARD;
                    ?>
">
								<?php 
                    //button für mieter infos  ausgeben:
                    if ($mieter_id != ANONYMER_MIETER_ID) {
                        ?>
								<input type="submit" name="Submit" class="<?php 
                        echo BUTTON;
                        ?>
" 
									onMouseOver="this.className='<?php 
                        echo BUTTON_HOVER;
                        ?>
';"
			   						onMouseOut="this.className='<?php 
                        echo BUTTON;
                        ?>
';" 
			   						value="<?php 
                        echo getUebersetzung("Mieter-Info");
                        ?>
"/>
		   						<?php 
                    }
                    ?>
							</td>
							<?php 
                }
                //ende wenn modus webinterface
                ?>
						</tr>
						</form>	
						<?php 
            }
            ?>
				
					<?php 
        } else {
            ?>
							<tr>
								<!-- wochentag anzeigen -->
								<td class="<?php 
            echo TABLE_STANDARD;
            ?>
" valign="left" class="<?php 
            echo TABLE_STANDARD;
            ?>
">
									<?php 
            echo getUebersetzung(getDayName($i_day, $i_month, $i_year));
            ?>
						 		</td>					 		
								<!-- datum anzeigen -->
								<td valign="left" class="<?php 
            echo TABLE_STANDARD;
            ?>
" class="<?php 
            echo TABLE_STANDARD;
            ?>
">
									<?php 
            echo $i_day . ".";
            echo $i_month . ".";
            echo $i_year;
            ?>
								</td>	
								<!-- grafische reservierung anzeigen -->
								<td class="<?php 
            echo TABLE_STANDARD;
            ?>
">				
								  <table cellpadding="0" cellspacing="0" border="0">
								    <tr>
								    	<td width="5" class="<?php 
            echo FREI;
            ?>
">&nbsp;</td>
								    </tr>
								  </table>
								</td>
								<td colspan="3" class="<?php 
            echo TABLE_STANDARD;
            ?>
"><?php 
            echo getUebersetzung("Keine Reservierung an diesem Tag vorhanden");
            ?>
.</td>	
							</tr>
						<?php 
        }
        //ende anzahl reservierungen < 0
    }
    //ende for alle tage der woche
    ?>
	
			</table>
<?php 
}
/**
author:coster
date:5.11.05
liefert den grund einer buchungseinschränkung
*/
function getBuchungseinschraenkungText($vonTag, $vonMonat, $vonJahr, $bisTag, $bisMonat, $bisJahr, $zimmer_ids)
{
    global $link;
    global $root;
    global $sprache;
    include_once $root . "/include/uebersetzer.php";
    include_once $root . "/include/datumFunctions.php";
    $wochentag_von = getDayName($vonTag, $vonMonat, $vonJahr);
    $wochentag_von = getUebersetzung($wochentag_von, $sprache, $link);
    $wochentag_bis = getDayName($bisTag, $bisMonat, $bisJahr);
    $wochentag_bis = getUebersetzung($wochentag_bis, $sprache, $link);
    $vonDatum = parseDateFormular($vonTag, $vonMonat, $vonJahr);
    $bisDatum = parseDateFormular($bisTag, $bisMonat, $bisJahr);
    $query = "select distinct\n\t\t  *\n\t\t  from\n\t\t  Rezervi_Buch_Einschraenkung\n\t\t  where ";
    for ($i = 0; $i < count($zimmer_ids); $i++) {
        if ($i == count($zimmer_ids) - 1) {
            $query .= " FK_Zimmer_ID = " . $zimmer_ids[$i];
        } else {
            $query .= " FK_Zimmer_ID = " . $zimmer_ids[$i] . " OR ";
        }
    }
    $query .= " AND\n\t\t  (\t\t  \n\t\t   ('{$vonDatum}' >= Datum_von and '{$bisDatum}' <= Datum_bis)\n\t\t   OR\n\t\t   ('{$vonDatum}' < Datum_bis and '{$bisDatum}' <= Datum_bis and '{$bisDatum}' > Datum_von)\n\t\t   OR\n\t\t   ('{$vonDatum}' >= Datum_von and '{$bisDatum}' > Datum_bis and '{$vonDatum}' < Datum_bis)\n\t\t   \tOR\n\t\t   ('{$vonDatum}' <= Datum_von and '{$bisDatum}' >= Datum_bis)\n\t\t   )\n\t\t   ";
    $res = mysqli_query($link, $query);
    if (!$res) {
        echo mysqli_error($link);
        echo $query;
        exit;
    }
    while ($d = mysqli_fetch_array($res)) {
        $wo_von = $d["Tag_von"];
        $wo_von = getUebersetzung($wo_von, $sprache, $link);
        $wo_bis = $d["Tag_bis"];
        $wo_bis = getUebersetzung($wo_bis, $sprache, $link);
        break;
    }
    $text = "Buchungen sind nur von";
    $text = getUebersetzung($text, $sprache, $link);
    $text .= " " . $wo_von . " " . getUebersetzung("bis", $sprache, $link) . " " . $wo_bis . " " . getUebersetzung("erlaubt", $sprache, $link) . ".";
    $text .= " " . getUebersetzung("Das gewählte Datum ist von", $sprache, $link) . " ";
    $text .= $wochentag_von . " " . getUebersetzung("bis", $sprache, $link) . " " . $wochentag_bis;
    return $text;
}
Ejemplo n.º 17
0
/**
 * Returns the localized representation of the date/time.
 *
 * @param string date_format The format for the date, like the input for the PHP date() function.
 * @param int stamp the timestamp to convert
 * @return string a full date representation
 */
function date_intl($date_format, $stamp)
{
    $ret = str_replace(array('D', 'F', 'l', 'M'), array('$1', '$2', '$3', '$4'), $date_format);
    // to reduce the date calls we retrieve m and w in the same call
    $ret = date('w#m#' . $ret, $stamp);
    // extract day and month in order to replace later by intl day and month
    $aParts = explode('#', $ret);
    $ret = str_replace(array('$1', '$4', '$2', '$3'), array(getDayAbrv($aParts[0]), getMonthAbrv($aParts[1]), getMonthName($aParts[1]), getDayName($aParts[0])), $aParts[2]);
    return $ret;
}
function getStatusString($zimmer_id, $tag, $monat, $jahr, $saAktiviert, $link)
{
    global $root;
    global $link;
    global $unterkunft_id;
    include_once $root . "/include/propertiesFunctions.php";
    include_once $root . "/include/zimmerFunctions.php";
    //should the reservation state be shown?
    $showReservation = getPropertyValue(SHOW_RESERVATION_STATE, $unterkunft_id, $link);
    if ($showReservation != "true") {
        $showReservation = false;
    }
    if ($saAktiviert != "true") {
        $saAktiviert = false;
    }
    //status = 0: frei
    //status = 1: reserviert
    //status = 2: belegt
    if ($monat < 10 && strlen($monat) <= 1) {
        $monat = "0" . $monat;
    }
    if ($tag < 10 && strlen($tag) <= 1) {
        $tag = "0" . $tag;
    }
    $datum = $jahr . "-" . $monat . "-" . $tag;
    //daten aus datenbank abrufen...
    $query = "select \n\t\t\t\tStatus\n\t\t\t\tfrom \n\t\t\t\tRezervi_Reservierung\n\t\t\t\twhere \t\t\n\t\t\t\tFK_Zimmer_ID = '{$zimmer_id}' and\n\t\t\t\t('{$datum}' >= Datum_von and '{$datum}' <= Datum_bis)\t\t\t\t\n\t\t\t\t";
    $res = mysqli_query($link, $query);
    if (!$res) {
        echo "Anfrage {$query} scheitert.";
    } else {
        $d = mysqli_fetch_array($res);
    }
    $day = getDayName($tag, $monat, $jahr);
    if ($d["Status"] == "0") {
        if ($day == "SA" && $saAktiviert) {
            $statString = "samstagFrei";
        } else {
            $statString = "frei";
        }
    } elseif ($d["Status"] == "1") {
        if ($day == "SA" && $saAktiviert) {
            if ($showReservation) {
                $statString = "samstagReserviert";
            } else {
                $statString = "samstagFrei";
            }
        } else {
            if ($showReservation) {
                $statString = "reserviert";
            } else {
                $statString = "frei";
            }
        }
    } elseif ($d["Status"] == "2") {
        if ($day == "SA" && $saAktiviert) {
            $statString = "samstagBelegt";
        } else {
            $statString = "belegt";
        }
    } else {
        //gewöhnliche farbe der tabelle ausgeben:
        //$statString = "tableColor";
        //oder doch besser, dass diese frei sind?
        if ($day == "SA" && $saAktiviert) {
            $statString = "samstagFrei";
        } else {
            $statString = "frei";
        }
    }
    if (($statString == "samstagFrei" || $statString == "frei") && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true" && hasChildRooms($zimmer_id)) {
        //if room is a parent, check if the child has another status:
        $childs = getChildRooms($zimmer_id);
        while ($c = mysqli_fetch_array($childs)) {
            $child_zi_id = $c['PK_ID'];
            $statStringc = getStatusString($child_zi_id, $tag, $monat, $jahr, $saAktiviert, $link);
            if (!($statStringc == "samstagBelegt" || $statStringc == "belegt")) {
                break;
                $statString = $statStringc;
            }
        }
    } else {
        if (getPropertyValue(RES_HOUSE, $unterkunft_id, $link) != "true" && hasChildRooms($zimmer_id)) {
            //get all childs of the parent:
            $childs = getChildRooms($zimmer_id);
            $occ = "true";
            $rse = "true";
            $fre = "true";
            while ($c = mysqli_fetch_array($childs)) {
                $child_zi_id = $c['PK_ID'];
                //check if the child is occupied:
                $statStringc = getStatusString($child_zi_id, $tag, $monat, $jahr, $saAktiviert, $link);
                if ($statStringc == "samstagFrei" || $statStringc == "frei") {
                    $occ = "false";
                    $rse = "false";
                    break;
                } elseif ($statStringc == "reserviert" || $statStringc == "samstagReserviert") {
                    $fre = "false";
                    $occ = "false";
                }
            }
            if ($occ == "true") {
                if ($day == "SA" && $saAktiviert) {
                    $statString = "samstagBelegt";
                } else {
                    $statString = "belegt";
                }
            } elseif ($rse == "true" && $showReservation) {
                if ($day == "SA" && $saAktiviert) {
                    $statString = "samstagReserviert";
                } else {
                    $statString = "reserviert";
                }
            } else {
                if ($day == "SA" && $saAktiviert) {
                    $statString = "samstagFrei";
                } else {
                    $statString = "frei";
                }
            }
        }
    }
    return $statString;
}
function isDayEingeschraenkt($mietobjekt_id, $day)
{
    global $root;
    include_once $root . "/include/datumFunctions.inc.php";
    $typ = BE_TYP_TAG;
    $res = getBuchungseinschraenkungZeitVon($mietobjekt_id, $typ);
    while ($d = mysqli_fetch_array($res)) {
        $timestamp = $d["VON"];
        $tag = getDayFromMySqlTimestamp($timestamp);
        $monat = getMonthFromMySqlTimestamp($timestamp);
        $jahr = getYearFromMySqlTimestamp($timestamp);
        $dayName = getDayName($tag, $monat, $jahr);
        if ($dayName == $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;
}