function sendMessage($gast_id, $art)
{
    global $link;
    global $unterkunft_id;
    global $root;
    global $sprache;
    include_once $root . "/include/gastFunctions.php";
    include_once $root . "/include/propertiesFunctions.php";
    include_once $root . "/include/mail.inc.php";
    include_once $root . "/include/uebersetzer.php";
    include_once $root . "/include/unterkunftFunctions.php";
    $speech = getGuestSprache($gast_id, $link);
    $gastName = getGuestNachname($gast_id, $link);
    $an = getGuestEmail($gast_id, $link);
    $von = getUnterkunftEmail($unterkunft_id, $link);
    $subject = getUebersetzungUnterkunft(getMessageSubject($unterkunft_id, $art, $link), $speech, $unterkunft_id, $link);
    $anr = getUebersetzungUnterkunft(getMessageAnrede($unterkunft_id, $art, $link), $speech, $unterkunft_id, $link);
    $message = $anr . " " . $gastName . "!\n\n";
    $bod = getUebersetzungUnterkunft(getMessageBody($unterkunft_id, $art, $link), $speech, $unterkunft_id, $link);
    $message .= $bod . "\n\n";
    $unt = getUebersetzungUnterkunft(getMessageUnterschrift($unterkunft_id, $art, $link), $speech, $unterkunft_id, $link);
    $message .= $unt;
    //mail absenden:
    sendMail($von, $an, $subject, $message);
    if (getPropertyValue(MAIL_KOPIE_AN_VERMIETER_ABLEHNUNG, $unterkunft_id, $link) == "true") {
        $message = getUebersetzung("Folgende Nachricht wurde an ihren Gast versendet", $sprache, $link) . ":\n\n" . $message;
        sendMail($von, $von, $subject, $message);
    }
}
Esempio n. 2
0
function getProperties()
{
    $file = fopen("Restricted/connexion.properties", "r");
    $properties["host"] = getPropertyValue(fgets($file));
    $properties["user"] = getPropertyValue(fgets($file));
    $properties["password"] = getPropertyValue(fgets($file));
    $properties["bdname"] = getPropertyValue(fgets($file));
    return $properties;
}
    if (!$res) {
        echo "Anfrage {$query} scheitert.";
    }
    $d = mysqli_fetch_array($res);
    $zimmer_id = $d["PK_ID"];
}
//falls kein jahr ausgewählt wurde, das aktuelle jahr verwenden:
if (!isset($jahr) || $jahr == "" || empty($jahr)) {
    $jahr = getTodayYear();
}
//falls kein monat ausgewählt wurde, das aktuelle monat verwenden:
if (!isset($monat) || $monat == "" || empty($monat)) {
    $monat = getTodayMonth();
}
//should the reservation state be shown?
$showReservation = getPropertyValue(SHOW_RESERVATION_STATE, $unterkunft_id, $link);
if ($showReservation != "true") {
    $showReservation = false;
}
?>
<div class="panel panel-default">
  <div class="panel-body">
  	
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Rezervi</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<?php 
include_once $root . "/templates/stylesheetsIE9.php";
$anzahlZimmer = $_POST["anzahlZimmer"];
$anzahlErwachsene = $_POST["anzahlErwachsene"];
if (isset($_POST["anzahlKinder"]) && $_POST["anzahlKinder"] > 0) {
    $anzahlKinder = $_POST["anzahlKinder"];
} else {
    $anzahlKinder = false;
}
if (isset($_POST["haustiere"]) && $_POST["haustiere"] > 0) {
    $haustiere = $_POST["haustiere"];
} else {
    $haustiere = false;
}
$zimmer_id = getSessionWert(ZIMMER_ID);
$zi_ids = $zimmer_id;
$anzahlTage = numberOfDays($vonMonat, $vonTag, $vonJahr, $bisMonat, $bisTag, $bisJahr);
if (hasParentRooms($unterkunft_id) && getPropertyValue(SEARCH_SHOW_PARENT_ROOM, $unterkunft_id, $link) == "true") {
    $parentsRes = getParentRooms();
    $zimmerIdsParents = array();
    while ($p = mysqli_fetch_array($parentsRes)) {
        $i = $p["PK_ID"];
        if ($_POST['parent_room_' . $i] && $_POST['parent_room_' . $i] == "true") {
            $zimmerIdsParents[] = $i;
        }
        //end if post parent room
    }
    //end while parent rooms
    if (count($zimmerIdsParents) > 0) {
        $zi_ids = $zimmerIdsParents;
    }
}
//end if has parent rooms
//datenbank oeffnen:
include_once "./conf/rdbmsConfig.php";
//funktions einbinden:
include_once "./include/unterkunftFunctions.php";
include_once "./include/zimmerFunctions.php";
include_once "./include/datumFunctions.php";
include_once "./include/reservierungFunctions.php";
include_once "./include/gastFunctions.php";
include_once "./include/benutzerFunctions.php";
include_once "./include/uebersetzer.php";
include_once "./include/propertiesFunctions.php";
//hilfsfunktionen einbinden:
include_once "./gesamtuebersichtHelper.php";
include_once $root . "/include/zimmerAttributes.inc.php";
include_once $root . "/leftHelper.php";
$saAktiviert = getPropertyValue(SHOW_OTHER_COLOR_FOR_SA, $unterkunft_id, $link);
$zimmer_id = getFirstRoom($unterkunft_id, $link);
//falls kein jahr ausgewählt wurde, das aktuelle jahr verwenden:
if ($jahr == false) {
    $jahr = getTodayYear();
    //ich brauche für jahr einen integer:
    $jahr += 1;
    $jahr -= 1;
}
//falls kein monat ausgewählt wurde, das aktuelle monat verwenden:
if ($monat == false) {
    $monat = parseMonthNumber(getTodayMonth());
}
//und fürs monat einen integer
$monat -= 1;
$monat += 1;
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;
}
                        <input name="ownMail" type="checkbox" id="ownMail" value=""
                            <?php 
                if (getPropertyValue(MAIL_KOPIE_AN_VERMIETER_ABLEHNUNG, $unterkunft_id, $link) == "true") {
                    echo "checked=\"checked\"";
                }
                ?>
