<!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'; ?>

<ul>

<p style = "background-color:#555352"><font color="#ffffff"><br>Select from the list of cities below to view associated travel packages.  
 </font><br><br></p><br><br><br>

<ul>
<?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 cities WHERE location_id='$location_id' ORDER BY city_name"); 

$result=mysql_query($query); 


if (!$result) {

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

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

    die($message);

}
 


echo '<table>'; 

$counter = 0; 
$cells_per_row = 3; 
while($row=mysql_fetch_array($result)) 
{ 
    $counter++; 
    if(($counter % $cells_per_row) == 1)  { echo '<tr>'; } 
    echo '<td width="200px"><a href="citydetails.php?city_id='.$row['city_id'].'&location_id='.$row['location_id'].'" class="top_link">'.$row['city_name'].'</a></td>'; 
    if(($counter %  $cells_per_row) == 0) { echo '</tr>'; } 
} 
// just in case we haven't closed the last row 
// this would happen if our result set isn't divisible by $cells_per_row 
if(($counter % $cells_per_row) != 0) { echo '</tr>'; } 

echo '</table>'; 





?>
</ul>
<br><br>
<hr>
<br><br>

<?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 location_map FROM location WHERE 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 "
<img src=\"countryimg/".$row['location_map']."\">";

}
?>




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

</div>

</body>

</html>