예제 #1
0
파일: autos.php 프로젝트: class142/proj
function addTableData()
{
    $abfrage = "SELECT * FROM Auto";
    $ergebnis = mysql_query($abfrage);
    $tabledata = "";
    if (mysql_num_rows($ergebnis) == 0) {
        $tabledata = "keine Daten vorhanden";
    }
    while ($row = mysql_fetch_row($ergebnis)) {
        echo "<tr>";
        echo '<td><div class="box">
				<p class"hover">' . $row[0] . '</p>
				<div class="mask"><img class="minipic" src="../images/autos/' . $row[0] . '.jpg" width="250" height="270" border="0" alt=' . $row[0] . '></div>
			  </td>';
        for ($i = 1; $i < 14; $i++) {
            if ($i == 3) {
                echo "<td><div class='farbbox' style='background-color:#" . $row[$i] . "'></td>";
            } elseif ($i == 11) {
                echo "<td>" . getOrtAndFlag($row[11]) . "</td>";
            } else {
                echo "<td>" . $row[$i] . "</td>";
            }
        }
        echo "<td><a href='../phpdata/autoAendern.php?";
        echo addEditList($row[0], "Auto");
        echo "#openModal'><img src='../images/edit.png'  class='bin'></td>";
        echo "<td><a href='../phpdata/autoLoeschen.php?id=" . $row[0] . "'><img src='../images/loeschen.png'  class='bin'></td>";
        echo "</tr>";
    }
}
예제 #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>";
    }
}