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 
}
 $response .= "<div class=\"row\">";
 $response .= "<div class=\"col-sm-1\">";
 $response .= "<label class=\"control-label\">";
 $response .= getUebersetzung(getDayName($i, $month, $year), $sprache, $link);
 $response .= "</label>";
 $response .= "</div>";
 $response .= "<div class=\"col-sm-1 ";
 $response .= $statusString;
 $response .= "\">";
 $response .= "<label class=\"control-label\">";
 $response .= printResAdminAJAX($zimmer_id, $i, $month, $year, $saAktiviert, $link, $unterkunft_id);
 $response .= "</label>";
 $response .= "</div>";
 $response .= "<div class=\"col-sm-3\">";
 if ($statusString != "frei") {
     $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: