<!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>
<script src="sorttable.js"></script>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="content-type"
        content="text/html; charset=utf-8" />


<?php include 'analytics.php'; ?>
</head>




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

<h1>Hotels</h1>


<ul>
<p>Select from the following list of hotels:</p>
<center>

<?php


require_once('connectvars.php');
$location_id=$_GET['location_id']; 
	

$dbh = mysql_connect(hostname, username, password)

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

mysql_select_db (dbname, $dbh);


$query = sprintf("SELECT * FROM hotel WHERE location_id='$location_id' and hotel_longterm!='yes' and hotel_name NOT LIKE 'To Be Announced - 4 star'
and hotel_name NOT LIKE 'To Be Announced - 3 star'
and hotel_name NOT LIKE 'To Be Announced - 2 star'
and hotel_name NOT LIKE 'To Be Announced - 5 star' 
and hotel_name NOT LIKE 'N/A' ORDER BY hotel_rating DESC    , hotel_name ASC");



$result = mysql_query($query);



if (!$result) {

    $message  = 'Invalid query: ' . mysql_error() . "\n";

    $message .= 'Whole query: ' . $query;

    die($message);

}

while ($row = mysql_fetch_assoc($result)) {


echo "
<center><div class=\"figure7\"> 
<br><a href=\"hotel.php?hotel_id=".$row['hotel_id']."&location_id=".$row['location_id']."\" class=\"top_link\"><img width=\"160px\" height=\"160px\" src=\"hotelimg/".$row['hotel_pic']."\"></a>
<br><table><tr height=\"40px\"><td><font color=\"ffffff\"><a href=\"hotel.php?hotel_id=".$row['hotel_id']."&location_id=".$row['location_id']."\" class=\"top_link\">".$row['hotel_name']."</a>
</font></td></tr><tr><td><a href=\"hotel.php?hotel_id=".$row['hotel_id']."&location_id=".$row['location_id']."\" class=\"top_link\"><img src=\"img/".$row['hotel_rating']."star.png\"> ";

if ($row['hotel_green'] !=NULL){
echo " <img title=\"This hotel is green. ".$row['hotel_green']." \" src=\"img/green.png\">";
}
echo "</a></font></td></tr></table></div></center>";
}


?>


</center>
<br><br>




</ul><br><br><br>
</div>

<?php include 'footer.php'; ?>
</div>

</body>

</html>