<!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>All Destinations - Sortable</h1>

<p>Select from the following list of destinations to view an overview, itinerary, pricing, photos, etc.  You can click on any of the headings in the chart below to sort any of the columns.</p>


<table class=\"sortable\" id=\"dataTable\"><th>Package</th><th>Duration</th><th>Starting Price</th><th>Details</th>
<?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 packages WHERE location_id='$location_id' ORDER BY package_id 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 "<tr><td class=\"sortable\" width=\"200px\"><a href=\"overview.php?package_id=".$row['package_id']."?location_id=".$row['location_id']."\">".$row['package_name']."</a></td><td width=\"80px\" class=\"sortable\" align=\"center\">".$row['duration']."</td><td width=\"75px\" class=\"sortable\" align=\"center\">".$row['startingprice']."</td><td width=\"400px\" class=\"sortable\">".$row['feature']."</td>
</tr>";

}
?>

</table>





</div>

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

</body>

</html>