Exemplo n.º 1
0
        $valarray[$i] = getLandNameByISO($_GET["6"]);
    } else {
        $valarray[$i] = $_GET[$i];
    }
}
$id = $_GET['0'];
if (isset($_POST['submit'])) {
    if ($id == "") {
        $id = $_POST["0"];
    }
    // echo $_FILES["hotelpic"]["tmp_name"];
    if ($_FILES["hotelpic"]["tmp_name"] != "") {
        ftpupload($_FILES["hotelpic"]["tmp_name"], HOTEL_DIR, getHotelBild($_POST['1']));
    }
    $nearAirport = getNearestAirport($_POST["5"], getLandISOByName($_POST["6"]));
    $abfrage = "UPDATE Hotel SET\n\t\t\t\tid='{$id}', \n\t\t\t\tname='" . $_POST["1"] . "',\n\t\t\t\tsterne='" . $_POST["2"] . "',\n\t\t\t\tzimmerzahl='" . $_POST["3"] . "',\n\t\t\t\tstrasse='" . $_POST["4"] . "',\n\t\t\t\tort='" . $_POST["5"] . "',\n\t\t\t\tland='" . getLandISOByName($_POST["6"]) . "',\n\t\t\t\thomepage='" . $_POST["7"] . "',\n\t\t\t\tnaherFlughafen='" . $nearAirport[0] . "'\n\t\t\t\tWHERE id='" . $id . "'";
    // echo var_dump($nearAirport);
    // echo $abfrage;
    mysql_query($abfrage);
    header('Location: ../admin/hotels.php');
}
?>

<html>
	<head>
		<link rel="stylesheet" type="text/css" href="../css/dialog.css">
		<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<style>
			input.feld {
				padding: 5px;
Exemplo n.º 2
0
        $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>";
    }
}
if (isset($_POST["submit"])) {
    //array("Name", "Sterne", "Zimmer", "Strasse", "Ort", "Land", "Homepage");
    ftpupload($_FILES["hotelpic"]["tmp_name"], HOTEL_DIR, getHotelBild($_POST['0']));
    $land = getLandISOByName($_POST["5"]);
    $nearAirport = getNearestAirport($_POST["4"], getLandISOByName($_POST["5"]));
    $ab = "INSERT INTO Hotel (name, sterne, zimmerzahl, strasse, ort, land, homepage, naherFlughafen) VALUES (\n\t\t\t'" . $_POST['0'] . "', '" . $_POST['1'] . "', \n\t\t\t'" . $_POST['2'] . "', '" . $_POST['3'] . "', \n\t\t\t'" . $_POST['4'] . "', '" . getLandISOByName($_POST['5']) . "',\n\t\t\t'" . $_POST['6'] . "', '" . $nearAirport[0] . "');";
    // echo $ab;
    mysql_query($ab);
    // echo $land;
}
//Logout
if (isset($_POST['logout'])) {
    //echo "do logout";
    session_destroy();
    header('Location: index.php');
}
?>
<html lang="de">
	<head>
		<title>SWP</title>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>