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



<?php include 'analytics.php'; ?>
</head>

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


<?php

$package_id=$_GET['package_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 WHERE package_id='$package_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['package_name']." - ".$row['duration']."</b></font>&nbsp;&nbsp;&nbsp;<br> <a href=\"downloadbrochure.php?package_id=".$row['package_id']."\" class=\"top_link\" target=\"_blank\"><span>Download Details</span></a> &nbsp; &nbsp;<a href=\"downloadbrochure2.php?package_id=".$row['package_id']."\" class=\"top_link\" target=\"_blank\"><span>Download Brochure</span></a>";

}
?>


<?php include 'destnavigation.php'; ?>
<br><br>


<?php
$package_id=$_GET['package_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 DISTINCT * from prices where package_id='$package_id' ORDER BY price_id ASC");
//prices.price_id, 
//prices.package_id, 
//prices.season, 
//prices.triplecost, 
//prices.doublecost, 
//prices.singlecost, 
//prices.minorcost, 
//hotelpricelink.price_id, 
//hotelpricelink.hotel_id, 
//hotel.hotel_id,
//hotel.hotel_rating,
//prices.rating, 
//hotel.hotel_city,
//GROUP_CONCAT(hotel.hotel_name SEPARATOR '<BR>') AS hotels
//FROM prices
//INNER JOIN hotelpricelink ON hotelpricelink.price_id = prices.price_id
//INNER JOIN hotel ON hotel.hotel_id = hotelpricelink.hotel_id
//WHERE prices.package_id='$package_id'
//GROUP BY prices.price_id
//ORDER BY hotel_rating DESC");

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

if($num == "0") {

echo "<br><br><b>Contact a Moreno Representative for pricing.</b><br><br><br>";
}

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


$season =  $row['season'];
$triplecost =  $row['triplecost'];
$doublecost =  $row['doublecost'];
$singlecost =  $row['singlecost'];
$minorcost =  $row['minorcost'];
//$price_id = $row['minorcost'];
$price_id = $row['price_id'];

$query2 = sprintf("SELECT hotel . * ,hp.price_id FROM hotel, hotelpricelink hp WHERE hotel.hotel_id = hp.hotel_id AND hp.price_id = $price_id ORDER BY hp.price_id DESC");


$result2 = mysql_query($query2);

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

if($price_id != $last_price_id) { echo "
<table class=\"sortable\" id=\"dataTable\"><th>Hotel Name</th><th></th>
<th>Triple</th><th>Double</th>
<th>Single</th><th>Child</th>";
 }
echo "<tr> <td  width=\"400px\" align=\"left\"><a href=\"hotel.php?hotel_id=".$row['hotel_id']."\" target=\"_blank\">".
$row['hotel_name']." <font size=\"1px\">(".$row['hotel_city'].")</font></a>
<img width=\"90px\" height=\"20px\" src=\"img/".$row['hotel_rating']."star.png\"></td>";
if($price_id != $last_price_id) { 



echo "<td  width=\"120px\" align=\"center\">".$season." </td>
<td  width=\"60px\" align=\"center\">".$triplecost." </td>
<td  width=\"60px\" align=\"center\">".$doublecost." </td>
<td  width=\"60px\" valign=\"middle\" align=\"center\">".$singlecost."</td>
<td  width=\"60px\" align=\"center\">".$minorcost." </td><br></tr>";
}
 $last_price_id = $price_id; 
     
}
}}
?>

</table>

<p><i>Prices are in US Dollars unless otherwise specified and may vary depending on the season. <br>The itinerary indicates which overnight stays are at pre-determined hotels.</i></p>
<br><br>

<?php

$package_id=$_GET['package_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 WHERE package_id='$package_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 $row['price_notes'];

}
?>

<br><br>

</div>

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



</body>

</html>