?>
</style>
<script language="JavaScript" type="text/javascript" src="./rightJS.js">
</script>
<?php 
include_once "./templates/headerB.php";
?>
<table width="100%" border="0" class="tableColor">
  <tr>
    <td class="standardSchriftBold">
    	<?php 
echo getUebersetzung("Belegungsplan", $sprache, $link);
?>
 
    	<?php 
echo getUebersetzung(parseMonthName($monat), $sprache, $link) . " " . $jahr;
?>
    </td>
  </tr>
</table>
<br/>
<table width="100%" border="0" class="table">
  <tr>
    <td colspan="2">
    <?php 
//tabelle mit allen zimmern anzeigen:
showAllRooms($monat, $jahr, $unterkunft_id, $link, $saAktiviert, $sprache);
?>
    </td>
  </tr>
  <tr>

    //Getting months
        var monthsArray=[];

        <?php 
for ($i = 1; $i <= 12; $i++) {
    ?>
        monthsArray[<?php 
    echo $i - 1;
    ?>
]={"monthIndex": <?php 
    echo $i;
    ?>
 ,"month": "<?php 
    echo getUebersetzung(parseMonthName($i, "de"), $sprache, $link);
    ?>
" };
        <?php 
}
?>

        $scope.months = monthsArray;
        $scope.month = new Date().getMonth()+1;

        $scope.monthChanged=function () {
            $scope.monat_left = $scope.month;
            $scope.monat_right = $scope.month;
            var FormData = {
            'month' : $scope.month,
            'year' : $scope.year,
function showMonth($month, $year, $unterkunft_id, $zimmer_id, $link, $saAktiviert, $sprache)
{
    //anzahl der tage des monats:
    $anzahlTage = getNumberOfDays($month, $year);
    $firstDay = getFirstDayOfMonth($month, $year);
    $MO = getUebersetzung("MO", $sprache, $link);
    $DI = getUebersetzung("DI", $sprache, $link);
    $MI = getUebersetzung("MI", $sprache, $link);
    $DO = getUebersetzung("DO", $sprache, $link);
    $FR = getUebersetzung("FR", $sprache, $link);
    $SA = getUebersetzung("SA", $sprache, $link);
    $SO = getUebersetzung("SO", $sprache, $link);
    //erste tag im monat ist ein montag:
    if ($firstDay == "Mon") {
        ?>
<table width="100%" border="0" class="tableColor">
        <tr> 
          <td colspan="7" class="standardSchriftBold"><?php 
        echo getUebersetzung(parseMonthName($month), $sprache, $link) . " " . $year;
        ?>
</td>
        </tr>
        <tr> 
          <td class="tableColor"><?php 
        echo $MO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $MI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $FR;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SA;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SO;
        ?>
</td>
        </tr>
        <tr> 
		<?php 
        for ($i = 1; $i <= 7; $i++) {
            ?>
          <td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		<?php 
        }
        ?>
          
        </tr>
        <tr> 
        <?php 
        for ($i = 8; $i <= 14; $i++) {
            ?>
          <td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		<?php 
        }
        ?>
 
        </tr>
        <tr> 
        <?php 
        for ($i = 15; $i <= 21; $i++) {
            ?>
          <td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		<?php 
        }
        ?>
 
        </tr>
        <tr> 
        <?php 
        for ($i = 22; $i <= 28; $i++) {
            ?>
          <td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		<?php 
        }
        ?>
 
        </tr>
        <tr>
          <td class="<?php 
        if ($anzahlTage >= 29) {
            echo getStatusString($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 29) {
            printRes($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="<?php 
        if ($anzahlTage >= 30) {
            echo getStatusString($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 30) {
            printRes($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="<?php 
        if ($anzahlTage >= 31) {
            echo getStatusString($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 31) {
            printRes($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
        </tr>
		<tr>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
        </tr>
      </table><?php 
    } elseif ($firstDay == "Tue") {
        ?>
<table width="100%" border="0" class="tableColor">
        <tr> 
          <td colspan="7" class="standardSchriftBold"><?php 
        echo getUebersetzung(parseMonthName($month), $sprache, $link) . " " . $year;
        ?>
</td>
        </tr>
        <tr> 
          <td class="tableColor"><?php 
        echo $MO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $MI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $FR;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SA;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SO;
        ?>
</td>
        </tr>
        <tr> 
          <td class="tableColor">&nbsp;</td>
          <?php 
        for ($i = 1; $i <= 6; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 7; $i <= 13; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 14; $i <= 20; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 21; $i <= 27; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr>
          <td class="<?php 
        echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
        ?>
"><?php 
        printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
        ?>
</td>
          <td class="<?php 
        if ($anzahlTage >= 29) {
            echo getStatusString($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 29) {
            printRes($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="<?php 
        if ($anzahlTage >= 30) {
            echo getStatusString($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 30) {
            printRes($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="<?php 
        if ($anzahlTage >= 31) {
            echo getStatusString($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 31) {
            printRes($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
        </tr>
		<tr>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
        </tr>
      </table><?php 
    } elseif ($firstDay == "Wed") {
        ?>
<table width="100%" border="0" class="tableColor">
        <tr> 
          <td colspan="7" class="standardSchriftBold"><?php 
        echo getUebersetzung(parseMonthName($month), $sprache, $link) . " " . $year;
        ?>
</td>
        </tr>
        <tr> 
          <td class="tableColor"><?php 
        echo $MO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $MI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $FR;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SA;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SO;
        ?>
</td>
        </tr>
        <tr> 
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <?php 
        for ($i = 1; $i <= 5; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 6; $i <= 12; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 13; $i <= 19; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 20; $i <= 26; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr>
          <?php 
        for ($i = 27; $i <= 28; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
          
          <td class="<?php 
        if ($anzahlTage >= 29) {
            echo getStatusString($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 29) {
            printRes($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="<?php 
        if ($anzahlTage >= 30) {
            echo getStatusString($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 30) {
            printRes($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="<?php 
        if ($anzahlTage >= 31) {
            echo getStatusString($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 31) {
            printRes($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
        </tr>
		<tr>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
        </tr>
      </table><?php 
    } elseif ($firstDay == "Thu") {
        ?>
<table width="100%" border="0" class="tableColor">
        <tr> 
          <td colspan="7" class="standardSchriftBold"><?php 
        echo getUebersetzung(parseMonthName($month), $sprache, $link) . " " . $year;
        ?>
</td>
        </tr>
        <tr> 
          <td class="tableColor"><?php 
        echo $MO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $MI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $FR;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SA;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SO;
        ?>
</td>
        </tr>
        <tr> 
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
		  <td class="tableColor">&nbsp;</td>
          <?php 
        for ($i = 1; $i <= 4; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 5; $i <= 11; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 12; $i <= 18; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 19; $i <= 25; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr>
          <?php 
        for ($i = 26; $i <= 28; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
          
          <td class="<?php 
        if ($anzahlTage >= 29) {
            echo getStatusString($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 29) {
            printRes($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="<?php 
        if ($anzahlTage >= 30) {
            echo getStatusString($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 30) {
            printRes($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="<?php 
        if ($anzahlTage >= 31) {
            echo getStatusString($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 31) {
            printRes($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="tableColor">&nbsp;</td>          
        </tr>
		<tr>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
        </tr>
      </table><?php 
    } elseif ($firstDay == "Fri") {
        ?>
<table width="100%" border="0" class="tableColor">
        <tr> 
          <td colspan="7" class="standardSchriftBold"><?php 
        echo getUebersetzung(parseMonthName($month), $sprache, $link) . " " . $year;
        ?>
</td>
        </tr>
        <tr> 
          <td class="tableColor"><?php 
        echo $MO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $MI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $FR;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SA;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SO;
        ?>
</td>
        </tr>
        <tr> 
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
		  <td class="tableColor">&nbsp;</td>
		  <td class="tableColor">&nbsp;</td>
          <?php 
        for ($i = 1; $i <= 3; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 4; $i <= 10; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 11; $i <= 17; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 18; $i <= 24; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr>
          <?php 
        for ($i = 25; $i <= 28; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
          
          <td class="<?php 
        if ($anzahlTage >= 29) {
            echo getStatusString($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 29) {
            printRes($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="<?php 
        if ($anzahlTage >= 30) {
            echo getStatusString($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 30) {
            printRes($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="<?php 
        if ($anzahlTage >= 31) {
            echo getStatusString($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 31) {
            printRes($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
         </tr>
		 <tr>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
        </tr>
      </table><?php 
    } elseif ($firstDay == "Sat") {
        ?>
<table width="100%" border="0" class="tableColor">
        <tr> 
          <td colspan="7" class="standardSchriftBold"><?php 
        echo getUebersetzung(parseMonthName($month), $sprache, $link) . " " . $year;
        ?>
</td>
        </tr>
        <tr> 
          <td class="tableColor"><?php 
        echo $MO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $MI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $FR;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SA;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SO;
        ?>
</td>
        </tr>
        <tr> 
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
		  <td class="tableColor">&nbsp;</td>
		  <td class="tableColor">&nbsp;</td>
		  <td class="tableColor">&nbsp;</td>
          <?php 
        for ($i = 1; $i <= 2; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 3; $i <= 9; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 10; $i <= 16; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 17; $i <= 23; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr>
          <?php 
        for ($i = 24; $i <= 28; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
          
          <td class="<?php 
        if ($anzahlTage >= 29) {
            echo getStatusString($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 29) {
            printRes($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="<?php 
        if ($anzahlTage >= 30) {
            echo getStatusString($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 30) {
            printRes($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
         </tr>
		 <tr>
          <td class="<?php 
        if ($anzahlTage >= 31) {
            echo getStatusString($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 31) {
            printRes($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
        </tr>
      </table><?php 
    } elseif ($firstDay == "Sun") {
        ?>
<table width="100%" border="0" class="tableColor">
        <tr> 
          <td colspan="7" class="standardSchriftBold"><?php 
        echo getUebersetzung(parseMonthName($month), $sprache, $link) . " " . $year;
        ?>
</td>
        </tr>
       <tr> 
          <td class="tableColor"><?php 
        echo $MO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $MI;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $DO;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $FR;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SA;
        ?>
</td>
          <td class="tableColor"><?php 
        echo $SO;
        ?>
</td>
        </tr>
        <tr> 
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
		  <td class="tableColor">&nbsp;</td>
		  <td class="tableColor">&nbsp;</td>
		  <td class="tableColor">&nbsp;</td>
		  <td class="tableColor">&nbsp;</td>          
          <td class="<?php 
        echo getStatusString($zimmer_id, 1, $month, $year, $saAktiviert, $link);
        ?>
"><?php 
        printRes($zimmer_id, 1, $month, $year, $saAktiviert, $link);
        ?>
</td>
        </tr>
        <tr> 
          <?php 
        for ($i = 2; $i <= 8; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 9; $i <= 15; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr> 
          <?php 
        for ($i = 16; $i <= 22; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
        </tr>
        <tr>
          <?php 
        for ($i = 23; $i <= 28; $i++) {
            ?>
          	<td class="<?php 
            echo getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
"><?php 
            printRes($zimmer_id, $i, $month, $year, $saAktiviert, $link);
            ?>
</td>
		  <?php 
        }
        ?>
          
          <td class="<?php 
        if ($anzahlTage >= 29) {
            echo getStatusString($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 29) {
            printRes($zimmer_id, 29, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
         </tr>
		 <tr>
		  <td class="<?php 
        if ($anzahlTage >= 30) {
            echo getStatusString($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 30) {
            printRes($zimmer_id, 30, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
          <td class="<?php 
        if ($anzahlTage >= 31) {
            echo getStatusString($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "tableColor";
        }
        ?>
"><?php 
        if ($anzahlTage >= 31) {
            printRes($zimmer_id, 31, $month, $year, $saAktiviert, $link);
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
		  <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
          <td class="tableColor">&nbsp;</td>
		 </tr>
		</table><?php 
    }
    //ende if sonntag
}
Esempio n. 4
0
/**
 * Parse a log file and return statistics about it
 *
 * @param string $logFile The path to the log file
 * @return array|false An array of the statistics generated
 */
function parseLogFile($logFile)
{
    $handle = fopen($logFile, 'r');
    if (!$handle) {
        return false;
    }
    // 1. The total number of file requests in the month.
    $totalRequests = 0;
    // 2. The number of file requests from the articles directory.
    $articleRequests = 0;
    // 3. The TOTAL bandwidth consumed by the file requests over the month.
    $totalBandwidth = 0;
    // 4. The number of requests that resulted in 404 status errors.
    $totalNotFound = 0;
    // 4. Display a list of the filenames that produced these 404 errors
    $filesNotFound = array();
    while (feof($handle) === false) {
        $line = fgets($handle);
        if (strlen($line) === 0) {
            continue;
        }
        $filename = parseFilename($line);
        $statusCode = parseStatusCode($line);
        $bandwidth = parseBandwidth($line);
        if ($statusCode == 404) {
            $totalNotFound++;
            $filesNotFound[] = $filename;
        }
        if (strpos($filename, 'articles/') === 0) {
            $articleRequests += 1;
        }
        $totalBandwidth += $bandwidth;
        $totalRequests++;
    }
    fclose($handle);
    // 4. (try not to repeat filenames if the same wrong filename was requested more than once)
    $filesNotFound = array_unique($filesNotFound);
    return array('month' => parseMonthName($logFile), 'totalRequests' => $totalRequests, 'articleRequests' => $articleRequests, 'totalBandwidth' => $totalBandwidth, 'totalNotFound' => $totalNotFound, 'filesNotFound' => $filesNotFound);
}
/**
* author:coster
* date: 30. 01.06
* durchlaufe die monate und zeige status
*/
function showYear($month, $year, $vermieter_id, $mietobjekt_id)
{
    global $root;
    include_once $root . "/include/datumFunctions.inc.php";
    ?>
		<table border="0" cellspacing="0" cellpadding="0" class="<?php 
    echo TABLE_COLOR;
    ?>
">
		<?php 
    for ($month = 1; $month <= 12; $month++) {
        ?>
		  <tr>
			<td><?php 
        echo getUebersetzung(parseMonthName($month));
        ?>
</td>
			<?php 
        for ($i = 1; $i <= getNumberOfDaysOfMonth($month, $year); $i++) {
            $fullDayBooked = isFullDayBooked($mietobjekt_id, $i, $month, $year);
            $fullDayFree = isFullDayFree($mietobjekt_id, $i, $month, $year);
            ?>
			<td <?php 
            if ($fullDayBooked === true) {
                ?>
 
						class="<?php 
                echo BELEGT;
                ?>
"<?php 
            } else {
                if ($fullDayFree === true) {
                    ?>
						class="<?php 
                    echo FREI;
                    ?>
"
					<?php 
                }
            }
            ?>
>
						<?php 
            if ($fullDayBooked === false && $fullDayFree === false) {
                $j = $i + 1;
                $jM = $month;
                $jY = $year;
                if ($j > getNumberOfDaysOfMonth($month, $year)) {
                    $j = 1;
                    $jM++;
                }
                if ($jM > 12) {
                    $jM = 1;
                    $jY++;
                }
                $l = $i - 1;
                $lM = $month;
                $lY = $year;
                if ($l < 1) {
                    $l = 1;
                    $lM--;
                }
                if ($lM < 1) {
                    $lM = 1;
                    $lY--;
                }
                //wenn der vorherige tag voll gebucht ist:
                if (isFullDayBooked($mietobjekt_id, $j, $jM, $jY) === true) {
                    ?>
					
						  <table cellpadding="0" cellspacing="0" border="0">
						    <tr>
						    	<td  class="<?php 
                    echo FREI;
                    ?>
">&nbsp;</td>
							    <td  class="<?php 
                    echo BELEGT;
                    ?>
"><?php 
                    echo $i;
                    ?>
</td>
						    </tr>
						  </table>
						<?php 
                } else {
                    if (isFullDayBooked($mietobjekt_id, $l, $lM, $lY) === true) {
                        ?>
						  <table cellpadding="0" cellspacing="0" border="0">
						    <tr>
						    	<td  class="<?php 
                        echo BELEGT;
                        ?>
"><?php 
                        echo $i;
                        ?>
</td>
						    	<td  class="<?php 
                        echo FREI;
                        ?>
">&nbsp;</td>
						    </tr>
						  </table>				  
						<?php 
                    } else {
                        ?>
						  <table cellpadding="0" cellspacing="0" border="0">
						    <tr>
						    	<td  class="<?php 
                        echo FREI;
                        ?>
">&nbsp;</td>
						    	<td  class="<?php 
                        echo BELEGT;
                        ?>
"><?php 
                        echo $i;
                        ?>
</td>
						    	<td  class="<?php 
                        echo FREI;
                        ?>
">&nbsp;</td>
						    </tr>
						  </table>	
						<?php 
                    }
                }
            } else {
                if ($i < 10) {
                    $m = "&nbsp;" . $i;
                } else {
                    $m = $i;
                }
                //anzeige des tages:
                echo $m;
            }
            ?>
			</td>
			<?php 
        }
        //ende zeige tage
        ?>
			<?php 
        //zeige restlichen tage auf 31 tage als leeres feld:
        for ($i = getNumberOfDaysOfMonth($month, $year); $i <= 31; $i++) {
            ?>
				<td>&nbsp;</td>
			<?php 
        }
        ?>
		  </tr>
		  <?php 
    }
    //ende zeige monate
    ?>
		</table>
		
<?php 
}