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


<?php

$category_id=$_GET['category_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 category WHERE category_id='$category_id'");

$result = mysql_query($query);


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



echo $row['category'];

}
?>


Travel Packages</h1>
<ul>
<p>Select from the following list of destinations for an overview, itinerary, pricing, photos, etc.  </p>
<center>

<?php
$category_id=$_GET['category_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 category
INNER JOIN categorypackagelink ON categorypackagelink.category_id = category.category_id
INNER JOIN packages ON packages.package_id = categorypackagelink.package_id
WHERE category.category_id='$category_id' and location_id='$location_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 "
<center><div class=\"figure\"> 
<a href=\"overview.php?package_id=".$row['package_id']."&location_id=".$row['location_id']."\" class=\"top_link\"><img width=\"160px\"  src=\"pkgimg/".$row['overviewpic']."\">
<br><font color=\"ffffff\" size=\"2\">".$row['package_name']."</font><br><font color=\"ffffff\" size=\"2\">".$row['duration']."</a></font></div></center>";

}
?>

</center>
<br><br>


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

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

</body>

</html>