<?php
	require_once ('authorize1.php');
?>
<!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" />

<style>

tr.order { border-bottom: 1px solid }</style

</head>


<?php include 'admin_header.php'; ?>
<h1>Manage Prices</h1>




<i><font color="#C11B17" size="0.5px">Click <a href="admin_addprice.php" target="blank">here</a> to add a new price package.</i><br>

<b>For Layout 1:</b> <br>
Click <a href='admin_managehotelpricelinkprestep.php'  target="blank">here</a> to manage hotels under price packages.  
Click <a href='admin_addhotelpricelinkprestep.php' target="blank">here</a> to add a hotel to a price package.<br>
<b>For Layout 2:</b> <br>
Click <a href='admin_managehotelpackagelink.php' target="blank">here</a> to manage hotels under price package.  
Click <a href='admin_addhotelpackagelink.php' target="blank">here</a> to add a hotel to a price package.</i></font>
<ul>

<?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>";


}
?>

<br><br><br>

<i><font color="#C11B17" size="0.5px">Enter price as $X,XXX</font><br><br>

<?php
require_once('connectvars.php');
$package_id=$_GET['package_id']; 
$dbh = mysql_connect(hostname, username, password)

	or die("Unable to connect to MySQL");

mysql_select_db (dbname, $dbh);

$result = mysql_query("SELECT * FROM prices 
WHERE package_id = $package_id");
$i = 0;



print "<form name='manageprice' method='post' action='admin_updateprice.php'>";

while ($price = mysql_fetch_array($result)) {

print "<b>Price ID</b>: ".$price['price_id']." <br>";
 

print "<table><tr><td width='70px'><b>Rating</b></td><td width='300px'><b>Season</b></td></tr></table>";



print "<input type='hidden' size='7' name='price_id[$i]' value='{$price['price_id']}' /> ";
print "<input type='hidden' size='7' name='package_id[$i]' value='{$price['package_id']}' /> 
<input type='text' size='7' name='rating[$i]' value='{$price['rating']}' />
<input type='text' size='40' name='season[$i]' value='{$price['season']}' /><br><br>";
print "<b>Triple Cost:</b><input type='text' size='10' name='triplecost[$i]' value='{$price['triplecost']}' />
<b>Double Cost:</b><input type='text' size='10' name='doublecost[$i]' value='{$price['doublecost']}' />
<b>Single Cost:</b><input type='text' size='10' name='singlecost[$i]' value='{$price['singlecost']}' />
<b>Minor Cost:</b><input type='text' size='10' name='minorcost[$i]' value='{$price['minorcost']}' /><hr><br><br>";



++$i;
}
print "<br><input type='submit' value='submit' />";
print "</form>";
mysql_close();
?>

<p><i><font color="#C11B17" size="0.5px"> Step 2 for Managing prices can be found here:

<ul><li>For Layout 1 (different hotel ratings in the same priced package): click <a href="admin_managehotelpricelinkprestep.php" target="blank">here</a></li>
<li>For Layout 2 (hotel selection based on star rating): click <a href="admin_managehotelpackagelink.php" target="blank">here</a></li></ul></font></i></p>

<br><br>




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

</div>

</body>

</html>