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);
    }
}
"><?php 
    if ($status == 0) {
        echo getUebersetzung("frei", $sprache, $link);
    } elseif ($status == 1) {
        echo getUebersetzung("reserviert", $sprache, $link);
    } else {
        echo getUebersetzung("belegt", $sprache, $link);
    }
    ?>
</span>
                    <br>
                    <?php 
    echo getUebersetzung("Gast", $sprache, $link);
    ?>
                    :<?php 
    echo getGuestNachname($gast_id, $link);
    ?>
                </div>
            </div>

            <form action="../ansichtWaehlen.php" method="post" name="form1" target="_self" class="form-horizontal">
                <div class="form-group">
                    <div class="col-sm-offset-10 col-sm-2" style="text-align: right;">
                        <input name="monat" type="hidden" id="monat" value="<?php 
    echo $vonMonat;
    ?>
">
                        <input name="jahr" type="hidden" id="jahr" value="<?php 
    echo $vonJahr;
    ?>
">
        <?php 
    echo getUebersetzung("bis", $sprache, $link);
    ?>
 <?php 
    echo $bisDatum;
    ?>
<br/>
        <?php 
    echo getUebersetzung("wurde erfolgreich entfernt", $sprache, $link);
    ?>
.</p>

      <?php 
    if ($antwort == "true") {
        $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";
        ?>
      <p><?php 
        echo getUebersetzung("Die folgende Mitteilung wird per E-Mail an Ihren Gast gesendet. Sie haben hier die Möglichkeiten noch Korrekturen vorzunehmen", $sprache, $link);
        ?>
:</p>
      <form action="./bestaetigungSenden.php" method="post" name="bestaetigungSenden" target="_self">
        <input name="an" type="hidden" value="<?php 
        echo $an;
Ejemplo n.º 4
0
//e-mail-adresse aus datenbank holen:
$query = "select Email from Rezervi_Unterkunft where PK_ID = '{$unterkunft_id}'";
$res = mysqli_query($link, $query);
if (!$res) {
    echo "Anfrage {$query} scheitert.";
}
$d = mysqli_fetch_array($res);
$mailVermieter = $d["Email"];
$an = $mailVermieter;
//mail absenden:
//mail($an, unhtmlentities($subject), unhtmlentities($message), "From: $von\nReply-To: $von\nX-Mailer: PHP/" . phpversion());
sendMail($von, $an, $subject, $message);
//bestaetigung an gast auch senden?
$art = "anfrage";
if (isMessageActive($unterkunft_id, $art, $link)) {
    $gastName = getGuestNachname($gastID, $link);
    $an = getGuestEmail($gastID, $link);
    $von = getUnterkunftEmail($unterkunft_id, $link);
    $subject = getUebersetzungUnterkunft(getMessageSubject($unterkunft_id, $art, $link), $sprache, $unterkunft_id, $link);
    $anrede = getUebersetzungUnterkunft(getMessageAnrede($unterkunft_id, $art, $link), $sprache, $unterkunft_id, $link);
    $message = $anrede . " " . $gastName . "!\n\n";
    $body = getUebersetzungUnterkunft(getMessageBody($unterkunft_id, $art, $link), $sprache, $unterkunft_id, $link);
    $message .= $body . "\n\n";
    $unterschrift = getUebersetzungUnterkunft(getMessageUnterschrift($unterkunft_id, $art, $link), $sprache, $unterkunft_id, $link);
    $message .= $unterschrift;
    //mail absenden:
    //mail($an, unhtmlentities($subject), unhtmlentities($message), "From: $von\nReply-To: $von\nX-Mailer: PHP/" . phpversion());
    sendMail($von, $an, $subject, $message);
    //soll eine kopie an den vermieter gesendet werden:
    if (getPropertyValue(MAIL_KOPIE_AN_VERMIETER_ANFRAGE, $unterkunft_id, $link) == "true") {
        $message = getUebersetzung("Folgende Nachricht wurde an ihren Gast versendet", $sprache, $link) . ":\n\n" . $message;
function showMonth($month, $year, $unterkunft_id, $zimmer_id, $sprache, $saAktiviert, $link)
{
    //anzahl der tage des monats:
    $anzahlTage = getNumberOfDays($month, $year);
    ?>

    <?php 
    for ($i = 1; $i <= $anzahlTage; $i++) {
        $res_id = getReservierungID($zimmer_id, $i, $month, $year, $link);
        $statusString = getStatusString($zimmer_id, $i, $month, $year, $saAktiviert, $link);
        $gast_id = -1;
        ?>
        <div class="row">
            <!-- wochentag anzeigen -->
            <div class="col-sm-1">
                <label class="control-label">
                    <?php 
        echo getUebersetzung(getDayName($i, $month, $year), $sprache, $link);
        ?>
                </label>
            </div>
            <!-- datum anzeigen -->
            <div class="col-sm-1 <?php 
        echo $statusString;
        ?>
">
                <label class="control-label">
                    <?php 
        printResAdmin($zimmer_id, $i, $month, $year, $saAktiviert, $link);
        ?>
                </label>
            </div>
            <!-- gast anzeigen -->
            <div class="col-sm-3">
                <?php 
        if ($statusString != "frei") {
            ?>
                    <?php 
            //gast-id auslesen:
            //$gast_id = getReservierungGastID($zimmer_id,$i,$month,$year,$link);
            $gast_ids = getReservierungGastIDs($zimmer_id, $i, $month, $year, $link);
            while ($h = mysqli_fetch_array($gast_ids)) {
                $gast_id = $h["FK_Gast_ID"];
                //if child rooms available, check also childs:
                if (($gast_id == 1 || empty($gast_id)) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true" && hasChildRooms($zimmer_id)) {
                    //if room is a parent, check if the child has another status:
                    $childs = getChildRooms($zimmer_id);
                    while ($c = mysqli_fetch_array($childs)) {
                        $child_zi_id = $c['PK_ID'];
                        $gast_id = getReservierungGastID($child_zi_id, $i, $month, $year, $link);
                        if ($gast_id != 1 && $gast_id != "") {
                            break;
                        }
                    }
                }
                //gast-namen ausgeben:
                if ($gast_id != 1 && $gast_id != "") {
                    ?>
                            <a href="./gastInfo/index.php?gast_id=<?php 
                    echo $gast_id;
                    ?>
&zimmer_id=<?php 
                    echo $zimmer_id;
                    ?>
&jahr=<?php 
                    echo $year;
                    ?>
&monat=<?php 
                    echo $month;
                    ?>
">
                            <?php 
                    echo getGuestNachname($gast_id, $link);
                    ?>
                            </a>
                            <?php 
                    echo ", ";
                    echo getGuestOrt($gast_id, $link);
                    echo ", EW " . getErwachsene($res_id, $link) . ", K " . getKinder($res_id, $link) . ", " . getPension($res_id, $link);
                } else {
                    if ($gast_id == "") {
                    } else {
                        echo getUebersetzung("anonymer Gast", $sprache, $link);
                    }
                }
            }
            //ende while gast ids
        } else {
            echo "&nbsp;";
        }
        ?>
            </div>
        </div>
    <?php 
    }
    //ende for
    ?>
    <?php 
}
Ejemplo n.º 6
0
            foreach ($idArray as $idTaken) {
                if ($idTaken == $reservierungs_id) {
                    continue 2;
                }
            }
            $reservierungen = "" . $reservierungs_id;
            ?>
                    </p>
                    <table border="0" cellspacing="0" cellpadding="0" class="table">
                        <tr>
                            <td><span
                                    class="standardSchriftBold"><?php 
            echo getUebersetzung("Anfrage von", $sprache, $link);
            ?>
                                    :</span> <?php 
            echo getGuestVorname($gast_id, $link) . " " . getGuestNachname($gast_id, $link);
            ?>
                            </td>
                        </tr>
                        <tr>
                            <td><span
                                    class="standardSchriftBold"><?php 
            echo getUebersetzung("Zeitraum", $sprache, $link);
            ?>
                                    :</span> von <?php 
            echo getDatumVon($reservierungs_id, $link);
            ?>
                                bis <?php 
            echo getDatumBis($reservierungs_id, $link);
            ?>
</td>
         //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 != "") {
             $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>";