Пример #1
0
function buchungsmail()
{
    // mehrere Empfänger
    $mail = $_SESSION["username"];
    $flug = getFlughafenIDByFlugID($_SESSION["hinflug"]["flug"]);
    $flug2 = getFlughafenIDByFlugID($_SESSION["rueckflug"]["flug"]);
    $hotel = getHotelAdresseByZimmerID($_SESSION["hotel"]);
    $auto = getAutoDatenByAutoID($_SESSION["auto"]);
    $betreff = 'WÜ-Travel Buchungsbestätigung';
    $nachricht = "\n\t\t\t\t<html>\n\t\t\t\t<head>\n\t\t\t\t  <title>Buchungsbestätigung</title>\n\t\t\t\t  <style>\n\t\t\t\t  p {color:grey;}\n\t\t\t\t  </style>\n\t\t\t\t</head>\n\t\t\t\t<body>\n\t\t\t\t<a style='text-decoration:none;' href='http://swp.rereadgames.de/design2/index.php'><div style='margin-left:100px;width:600px;display:block;'><img src='http://swp.rereadgames.de/design2/images/wuetravel.png' style='width:100px;height:100px;margin-left:100px;'>\n\t\t\t<div style='font-family: arial;font-size: 45pt;color:grey;display:block;float:right;margin-top:15px;'>WÜ-TRAVEL</div></div></a>\n\t\t\t\t  <p style='text-align:center;font-size: 30pt;margin-top:100px;'>Herzlichen Glückwunsch</p>\n\t\t\t\t  <p style='text-align:center;font-size: 30pt;margin-top:20px;'>Sie haben erfolgreich Ihre Reise gebucht!</p>\n\t\t\t\t  <div style='border: 2px solid grey;border-radius:10px;padding-top:10px;padding-bottom:10px;width:48%;float:left;'>\n\t\t\t\t  <p style='text-align:center;margin-top:30px;font-size:20pt;'>Hinflug " . $_SESSION["hinflug"]["flug"] . " - " . $flug[0] . "-->" . $flug[1] . "</p>\n\t\t\t\t  <p style='text-align:center;margin-top:10px;'>Sitzplätze: ";
    foreach ($_SESSION["hinflug"]["plaetze"] as &$platz) {
        $nachricht .= " {$platz['0']}   ";
    }
    $nachricht .= "</p></div>";
    $nachricht .= "\n\t\t\t\t<div style='border: 2px solid grey;border-radius:10px;padding-top:10px;padding-bottom:10px;width:48%;float:right;'>\n\t\t\t\t<p style='text-align:center;margin-top:30px;font-size:20pt;'>Rückflug " . $_SESSION["rueckflug"]["flug"] . " - " . $flug2[0] . "-->" . $flug2[1] . "</p>\n\t\t\t\t<p style='text-align:center;margin-top:10px;'>Sitzplätze: ";
    foreach ($_SESSION["rueckflug"]["plaetze"] as &$platz) {
        $nachricht .= "{$platz['0']}   ";
    }
    $nachricht .= "</p></div>";
    $nachricht .= "\n\t\t\t\t<div style='clear:both';></div>\n\t\t\t\t<div style='border: 2px solid grey;border-radius:10px;padding-top:10px;padding-bottom:10px;margin-top:20px;width:48%;float:left;'>\n\t\t\t\t<p style='text-align:center;margin-top:10px;font-size:20pt;'>Hotel " . $hotel[0] . "</p>\n\t\t\t\t<p style='text-align:center;margin-top:10px;font-size:16pt;'>" . $hotel[1] . ", " . $hotel[2] . " </p>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div style='border: 2px solid grey;border-radius:10px;padding-top:10px;padding-bottom:10px;margin-top:20px;width:48%;float:right;'>\n\t\t\t\t<p style='text-align:center;margin-top:10px;font-size:20pt;'>" . $auto[0] . " " . $auto[1] . "</p>\n\t\t\t\t<p style='text-align:center;margin-top:10px;font-size:16pt;'>" . $auto[2] . " PS</p>\n\t\t\t\t</div>\n\t\t\t\t</body>\n\t\t\t\t</html>\n\t\t\t\t";
    // f�r HTML-E-Mails muss der 'Content-type'-Header gesetzt werden
    $header = 'MIME-Version: 1.0' . "\r\n";
    $header .= "Content-Type: text/html; charset=UTF-8" . "\r\n";
    $header .= 'From: WÜ-Travel Buchungen <*****@*****.**>' . "\r\n";
    // verschicke die E-Mail
    return mail($mail, $betreff, $nachricht, $header);
}
Пример #2
0
function getAutos($hin, $rueck, $von, $nach)
{
    $airportid = getFlughafenIDByFlugID($von);
    $ab = "SELECT * FROM Auto WHERE flughafen_id='" . $airportid[1] . "' AND platzzahl>=" . $_SESSION["suchen"]["erwachsene"] . ";";
    $res = mysql_query($ab);
    // echo $ab;
    if (mysql_num_rows($res) == 0) {
        echo "keine Daten verfügbar";
        echo '<input class="back" TYPE = "submit" Name = "back" value="zurück zum Start" />';
    } else {
        while ($auto = mysql_fetch_object($res)) {
            $ab2 = "SELECT * FROM Autobuchung WHERE ((von NOT BETWEEN '{$hin}' AND '{$rueck}')\n\t\t\t\tOR (bis NOT BETWEEN '{$hin}' AND '{$rueck}') AND auto_id='" . $auto->id . "'";
            $auto2 = mysql_num_rows(mysql_query($ab2));
            if ($auto2 == 0) {
                genAuto($auto->id);
            } else {
                $count++;
            }
        }
    }
    if ($count == $res) {
        echo "keine Daten verfügbar";
        echo '<input class="back" TYPE = "submit" Name = "back" value="zurück zum Start" />';
    }
}
Пример #3
0
function addBuchungen()
{
    $ab = "SELECT * From Buchungen WHERE personenid='" . $_SESSION["username"] . "'";
    $res = mysql_query($ab);
    if (mysql_num_rows($res) == 0) {
        echo 'keine Buchungen verf&uuml;gbar';
    } else {
        while ($b = mysql_fetch_object($res)) {
            $platz = explode(",", $b->flugbid);
            $ab2 = "SELECT * FROM Flugbuchung WHERE id='" . $platz[0] . "'";
            $res2 = mysql_query($ab2);
            if (mysql_num_rows($res2) != 0) {
                $flug = mysql_fetch_object($res2);
                $airport = getFlughafenIDByFlugID($flug->flugid);
                $land = getFlughafenLandByID($airport[1]);
                $ort = getFlughafenOrtByID($airport[1]);
                $von = date("d.m.Y", strtotime($b->anreise));
                $bis = date("d.m.Y", strtotime($b->abreise));
                echo '
								<div class="hinflug">
									<div class="hinflugheader">
										Buchung #' . $b->id . '
									</div>
										
									<div class="hinflugbody">
										<div class="rowBody">
											Reiseziel: 
										</div>
										<div class="rowBody">
											' . $ort . ' (' . $land . ')
										</div>
										<div class="rowBody">
											Von:
										</div>
										<div class="rowBody">
											' . $von . '
										</div>
										<div class="rowBody">
											Bis
										</div>
										<div class="rowBody">
											' . $bis . '
										</div>
										<input type="submit" id="stornierButton" name="stornieren[' . $b->id . ']" value="Buchung stornieren"/>
									</div>
								</div>';
            }
        }
    }
}
Пример #4
0
require "mysql_config.php";
require "phpdata/search.php";
require "phpdata/buchungEintragen.php";
require "phpdata/preisBerechnen.php";
require "phpdata/buchungsmail.php";
mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or die('Could not connect to MySQL server.');
mysql_select_db(DB_DATABASE);
mysql_query("SET NAMES 'utf8'");
// if ($_GET["success"] == $_SESSION["paypalcode"] && $_SESSION["paypalcode"] != "") {
// $_SESSION["done"] = 1;
// } else {
// $_SESSION["done"] = 0;
// $_SESSION["paypalcode"] = rand(100000, 1000000);
// }
$_SESSION["done"] = 1;
$orte = getFlughafenIDByFlugID($_SESSION["hinflug"]["flug"]);
$buchungsnummer = round(rand(1000, 3000) * time() / 10000000, 0);
// print_r($_SESSION);
if (isset($_POST["startseite"]) && isset($_SESSION["hinflug"]["flug"])) {
    buchungEintragen();
    buchungsmail();
    //Session löschen, User aber angemeldet lassen
    $user = $_SESSION["username"];
    session_destroy();
    session_start();
    $_SESSION["username"] = $user;
    header('Location: index.php');
} elseif (!isset($_SESSION["username"])) {
    header("Location: /design2/login.php?back=buchen");
    // print_r($_SESSION);
}
Пример #5
0
function getPlatzPreis($flugid, $platz)
{
    $flughafen = getFlughafenIDByFlugID($flugid);
    $dist = getDistance($flughafen[0], $flughafen[1]);
    return round($dist / 16 * getFlugFaktor($flugid) * getFruehbucherFaktor() * getFlugKlasseFaktor($platz), 0);
}