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 getNearHotels($id) { $ab = "SELECT * FROM Hotel WHERE land='" . getFlughafenLandByID($id) . "'"; $res = mysql_query($ab); $out = array(); while ($hotel = mysql_fetch_object($res)) { array_push($out, $hotel->id); } return $out; }