>
                        <?php 
            } else {
                if ($art == "anfrage") {
                    ?>

                        <input name="ownMail" type="checkbox" id="ownMail" value=""
                               value="true" <?php 
                    if (getPropertyValue(MAIL_KOPIE_AN_VERMIETER_ANFRAGE, $unterkunft_id, $link) == "true") {
                        echo "checked=\"checked\"";
                    }
                    ?>
>
                        <?php 
                }
            }
        }
        ?>
                    <script>
                        $(function () {
                            $('#ownMail').bootstrapToggle({
                                on: 'Ja',
                                off: 'Nein'
                            });
	
	left.php
	Ende
	----------------------------------------------------------------------------------- -->

<?php 
// Set flag that this is a parent file
define('_JEXEC', 1);
include_once $root . "/include/sessionFunctions.inc.php";
//variablen initialisieren:
$zimmer_id = getSessionWert(ZIMMER_ID);
$sprache = getSessionWert(SPRACHE);
$unterkunft_id = getSessionWert(UNTERKUNFT_ID);
//wird der frame oben angezeigt oder links? oben => horizontal=true
$horizontal = false;
if (getPropertyValue(HORIZONTAL_FRAME, $unterkunft_id, $link) == "true") {
    $horizontal = true;
}
//falls keine zimmer_id ausgewählt wurde, das erste gefundene zimmer nehmen:
if (empty($zimmer_id)) {
    $zimmer_id = getFirstRoom($unterkunft_id, $link);
}
//falls kein jahr ausgewählt wurde, das aktuelle jahr verwenden:
if (empty($jahr)) {
    $jahr = getTodayYear();
} else {
    if (isset($_POST["jahr"])) {
        $jahr = $_POST["jahr"];
    }
}
//falls kein monat ausgewählt wurde, das aktuelle monat verwenden:
             >
             <?php 
        echo getUebersetzung($name, $sprache, $link);
        ?>

         </label>
     </li>
         <?php 
    }
    //end while-loop
    ?>
     <li  style="margin-left: 20px;">
         <label class="label-control">
             <input name="suchFilter" type="radio" value="filterUnterkunft"
                 <?php 
    if (getPropertyValue(SUCHFILTER_UNTERKUNFT, $unterkunft_id, $link) == "true") {
        echo " checked";
    }
    ?>
             >
             <?php 
    echo getUebersetzung("Suche nach Anzahl der Erwachsenen und/oder Kindern auf gesamte Unterkunft einschränken", $sprache, $link);
    ?>
         </label>
     </li>
 </ul>

    <div class="row">
        <div class="col-sm-offset-10 col-sm-2" style="text-align: right;">
            <button name="aendern" type="submit" class="btn btn-success" id="aendern">
                <span class="glyphicon glyphicon-wrench"></span>
                            value="false" <?php 
    if ($haustiere == "false") {
        echo "selected=\"selected\"";
    }
    ?>
><?php 
    echo getUebersetzung("nein", $sprache, $link);
    ?>
</option>
                    </select>
                </div>
            </div>

            <?php 
    //sollen auch noch weitere attribute angezeigt werden?
    if (getPropertyValue(SHOW_ZIMMER_ATTRIBUTE_GESAMTUEBERSICHT, $unterkunft_id, $link) == "true") {
        $res = getAttributes();
        while ($d = mysqli_fetch_array($res)) {
            $bezeichnung = $d["Bezeichnung"];
            $beschreibung = $d["Beschreibung"];
            $att_id = $d["PK_ID"];
            $wert = getAttributValue($att_id, $zimmer_id);
            ?>
                    <div class="form-group">
                        <label for="attWert_<?php 
            echo $att_id;
            ?>
" class="col-sm-7 control-label ">
                            <?php 
            echo $bezeichnung;
            ?>
Esempio n. 11
0
            ?>
                        <tr class="table">
                            <td><?php 
            echo $datumVon;
            ?>
</td>
                            <td><?php 
            echo $datumBis;
            ?>
</td>
                            <td><?php 
            echo $zimmernr;
            ?>
</td>
                            <?php 
            if (getPropertyValue(PENSION_UEBERNACHTUNG, $unterkunft_id, $link) == "true") {
                ?>
                                <td><?php 
                echo $pension;
                ?>
</td>
                                <?php 
            }
            ?>
                        </tr>
                        <?php 
        }
        //ende while
        ?>
                </table>
                <?php 
Esempio n. 12
0
 $framesizeRightBP = getFramesizeRightBP($unterkunft_id, $link);
 $framesizeLeftBPUnit = getFramesizeLeftBPUnit($unterkunft_id, $link);
 $framesizeRightBPUnit = getFramesizeRightBPUnit($unterkunft_id, $link);
 if ($framesizeLeftBPUnit == "%") {
     $framesizeLeftBP .= $framesizeLeftBPUnit;
 }
 if ($framesizeRightBPUnit == "%") {
     $framesizeRightBP .= $framesizeRigthBPUnit;
 }
 //wird der frame oben angezeigt oder links? oben => horizontal=true
 $horizontal = false;
 if (getPropertyValue(HORIZONTAL_FRAME, $unterkunft_id, $link) == "true") {
     $horizontal = true;
 }
 //prüfe ob alte reservierungen zu löschen sind:
 $xDays = getPropertyValue(RESERVATION_STATE_TIME, $unterkunft_id, $link);
 if (!empty($xDays) && $xDays > 0) {
     //sollen die gäste per mail über die löschung
     //ihrer reservierung verständigt werden?
     $ablehnungSenden = isMessageActive($unterkunft_id, AUTO_RESPONSE_ABLEHNUNG, $link);
     if (!empty($ablehnungSenden) && $ablehnungSenden == true) {
         $reserv = getReservationsBeforeXDays($xDays, STATUS_RESERVIERT);
         while ($l = mysqli_fetch_array($reserv)) {
             $reservierungsID = $l["PK_ID"];
             $gast_id = getIDFromGast($reservierungsID, $link);
             sendMessage($gast_id, AUTO_RESPONSE_ABLEHNUNG);
         }
     }
     deleteReservationsBeforeXDays($xDays, STATUS_RESERVIERT);
 }
 ?>
Esempio n. 13
0
                    }
                    if (getPropertyValue(PENSION_HALB, $unterkunft_id, $link) == "true") {
                        ?>
			  <tr class="standardSchrift">
                <td>
                  <?php 
                        echo getUebersetzung("Halbpension", $sprache, $link);
                        ?>
                </td>
			    <td>
			      <input name="zusatz" type="radio" value="Halbpension" checked="checked"/>
                </td>
              </tr>
              <?php 
                    }
                    if (getPropertyValue(PENSION_VOLL, $unterkunft_id, $link) == "true") {
                        ?>
                      
			  <tr class="standardSchrift">
                <td>
                  <?php 
                        echo getUebersetzung("Vollpension", $sprache, $link);
                        ?>
                </td>
			    <td>
			      <input name="zusatz" type="radio" value="Vollpension" checked="checked"/>
                </td>
              </tr>
			  <?php 
                    }
                    //PREIS anzeigen falls einer vorhanden ist:
</style>
<?php 
include_once "../templates/headerB.php";
include_once "../templates/bodyA.php";
//passwortprüfung:
if (checkPass($benutzername, $passwort, $unterkunft_id, $link)) {
    ?>
<table border="0" cellpadding="0" cellspacing="3">
  <tr>
    <td><p class="frei"><?php 
    echo getUebersetzung("Der Gast wurde per E-Mail verständigt", $sprache, $link);
    ?>
.</p><?php 
    //mail($an, unhtmlentities($subject), unhtmlentities($message), "From: $von\nReply-To: $von\nX-Mailer: PHP/" . phpversion());
    sendMail($von, $an, $subject, $message);
    if (getPropertyValue(MAIL_KOPIE_AN_VERMIETER_BESTAETIGUNG, $unterkunft_id, $link) == "true") {
        $message = getUebersetzung("Folgende Nachricht wurde an ihren Gast versendet", $sprache, $link) . ":\n\n" . $message;
        //mail($von, unhtmlentities($subject), unhtmlentities($message), "From: $von\nReply-To: $von\nX-Mailer: PHP/" . phpversion());
        sendMail($von, $von, $subject, $message);
    }
    //-----buttons um zurück zum menue zu gelangen:
    include_once "../templates/components.php";
    ?>
      <br/>
      <?php 
    showSubmitButtonWithForm("./index.php", getUebersetzung("zurück", $sprache, $link));
    ?>
      <br/>
      <?php 
    showSubmitButtonWithForm("../inhalt.php", getUebersetzung("Hauptmenü", $sprache, $link));
    ?>
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 
}
Esempio n. 16
0
                                    :</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 
            }
            ?>
                        <form action="./gastInfo/index.php" method="post" name="gastInfos" target="_self"
                              id="gastInfos">
                            <tr>
                                <td><input name="gast_id" type="hidden" value="<?php 
