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

$city_id=$_GET['city_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 cities WHERE city_id='$city_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 "<b><font size=\"4px\">".$row['city_name'].", ".$row['city_state']."</b></font><br><br>";



echo "<align=\"right\"><div class=\"figure3\"><img width=\"240px\" height=\"240px\" src=\"cityimg/".$row['city_pic']."\"><br>".$row['city_name'].", ".$row['city_state']."</div></align>";

echo $row['city_details']."</i>";
}

?>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<b>View travel packages which include this city on the itinerary:</b><br><br>

<?php 
$city_id=$_GET['city_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 citiespackagelink ON citiespackagelink.package_id = packages.package_id
INNER JOIN cities ON cities.city_id = citiespackagelink.city_id
WHERE cities.city_id='$city_id'");

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

if($num == "0") {

echo "Contact a Moreno Representative for packages relating to this city.";

}

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\" height=\"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>";


}}
?>

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

</ul></ul>

</div>

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



</body>

</html>