<!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" />


<style>
img.pkgimg {padding: 2px; border: 8px #EBDAB5 solid;}
</style>
<?php include 'analytics.php'; ?>
</head>

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

<?php
$location_id=$_GET['location_id']; 
$hotel_id=$_GET['hotel_id']; 

require_once('connectvars.php');

	

$dbh = mysql_connect(hostname, username, password)

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

mysql_select_db (dbname, $dbh);


$query = sprintf("SELECT * FROM hotel WHERE hotel_id='$hotel_id' ");

$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 "<align=\"right\"><div class=\"figure3\"><img width=\"240px\" height=\"240px\" src=\"hotelimg/".$row['hotel_pic']."\"><br><b>".$row['hotel_name']."</b><br><br>".$row['hotel_address']."<br>".$row['hotel_city'].", ".$row['hotel_state']."<br>".$row['hotel_country']."<br>".$row['hotel_phone']."
<br><br><br>


</div></align>";

echo $row['overview']."</b><h1>".$row['hotel_name']." <img src=\"img/".$row['hotel_rating']."star.png\"></h1><ul><b>Features: <br></b>".$row['hotel_features']."</i></ul>";
}

?>


<br><br><br><b>View travel packages which include this hotel on the itinerary:
</b><br><br>
<?php 
$hotel_id=$_GET['hotel_id'];
$location_id=$_GET['location_id']; 
require_once('connectvars.php');
$dbh = mysql_connect(hostname, username, password)
	or die("Unable to connect to MySQL");
mysql_select_db (dbname, $dbh);
$query = sprintf("SELECT *
FROM packages
INNER JOIN hotelpackagelink ON hotelpackagelink.package_id = packages.package_id
INNER JOIN hotel ON hotel.hotel_id = hotelpackagelink.hotel_id
WHERE hotel.hotel_id='$hotel_id'");


$result = mysql_query($query);
$num = mysql_num_rows($result);

if($num == "0") {

echo "Contact a Moreno Representative for packages.";

}

else {

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

echo "
<center><div class=\"figure\"> 
<a href=\"overview.php?package_id=".$row['package_id']."&location_id=".$row['location_id']."\"><img width=\"160px\" src=\"pkgimg/".$row['overviewpic']."\">
<br><font color=\"ffffff\">".$row['package_name']."</font><br><b><font color=\"ffffff\">".$row['duration']."</a></font></b></div></center>";


}}
?>
</div>

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


</body>

</html>