예제 #1
0
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>';
        }
    }
}
예제 #2
0
파일: hotels.php 프로젝트: class142/proj
function addTableData()
{
    $abfrage = "SELECT * FROM Hotel";
    $ergebnis = mysql_query($abfrage);
    if (mysql_num_rows($ergebnis) == 0) {
        echo "keine Daten vorhanden";
    }
    while ($row = mysql_fetch_row($ergebnis)) {
        //Land besorgen
        $ab = "SELECT * FROM Countries WHERE iso2='" . $row[6] . "'";
        $land = mysql_fetch_object(mysql_query($ab));
        //Zimmerbuchungen besorgen
        $ab1 = "SELECT * FROM Zimmerbuchung WHERE hotelid='" . $row[0] . "' AND von<'" . date("Y-m-d H:i:s") . "' AND bis>'" . date("Y-m-d H:i:s") . "'";
        $zimmer = mysql_num_rows(mysql_query($ab1));
        $zimmer = !$zimmer ? "0" : $zimmer;
        $hotelname = getHotelNameByID($row[0]);
        //Tabellenzeile einfügen
        echo "<tr>";
        echo '<td><div class="box">
		<p class"hover">' . $row[0] . '</p>
		<div class="mask"><img class="minipic" src="../images/hotels/' . getHotelBild($hotelname) . '" width="250" height="270" border="0" alt=' . $hotelname . '></div>
		</td>';
        // echo "<td>" . $row[0] . "</td>";
        echo '<td class="name">' . $row[1] . '<input type="button" class="showZimmer" value="Zimmer" onclick=\'window.location.href = "#' . $row[0] . '"\'/></td>';
        echo "<td style='width:125px;'><p hidden>" . $row[2] . "</p>" . addSterne($row[2]) . "</td>";
        echo '<td><span class="pie">' . $zimmer . '/' . $row[3] . '</span><br>' . $zimmer . '/' . $row[3] . '</td>';
        echo "<td>" . $row[4] . "<br>" . $row[5] . "<br>" . $land->country . "<img src='../images/flags/" . strtolower($row[6]) . ".png'></td>";
        $flughafen = getDistance($row[4] . " " . $row[5], "airport " . $row[8]);
        echo "<td>" . getOrtAndFlag($row[8]) . "<br>" . $flughafen . " km</td>";
        echo "<td><a href='" . $row[7] . "'>Link</a></td>";
        echo "<td><a href='../phpdata/hotelAendern.php?";
        echo addEditList($row[0], "Hotel");
        echo "#openModal'><img src='../images/edit.png'  class='bin'></td>";
        echo "<td><a href='../phpdata/hotelLoeschen.php?id=" . $row[0] . "'><img src='../images/loeschen.png'  class='bin'></td>";
        echo "</tr>";
    }
}
예제 #3
0
파일: search.php 프로젝트: class142/proj
function genHotel($id, $button = TRUE, $versorgung = null)
{
    $ab2 = "SELECT * FROM Hotel WHERE id='{$id}'";
    $res = mysql_query($ab2);
    $hotel = mysql_fetch_object($res);
    $belegung = getBelegteZimmerZahl($hotel->id) . "/" . $hotel->zimmerzahl;
    $frei = $hotel->zimmerzahl - mysql_num_rows($res);
    $dist = getDistance($hotel->strasse . "" . $hotel->ort, "airport " . $hotel->naherFlughafen);
    $preis = $button ? "ab " . getHotelPreis($hotel->id, null, 0, TRUE) : $_SESSION["preis"]["hotel"];
    // <input class="selectzimmer' . $hotel -> zimmerid . '" Name = "selectzimmer[' . $hotel -> zimmerid . ']"
    // onclick="toggle_visibility_class(\'$selectzimmer' . $hotel -> zimmerid . '\')" value="Zimmer">
    $onclick = "toggle_visibility('zimmer" . $hotel->id . "');";
    $select = $button ? '<input id="suchen" type="button"  onclick="' . $onclick . '" name = "selecthotel[' . $id . ']" value="Zimmer">' : '';
    echo '<div class="hotel' . ($button ? "" : 2) . '">
								<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 . ' (<a href="' . $hotel->homepage . '" target="_blank">info</a>) </div>
											<div class="sterndiv">' . addSterne($hotel->sterne, "images/") . '</div>
										</div>
										<div class="belegung">
											freie Zimmer:
											' . $frei . '
										</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">
											Nächster Flughafen:</br>
											' . getFlughafenOrtByID($hotel->naherFlughafen) . ' (' . $hotel->naherFlughafen . '):
											' . $dist . ' km
										</div>
										<div class="hotelPreis">
											' . $preis . ' €
										</div>
										' . $select . '
										
									</div>
								</div>
							</div>';
}