Пример #1
0
                        <tr>
                            <td><span
                                    class="standardSchriftBold"><?php 
            echo getUebersetzung("Personen", $sprache, $link);
            ?>
                                    :</span> <?php 
            echo getUebersetzung("Erwachsene", $sprache, $link);
            ?>
                                :<?php 
            echo getErwachsene($reservierungs_id, $link);
            ?>
 <?php 
            echo getUebersetzung("Kinder", $sprache, $link);
            ?>
                                : <?php 
            echo getKinder($reservierungs_id, $link);
            ?>
</td>
                        </tr>
                        <?php 
            if (getPropertyValue(PENSION_FRUEHSTUECK, $unterkunft_id, $link) == "true" || getPropertyValue(PENSION_UEBERNACHTUNG, $unterkunft_id, $link) == "true" || getPropertyValue(PENSION_VOLL, $unterkunft_id, $link) == "true" || getPropertyValue(PENSION_HALB, $unterkunft_id, $link) == "true") {
                ?>
                            <tr>
                                <td><span
                                        class="standardSchriftBold">Pension: </span><?php 
                echo getPension($reservierungs_id, $link);
                ?>
                                </td>
                            </tr>
                            <?php 
            }
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 
}
                $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 != "") {
                $response .= '<a href="./gastInfo/index.php?gast_id=' . $gast_id . '&zimmer_id=' . $zimmer_id . '&jahr=' . $year . '&monat=' . $month . '">';
                $response .= getGuestNachname($gast_id, $link);
                $response .= "</a>, ";
                $response .= getGuestOrt($gast_id, $link);
                $response .= ", EW " . getErwachsene($res_id, $link) . ", K " . getKinder($res_id, $link) . ", " . getPension($res_id, $link);
            } else {
                if ($gast_id == "") {
                    $response .= ":(";
                } else {
                    $response .= getUebersetzung("anonymer Gast", $sprache, $link);
                }
            }
        }
    } else {
        $response .= "&nbsp;";
    }
    $response .= "</div>";
    $response .= "</div>";
}
//ende for