function addBuchungen() { $ab = "SELECT * From Buchungen WHERE personenid='" . $_SESSION["username"] . "'"; $res = mysql_query($ab); if (mysql_num_rows($res) == 0) { echo 'keine Buchungen verfü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>'; } } } }
function addAutoData() { $ab = "SELECT DISTINCT * FROM Autobuchung JOIN Auto ON Auto.id=auto_id \n\t\t\t\tWHERE personenid='" . $_SESSION["username"] . "' GROUP BY auto_id ORDER BY marke"; $res = mysql_query($ab); if (mysql_num_rows($res) == 0) { echo "keine Daten verfügbar"; } else { while ($auto = mysql_fetch_object($res)) { echo ' <div class="auto"> <div class="autoBildDiv"> <img id="autoBild" src="images/autos/' . $auto->id . '.jpg" /> </div> <div class="autoBeschreibungDiv"> <div class="autoBeschreibung"> <div class="autoHeader"> <div class="autoName">' . $auto->marke . ' ' . $auto->modell . '</div> <div class="farbbox" style="background-color:#' . $auto->farbe . '"></div> </div> <div class="preisDiv autoInformationen"> Preis pro Tag:</br>' . $auto->preis . ' € </div> <div class="kilometerDiv autoInformationen"> Kilometer:</br>' . $auto->km . ' </div> <div class="erstZulassung autoInformationen"> Schaltung:</br>' . $auto->schaltung . ' </div> <div class="kraftstoffDiv autoInformationen"> ' . $auto->kraftstoff . ' </div> <div class="PS autoInformationen"> ' . round($auto->ps * 0.735499, 0) . ' KW (' . $auto->ps . ' PS) </div> <div class="abholFlughafenDiv autoInformationen"> Abholflughafen:</br> ' . getFlughafenOrtByID($auto->flughafen_id) . ' (' . $auto->flughafen_id . ') ' . getFlagByFlughafenID($auto->flughafen_id) . ' </div> </div> </div> </div>'; } } }
function addModal($array, $edit, $valarray = null, $typ = null) { $count = 0; // if (!$edit) { // foreach ($array as &$val) { // if ($val == "Flughafen" || $val == "Land" || $val == "Hotel") { // echo '<input type="text" placeholder="' . $val . '" name="' . $count . '" list="' . strtolower($val) . '" autocomplete="off" '; // } elseif ($val == "Farbe") { // echo '<input type="color" style="padding:0px;height:25px" name="' . $count . '" value="#' . $valarray[$count] . '"'; // } elseif ($val == "Hotel1") { // echo '<input type="text" readonly="readonly" name="' . $count . '" value="'; echo getHotelNameByID($valarray[0]); echo '"'; // } else { // echo '<input type="text" placeholder="' . $val . '" name="' . $count . '" '; // } // $count++; // echo 'class="feld" /><br>'; // } // } else { foreach ($array as &$val) { echo $edit ? "<p class='row'>" . $val : ""; if ($val == "Land" || $val == "Hotel" || $val == "Versorgung") { echo '<input type="text" placeholder="' . $val . '" name="' . $count . '" list="' . strtolower($val) . '" value="' . $valarray[$count] . '" autocomplete="off"'; } elseif ($val == "Flughafen") { echo '<input type="text" placeholder="' . $val . '" name="' . $count . '" list="' . strtolower($val) . '" value="' . getFlughafenOrtByID($valarray[$count]) . '" autocomplete="off"'; } elseif ($val == "Farbe") { echo '<input type="color" style="padding:0px;height:25px" name="' . $count . '" value="#' . $valarray[$count] . '"'; } elseif ($val == "HOTEL") { echo '<input type="text" readonly="readonly" name="' . $count . '" value="' . getHotelNameByID($valarray[1]) . '"'; } elseif ($val == "Zimmer-ID") { echo '<input type="text" readonly="readonly" name="' . $count . '" value="' . $valarray[$count] . '"'; } elseif (strtolower($val) == "id" && $typ == "hotel") { echo '<input type="text" readonly="readonly" placeholder="' . $val . '" name="' . $count . '" value="' . $valarray[$count] . '"'; } else { echo '<input type="text" placeholder="' . $val . '" name="' . $count . '" list="' . strtolower($val) . '"value="' . $valarray[$count] . '"'; } echo "class='feld' />"; echo $edit ? "</p>" : ""; echo "</br>"; $count++; } // } }
function addHotelData() { $ab = "SELECT DISTINCT * FROM Zimmerbuchung JOIN Hotel ON hotelid=Hotel.id WHERE personenid='" . $_SESSION["username"] . "'\n\t\t\tGROUP BY hotelid ORDER BY Hotel.name"; $res = mysql_query($ab); // echo $ab; if (mysql_num_rows($res) == 0) { echo "keine Daten verfügbar"; } else { while ($hotel = mysql_fetch_object($res)) { $belegung = getBelegteZimmerZahl($hotel->id, TRUE) . "/" . $hotel->zimmerzahl; echo '<div class="hotel"> <div class="hotelBildDiv"> <img id="hotelBild" src="images/hotels/' . getHotelBild($hotel->name) . '" /> </div> <div class="hotelBeschreibungDiv"> <div class="hotelBeschreibung"> <div class="hotelHeader"> <div class="hotelName">' . $hotel->name . '</div> <div class="sterndiv">' . addSterne($hotel->sterne, "images/") . '</div> </div> <div class="adresseDiv"> <div class="adresse">' . $hotel->strasse . '</div> <div class="adresse">' . $hotel->ort . '</div> <div class="adresse">' . getLandNameByISO($hotel->land) . ' ' . getFlagByFlughafenID($hotel->naherFlughafen) . '</div> </div> <div class="naherFlughafen"> Naher Flughafen:</br> ' . getFlughafenOrtByID($hotel->naherFlughafen) . ' (' . $hotel->naherFlughafen . ') </div> <div class="belegung"> Zimmerbelegung:</br> ' . $belegung . ' </div> </div> </div> </div>'; } } }
function getOrtAndFlag($id) { if ($id == null || $id === "0") { return "kein Ort verfügbar"; } return getFlughafenOrtByID($id) . " (" . $id . ")<br><img src='../images/flags/" . strtolower(getFlughafenLandByID($id)) . ".png'>"; }
function genAuto($autoid, $button = TRUE) { $ab = "SELECT * FROM Auto WHERE id='{$autoid}'"; $auto = mysql_fetch_object(mysql_query($ab)); $preis = isset($_SESSION["preis"]["auto"]) ? $_SESSION["preis"]["auto"] : getAutoPreis($auto->id); $select = $button ? '<input class="selectauto" TYPE = "submit" Name = "selectauto[' . $auto->id . ']" value="Wählen" />' : ''; echo ' <div class="auto' . ($button ? "" : 2) . '"> <div class="autoBildDiv"> <img id="autoBild" src="images/autos/' . $auto->id . '.jpg" /> </div> <div class="autoBeschreibungDiv"> <div class="autoBeschreibung"> <div class="autoHeader"> <div class="autoName">' . $auto->marke . ' ' . $auto->modell . '</div> <div class="autoPreis">' . $preis . ' €</div> <div class="farbbox" style="background-color:#' . $auto->farbe . '"></div> </div> <div class="preisDiv autoInformationen"> Preis pro Tag:</br>' . $_SESSION["minpreis"]["auto"][$autoid] . ' € </div> <div class="kilometerDiv autoInformationen"> Kilometer:</br>' . $auto->km . ' </div> <div class="erstZulassung autoInformationen"> Schaltung:</br>' . $auto->schaltung . ' </div> <div class="kraftstoffDiv autoInformationen"> ' . $auto->kraftstoff . ' </div> <div class="PS autoInformationen"> ' . round($auto->ps * 0.735499, 0) . ' KW (' . $auto->ps . ' PS) </div> <div class="abholFlughafenDiv autoInformationen"> Abholflughafen:</br> ' . getFlughafenOrtByID($auto->flughafen_id) . ' (' . $auto->flughafen_id . ') ' . getFlagByFlughafenID($auto->flughafen_id) . ' </div> ' . $select . ' <div class="clear"></div> </div> </div> </div>'; }