<?php
	require_once ('authorize1.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">

<head>
<title>Moreno Travel</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="content-type"
        content="text/html; charset=utf-8" />
</head>




<?php include 'admin_header.php'; ?>

<h1></h1>
<?php


require_once('connectvars.php');

	

$dbh = mysql_connect(hostname, username, password)

	or die("Unable to connect to MySQL");

mysql_select_db (dbname, $dbh);


  if (isset($_GET['hotel_id'])) {
    // Grab the hotel data from the GET
    $hotel_id = $_GET['hotel_id'];
	$hotel_name = $_GET['hotel_name'];
$hotel_address = $_GET['hotel_address'];
$hotel_city = $_GET['hotel_city'];
$hotel_state = $_GET['hotel_state'];
$hotel_country = $_GET['hotel_country'];
$hotel_phone = $_GET['hotel_phone'];
$hotel_features = $_GET['hotel_features'];
$hotel_pic = $_GET['hotel_pic'];
$hotel_rating = $_GET['hotel_rating'];
$hotel_green = $_GET['hotel_green'];
$location_id = $_GET['location_id'];

  }
  else if (isset($_POST['hotel_id'])) {
    // Grab the hotel data from the POST
  $hotel_id = $_POST['hotel_id'];
	$hotel_name = $_POST['hotel_name'];
$hotel_address = $_POST['hotel_address'];
$hotel_city = $_POST['hotel_city'];
$hotel_state = $_POST['hotel_state'];
$hotel_country = $_POST['hotel_country'];
$hotel_phone = $_POST['hotel_phone'];
$hotel_features = $_POST['hotel_features'];
$hotel_pic = $_POST['hotel_pic'];
$hotel_rating = $_POST['hotel_rating'];
$hotel_green = $_POST['hotel_green'];
$location_id = $_POST['location_id'];
	

 $query="UPDATE hotel SET hotel_name='$hotel_name',
hotel_address='$hotel_address',
hotel_city='$hotel_city',
hotel_state='$hotel_state',
hotel_country='$hotel_country',
hotel_phone='$hotel_phone',
hotel_features='$hotel_features',
hotel_pic='$hotel_pic',
hotel_rating='$hotel_rating',
hotel_green='$hotel_green',
location_id='$location_id'
WHERE hotel_id=$hotel_id";
$result= mysql_query($query) or die(mysql_error());

        echo "<p>The hotel ".$hotel_name." was successfully edited.  Click <a href=\"admin_hotellist_select.php\">here</a> to edit another hotel.";
    }
    else {
      echo '<p class="error">The hotel was not edited.</p>';
    }
  

?>
</div>


</div>


</body>

</html>