Esempio n. 17
0
        ?>
        </select>
      
      <?php 
    } else {
        ?>
      <input name="anzahlKinder" type="hidden" value="-1">
      <?php 
    }
    //echo("<td><h3>getInformationKinder() ist 'true'</h3></td>");
} else {
}
//Check which opportunities were chosen in the webinterface
//function getInformationKinder() defined in sucheFunctions.php
//if(getInformationHaustiere($unterkunft_id,$link)=='true')
if (getPropertyValue(HAUSTIERE_ALLOWED, $unterkunft_id, $link) == "true") {
    ?>
  	
  <!-- Ende Anzahl Kinder -->
  
  <!-- Haustiere -->
  </br>
  </br>  
	  <b>
        <?php 
    echo getUebersetzung("Haustiere", $sprache, $link);
    ?>
	  </b>
      
	    <input name="haustiere" type="checkbox" value="true">	
	
<?php

/**
 * Created on 31.08.2006
 *
 * @author coster
 */
//die zimmerauswahl wird nicht angezeigt, wenn nur die gesamtansicht
//angezeigt werden soll:
$showGesamtansicht = getPropertyValue(SHOW_GESAMTANSICHT, $unterkunft_id, $link);
$showSelectRooms = true;
if ($showGesamtansicht == "true") {
    $showMonatsansicht = getPropertyValue(SHOW_MONATSANSICHT, $unterkunft_id, $link);
    $showJahresansicht = getPropertyValue(SHOW_JAHRESANSICHT, $unterkunft_id, $link);
    if ($showMonatsansicht != "true" && $showJahresansicht != "true") {
        $showSelectRooms = false;
    }
}
?>

<div class="panel panel-default">
  <div class="panel-body">
  	
<h4><?php 
echo getUebersetzung("Belegungsplan für:", $sprache, $link);
?>
</h4>
<br/>
  <!-- <form action="./ansichtWaehlen.php" method="post" name="ZimmerNrForm" target="kalender"> -->
   
   <form action="./ansichtWaehlen.php" method="post" name="ZimmerNrForm" target="kalender" class="form-horizontal">
Esempio n. 19
0
    <form action="./bilderAendern.php" method="post" target="_self">
        <?php 
    $active = getPropertyValue(ZIMMER_THUMBS_ACTIV, $unterkunft_id, $link);
    if ($active != "true") {
        $active = false;
    } else {
        $active = true;
    }
    $active2 = getPropertyValue(ZIMMER_THUMBS_AV_OV, $unterkunft_id, $link);
    if ($active2 != "true") {
        $active2 = false;
    } else {
        $active2 = true;
    }
    $width = getPropertyValue(BILDER_SUCHE_WIDTH, $unterkunft_id, $link);
    $height = getPropertyValue(BILDER_SUCHE_HEIGHT, $unterkunft_id, $link);
    ?>

        <div class="row">
            <div class="col-sm-5">
                <label class="control-label">
                    <?php 
    echo getUebersetzung("Bilder bei Suchergebnissen anzeigen", $sprache, $link);
    ?>
                </label>

            </div>
            <div class="col-sm-1">
                <input name="active" type="checkbox" id="active" value="true"
                    <?php 
    if ($active) {
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
}
/**
get an array with status numbers of the given day and room 
0 = frei
1 = reserviert
2 = belegt
@param $zimmer_id the room id
@param $tag the day
@param $monat the month
@param $jahr the year
@param $link the database connection link
@return get an array with status numbers of the given day and room 
*/
function getStatus($zimmer_id, $tag, $monat, $jahr, $link)
{
    global $root;
    include_once $root . "/include/propertiesFunctions.php";
    include_once $root . "/include/reservierungFunctions.php";
    global $unterkunft_id;
    //true if reservations must be shown:
    $showReservation = false;
    $showReservationProp = getPropertyValue(SHOW_RESERVATION_STATE, $unterkunft_id, $link);
    if (!empty($showReservationProp) && $showReservationProp == "true") {
        $showReservation = true;
    }
    //generate a date for the sql query:
    if ($monat < 10 && strlen($monat) <= 1) {
        $monat = "0" . $monat;
    }
    if ($tag < 10 && strlen($tag) <= 1) {
        $tag = "0" . $tag;
    }
    $datum = $jahr . "-" . $monat . "-" . $tag;
    //get the state from the database:
    $query = "select \n\t\t\t\tStatus, PK_ID\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)\n\t\t\t\torder by\n\t\t\t\tDatum_von\n\t\t\t\t";
    $res = mysqli_query($link, $query);
    if (!$res) {
        die("Anfrage {$query} scheitert.");
    }
    //create the state array:
    $status = array();
    $ids = array();
    while ($d = mysqli_fetch_array($res)) {
        $state = $d["Status"];
        if (!$showReservation && $state == STATUS_RESERVIERT) {
            //do not show reservation state
            continue;
        }
        $status[] = $state;
        $ids[] = $d['PK_ID'];
    }
    //ende while
    //if the room has child rooms and the parent-schild relation must be shown, check if the child has the same state
    $showParentRooms = false;
    $hasChildRooms = hasChildRooms($zimmer_id);
    if (getPropertyValue(RES_HOUSE, $unterkunft_id, $link) != "true") {
        $showParentRooms = true;
    }
    if ($showParentRooms === false || $hasChildRooms === false) {
        if (count($status) == 1) {
            //check if the next day is the same reservation:
            $nTag = $tag + 1;
            $nMonat = $monat;
            $nJahr = $jahr;
            $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
            $datum = $nJahr . "-" . $nMonat . "-" . $nTag;
            //get the state from the database:
            $query = "select \n\t\t\t\t\t\tStatus, PK_ID\n\t\t\t\t\t\tfrom \n\t\t\t\t\t\tRezervi_Reservierung\n\t\t\t\t\t\twhere \t\t\n\t\t\t\t\t\tFK_Zimmer_ID = '{$zimmer_id}' and\n\t\t\t\t\t\t('{$datum}' >= Datum_von and '{$datum}' <= Datum_bis)\n\t\t\t\t\t\torder by\n\t\t\t\t\t\tDatum_von\n\t\t\t\t\t\t";
            $res = mysqli_query($link, $query);
            if (!$res) {
                die("Anfrage {$query} scheitert.");
            }
            //create the state array:
            $nstatus = array();
            $nids = array();
            while ($d = mysqli_fetch_array($res)) {
                $state = $d["Status"];
                if (!$showReservation && $state == STATUS_RESERVIERT) {
                    //do not show reservation state
                    continue;
                }
                $nstatus[] = $state;
                $nids[] = $d['PK_ID'];
            }
            //ende while
            if ($ids[0] != $nids[0]) {
                $status[] = 0;
            }
            //check if the previous day is the same reservation:
            $vTag = $tag - 1;
            $vMonat = $monat;
            $vJahr = $jahr;
            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
            $datum = $vJahr . "-" . $vMonat . "-" . $vTag;
            //get the state from the database:
            $query = "select \n\t\t\t\t\t\tStatus, PK_ID\n\t\t\t\t\t\tfrom \n\t\t\t\t\t\tRezervi_Reservierung\n\t\t\t\t\t\twhere \t\t\n\t\t\t\t\t\tFK_Zimmer_ID = '{$zimmer_id}' and\n\t\t\t\t\t\t('{$datum}' >= Datum_von and '{$datum}' <= Datum_bis)\n\t\t\t\t\t\torder by\n\t\t\t\t\t\tDatum_von\n\t\t\t\t\t\t";
            $res = mysqli_query($link, $query);
            if (!$res) {
                die("Anfrage {$query} scheitert.");
            }
            //create the state array:
            $vstatus = array();
            $vids = array();
            while ($d = mysqli_fetch_array($res)) {
                $state = $d["Status"];
                if (!$showReservation && $state == STATUS_RESERVIERT) {
                    //do not show reservation state
                    continue;
                }
                $vstatus[] = $state;
                $vids[] = $d['PK_ID'];
            }
            //ende while
            if (count($vstatus) == 1 && $ids[0] != $vids[0]) {
                $status[1] = $status[0];
                $status[0] = 0;
            }
        }
        return $status;
    }
    //the room has child rooms and the parent-child relation must be shown..
    //check if the child has the same state:
    //get all childs of the parent:
    $parentState = array(2);
    if (count($status) > 1) {
        $parentState = array(2, 2);
        //parent is occupied defaul
    }
    $childs = getChildRooms($zimmer_id);
    $childArray = array();
    //create an array with child ids:
    while ($c = mysqli_fetch_array($childs)) {
        //continue 1
        $childArray[] = $c['PK_ID'];
    }
    for ($l = 0; $l < count($parentState); $l++) {
        //continue 2
        foreach ($childArray as $child_id) {
            //continue 1
            $childStatus = getStatus($child_id, $tag, $monat, $jahr, $link);
            /*
            if ($parentState[$l] == 0){ //if parent is free, show the parent state as free
            	$status[$l] = 0;
            	continue 2;
            }
            */
            if (!isset($childStatus[$l]) || $childStatus[$l] == 0) {
                //if any child is free set the parent state free
                $status[$l] = 0;
                continue 2;
            }
            if (isset($childStatus[$l]) && $childStatus[$l] == 1) {
                //if any child is reserved set the parent reserved
                $status[$l] = 1;
                //continue 2;
            }
            if ($parentState[$l] == 1) {
                $status[$l] = 1;
                //continue 2;
            }
            $status[$l] = $parentState[$l];
        }
        //end while level 1
    }
    //end for level 2
    if ($status[0] == 0 && $status[1] == 0) {
        return null;
    }
    //var_dump($status);
    return $status;
}
/**
 * @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 
}
function getFreieZimmer($unterkunft_id, $anzahlErwachsene, $anzahlKinder, $anzahlZimmer, $haustiere, $vonTag, $vonMonat, $vonJahr, $bisTag, $bisMonat, $bisJahr, $link)
{
    //leeres array erzeugen zum speichern der freien zimmer:
    $freieZimmer = array();
    //variable zum zaehlen der erwachsenenBetten, kinderBetten, freie zimmer
    $bettenErw = 0;
    $bettenKin = 0;
    $freieZi = 0;
    //reservierungs-funktionen einbinden:
    include_once "../include/reservierungFunctions.php";
    //zimmer-funktionen hinzufügen:
    include_once "../include/zimmerFunctions.php";
    //properties hinzufügen:
    include_once "../include/propertiesFunctions.php";
    //alle zimmer der unterkunft auslesen und prüfen ob es im angegebenen zeitraum noch frei ist:
    $query = "\n\t\t\tSELECT \n\t\t\tPK_ID\t\t\n\t\t\tFROM\n\t\t\tRezervi_Zimmer\n\t\t\tWHERE\n\t\t\tFK_Unterkunft_ID = '{$unterkunft_id}'\t\n\t\t\tORDER BY\n\t\t\tZimmernr\n\t\t";
    $res = mysqli_query($link, $query);
    while ($d = mysqli_fetch_array($res)) {
        //zimmer-id holen:
        $zi_id = $d["PK_ID"];
        //wenn die suche nach erwachsenen oder kindern nach zimmern gefiltert
        //werden soll (z. b. ferienhäuser nur mit bestimmter personenanzahl):
        //dont check it if the accomodation has rooms and subrooms:
        if (!hasParentRooms($unterkunft_id)) {
            if (getPropertyValue(SUCHFILTER_ZIMMER, $unterkunft_id, $link) == "true") {
                if ($anzahlErwachsene > -1) {
                    if (getBetten($unterkunft_id, $zi_id, $link) < $anzahlErwachsene) {
                        continue;
                    }
                }
                if ($anzahlKinder > -1) {
                    if (getBettenKinder($unterkunft_id, $zi_id, $link) < $anzahlKinder) {
                        continue;
                    }
                }
            }
        }
        if (!isRoomTaken($zi_id, $vonTag, $vonMonat, $vonJahr, $bisTag, $bisMonat, $bisJahr, $link)) {
            //zimmer ist noch frei - dem array hinzufügen:
            $freieZimmer[] = $zi_id;
            $freieZi++;
            //zaehlen wie viele erwachsene und kinder platz haben:
            $bettenErw = $bettenErw + getBetten($unterkunft_id, $zi_id, $link);
            //echo("anzahlBetten insgesamt Erw =".$bettenErw."<br/>");
            $bettenKin = $bettenKin + getBettenKinder($unterkunft_id, $zi_id, $link);
            //echo("anzahlBetten insgesamt Kin =".$bettenKin."<br/>");
        }
    }
    if ($anzahlErwachsene > -1) {
        //checken ob genug betten fuer erwachsene frei sind:
        if ($anzahlErwachsene > $bettenErw) {
            //es sind nicht genug betten fuer erwachsene frei!
            $freieZimmer[0] = -1;
        }
    }
    if ($anzahlKinder > -1) {
        //wieviele betten sind noch frei wenn ich die erwachsenen reingelegt habe?
        if ($anzahlErwachsene > -1) {
            $insgesamtBettenFrei = $bettenErw + $bettenKin - $anzahlErwachsene;
        } else {
            $insgesamtBettenFrei = $bettenErw + $bettenKin;
        }
        //checken ob genug betten fuer kinder frei sind:
        if ($anzahlKinder > $insgesamtBettenFrei) {
            //echo("nicht genug betten fuer kinder!<br/>");
            $freieZimmer[0] = -2;
        }
    }
    if ($anzahlZimmer > -1) {
        //checken ob genug zimmer insgesamt frei sind:
        if ($anzahlZimmer > $freieZi) {
            $freieZimmer[0] = -3;
        }
    }
    //check if a parent-child relation exists and remove the parent if the child is not free:
    $freeRooms = array();
    if (count($freieZimmer) > 0 && hasParentRooms($unterkunft_id) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true") {
        global $root;
        include_once $root . "/include/zimmerFunctions.php";
        foreach ($freieZimmer as $freeRoom) {
            $count = 0;
            $count2 = 0;
            //is the room a parent room?
            if (hasChildRooms($freeRoom)) {
                //the room is a parent room, check if ALL the children are free rooms
                $childs = getChildRooms($freeRoom);
                while ($c = mysqli_fetch_array($childs)) {
                    $count2++;
                    for ($i = 0; $i < count($freieZimmer); $i++) {
                        if ($freieZimmer[$i] == $c['PK_ID']) {
                            $count++;
                        }
                    }
                }
                if ($count == $count2) {
                    $freeRooms[] = $freeRoom;
                }
            } else {
                $freeRooms[] = $freeRoom;
            }
        }
    } else {
        if (count($freieZimmer) > 0 && hasParentRooms($unterkunft_id) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) != "true") {
            global $root;
            include_once $root . "/include/zimmerFunctions.php";
            include_once $root . "/include/reservierungFunctions.php";
            foreach ($freieZimmer as $freeRoom) {
                $count = 0;
                $count2 = 0;
                //is the room a parent room?
                if (hasChildRooms($freeRoom)) {
                    //the room is a parent room, check if ALL the children are occupied:
                    $childs = getChildRooms($freeRoom);
                    $allOcc = true;
                    while ($c = mysqli_fetch_array($childs)) {
                        $chid = $c['PK_ID'];
                        //if the child is not occupied -> set to false!
                        $taken = isRoomTaken($chid, $vonTag, $vonMonat, $vonJahr, $bisTag, $bisMonat, $bisJahr, $link);
                        if (!$taken) {
                            $allOcc = false;
                            break;
                        }
                    }
                    if (!$allOcc) {
                        $freeRooms[] = $freeRoom;
                    }
                } else {
                    $freeRooms[] = $freeRoom;
                }
            }
        } else {
            $freeRooms = $freieZimmer;
        }
    }
    //checken ob genug zimmer insgesamt frei sind:
    if (count($freeRooms) < 1) {
        $freeRooms[0] = -3;
    }
    return $freeRooms;
}
Esempio n. 24
0
} else {
    $zimmer_id = $_POST["zimmer_id"];
}
//falls keine zimmer_id ausgewählt wurde, das erste gefundene zimmer nehmen:
if (!isset($zimmer_id) || $zimmer_id == "" || empty($zimmer_id)) {
    $zimmer_id = getFirstRoom($unterkunft_id, $link);
}
if (isset($_POST["monat"])) {
    $monat = $_POST["monat"];
}
if (isset($_POST["jahr"])) {
    $jahr = $_POST["jahr"];
}
setSessionWert(ZIMMER_ID, $zimmer_id);
$saAktiviert = getPropertyValue(SHOW_OTHER_COLOR_FOR_SA, $unterkunft_id, $link);
$showPic = getPropertyValue(ZIMMER_THUMBS_AV_OV, $unterkunft_id, $link);
if ($showPic != "true") {
    $showPic = false;
} else {
    $showPic = true;
}
//falls kein jahr ausgewählt wurde, das aktuelle jahr verwenden:
if (!isset($jahr) || $jahr == "" || empty($jahr)) {
    $jahr = getTodayYear();
}
//ich brauche für jahr einen integer:
$jahr += 1;
$jahr -= 1;
//falls kein monat ausgewählt wurde, das aktuelle monat verwenden:
if (!isset($monat) || $monat == "" || empty($monat)) {
    $monat = parseMonthNumber(getTodayMonth());
if ($bild == "") {
    $nachricht = "Bitte wählen sie ein Bild!";
    $nachricht = getUebersetzung($nachricht, $sprache, $link);
    $fehler = true;
    include_once "./bilderHochladen.php";
    exit;
}
$uploaddir = "../../upload/";
$mimeType = $_FILES['bild']['type'];
$file_save_as = uniqid("utilo_") . getFileExtension($mimeType);
//create the image from JPEG file
$img = new hft_image($_FILES['bild']['tmp_name']);
//keep X to Y ratio
//so there will be no geometrical distortions:
$bildXMax = getPropertyValue(BILDER_SUCHE_WIDTH, $unterkunft_id, $link);
$bildYMax = getPropertyValue(BILDER_SUCHE_HEIGHT, $unterkunft_id, $link);
$img->resize($bildXMax, $bildYMax, "-");
//save the resized image to file
//commented to save server load
$img->output_resized($_FILES['bild']['tmp_name']);
if (move_uploaded_file($_FILES['bild']['tmp_name'], $uploaddir . $file_save_as)) {
    chmod($uploaddir . $file_save_as, 0755);
    //file-upload war erfolgreich:
    $id = setBild($uploaddir . $file_save_as, $standardDescription, $zimmer_id, $img->image_resized_width, $img->image_resized_height, $link);
    //set descriptions in other languages:
    $spr = getSprachenForBelegungsplan($link);
    while ($s = mysqli_fetch_array($spr)) {
        $lang = $s['Sprache_ID'];
        if (isset($_POST["beschreibung_{$lang}"])) {
            $besc = $_POST["beschreibung_{$lang}"];
            if ($lang != $standardsprache && $besc != "") {
<?php

/**
 * Created on 31.08.2006
 *
 * @author coster
 */
//welche ansichten sollen gezeigt werden?
$showMonatsansicht = getPropertyValue(SHOW_MONATSANSICHT, $unterkunft_id, $link);
$showJahresansicht = getPropertyValue(SHOW_JAHRESANSICHT, $unterkunft_id, $link);
$showGesamtansicht = getPropertyValue(SHOW_GESAMTANSICHT, $unterkunft_id, $link);
$ansicht = getSessionWert(ANSICHT);
$anzahlAnsichten = 0;
if ($showMonatsansicht == "true") {
    $anzahlAnsichten++;
}
if ($showJahresansicht == "true") {
    $anzahlAnsichten++;
}
if ($showGesamtansicht == "true") {
    $anzahlAnsichten++;
}
//ansicht-auswahl nur anzeigen wenn mehr als 1 ansicht möglich ist:
if ($anzahlAnsichten > 1) {
    ?>
<div class="panel panel-default">
  <div class="panel-body">
  	
  	<h4><?php 
    echo getUebersetzung("Ansicht für", $sprache, $link);
    ?>
 public function getRowKey()
 {
     return getPropertyValue('RowKey');
 }
    echo getUebersetzung("Attribute anzeigen", $sprache, $link);
    ?>
:
                </h4>
                <div class="row">
                    <div class="col-sm-5">
                        <label class="label-control">
                            <?php 
    echo getUebersetzung("Gesamtübersicht", $sprache, $link);
    ?>
                        </label>
                    </div>
                    <div class="col-sm-5">
                        <input type="checkbox" name="showInGesamtuebersicht" value="true"
                            <?php 
    $show = getPropertyValue(SHOW_ZIMMER_ATTRIBUTE_GESAMTUEBERSICHT, $unterkunft_id, $link);
    if ($show == "true") {
        ?>
 checked="checked" <?php 
    }
    ?>
                        />
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-offset-9 col-sm-3" style="text-align: right;">
                    <input name="aendern" type="submit" id="aendern" class="btn btn-success"
                           value="<?php 
    echo getUebersetzung("speichern", $sprache, $link);
    ?>
Esempio n. 29
0
             <div class="col-sm-3">
                 <a class="btn btn-primary" href="./zimmerAnlegen.php" style="width: 100%;">
                     <span class="glyphicon glyphicon-plus-sign"  aria-hidden="true"></span>&nbsp;
                     <?php 
 echo getUebersetzung("Zimmer anlegen", $sprache, $link);
 ?>
                 </a>
             </div>
         </div>
     <div class="row">
         <hr>
     </div>
     <?php 
 //hochladen von bildern, falls dies aktiviert wurde
 $active = getPropertyValue(ZIMMER_THUMBS_ACTIV, $unterkunft_id, $link);
 $active2 = getPropertyValue(ZIMMER_THUMBS_AV_OV, $unterkunft_id, $link);
 if ($active != "true") {
     $active = false;
 } else {
     $active = true;
 }
 if ($active2 != "true") {
     $active2 = false;
 } else {
     $active2 = true;
 }
 if ($active || $active2) {
     ?>
         <form action="./bilderHochladen.php" method="post" name="bilder" id="bilder" target="_self" class="form-horizontal">
             <div class="row">
                 <div class="col-sm-9">