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



</head>


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

<h1>Assign a Hotel to a Price Package</h1>



<form method="post" action="admin_addhotelpricelinkscript.php">


 <select name="hotel_id"  />  <option disabled="disabled" selected="selected">Select a hotel:</option> 
 <?php

require_once('connectvars.php');

$price_id=$_GET['price_id']; 	

$dbh = mysql_connect(hostname, username, password)

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

mysql_select_db (dbname, $dbh);



$query = sprintf("SELECT hotel_name, hotel_id FROM hotel ORDER BY hotel_name 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 "<option value=\"".$row['hotel_id']."\">".$row['hotel_name']."</option>";

}
?>
</select><br><br>







 <select name="price_id"  />  <option disabled="disabled" selected="selected">Select a price option:</option> 
 <?php

require_once('connectvars.php');

	

$dbh = mysql_connect(hostname, username, password)

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

mysql_select_db (dbname, $dbh);

$package_id = $_POST['package_id'];

$query = sprintf("SELECT * FROM prices 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 "<option value=\"".$row['price_id']."\">ID: ".$row['price_id']." - ".$row['season']." - Triple: ".$row['triplecost']." - Double: ".$row['doublecost']."
 - Single: ".$row['singlecost']." - Minor ".$row['minorcost']."</option>";
 


}
?>
</select><br><br>


<input type="submit" value="Submit">
</form>
  






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


</div>

</body>

</html>