<?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>Edit Package</h1>


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



<?php

function location_dropdown($location_id)
{

	$query = sprintf("SELECT * FROM location ");




	$result = mysql_query($query);


	if (!$result) {

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

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

    	die($message);

	}


echo "<select name='location_id'>";
while ($row = mysql_fetch_assoc($result)) {
	
		echo "\n<option value='" .$row['location_id'] . "'";
		if ($row['location_id']==$location_id) echo " selected "; 
		echo " >" . $row['location_name'] . "</option>" ;

	}	
echo "</select>";
}

require_once('connectvars.php');
	

$dbh = mysql_connect(hostname, username, password)

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

mysql_select_db (dbname, $dbh);

$package_id=$_GET['package_id']; 

$query = sprintf("SELECT * FROM location l, packages p WHERE l.location_id=p.location_id AND p.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 '<p><strong>Package ID: </strong>'.$package_id.' - Please edit as required.</p>
       <form method="post" action="admin_editpackagescript.php">   
<input type="hidden" name="package_id" value="'. $row['package_id'].'">';?>


<?php
	location_dropdown($row['location_id']);
?>


<?echo '<br><br>

<strong> Package Name:</strong><br> <input size="100" type="text" name="package_name" value="'.$row['package_name'].'" />

<br><i><font color="#C11B17" size="0.5px">*if the package is an extended visit, put the name and then &#60;&#98;&#114;&#62;&#60;&#98;&#62;&#69;&#120;&#116;&#101;&#110;&#100;&#101;&#100;&#32;&#86;&#105;&#115;&#105;&#116;&#60;&#47;&#98;&#62;</font></i><br><br>
<strong>Duration:</strong> <input size="2" type="text" name="duration" value="'.$row['duration'].'" /> 
<i><font color="#C11B17" size="0.5px">
Enter "days" within the field.  If it\'s a day trip, enter "Day Trip"
</font></i> <br><br>
<strong>Starting Price:</strong><i><font color="#C11B17" size="0.5px">$X,XXX</font></i><br> <input type="text" name="startingprice" value="'.$row['startingprice'].'" /><br><br>

<strong>Brochure Picture:</strong>
 <input type="text" name="brochurepic" value="'.$row['brochurepic'].'" /><i><font color="#C11B17" size="0.5px">
<br>Place the name of the file stored.  Click <a href="admin_picturelist.php" target="blank">here</a> to see a list of pictures with filenames.  Click <a href="admin_uploadimage.php" target="blank">here</a> to upload a new image.</i></font><br><br>

<strong>Overview Picture:</strong> <input type="text" name="overviewpic" value="'.$row['overviewpic'].'" /><i><font color="#C11B17" size="0.5px"><br>Place the name of the file stored.  Click <a href="admin_picturelist.php" target="blank">here</a> to see a list of pictures with filenames.  Click <a href="admin_uploadimage.php" target="blank">here</a> to upload a new image.</i></font><br><br>
<strong>Overview Picture 2:</strong>'.'&nbsp;'.'<input type="text" name="overviewpic2" value="'.$row['overviewpic2'].'" /><i><font color="#C11B17" size="0.5px"><br>Place the name of the file stored.  If no picture is available, enter \"blank.jpg\".  Click <a href="admin_picturelist.php" target="blank">here</a> to see a list of pictures with filenames.  Click <a href="admin_uploadimage.php" target="blank">here</a> to upload a new image.</i></font><br><br>
<strong>Feature:</strong><br> <input size="150" type="text" name="feature" value="'.$row['feature'].'" /><br><br>
<strong>Overview:</strong><br> <textarea cols="110" rows="10" name="overview">'.$row['overview'].'</textarea><br><br>
<strong>Package Includes:</strong><i><font color="#C11B17" size="0.5px"> Place each bulleted point within &lt;li> &lt;/li> tags, minus the bullet.
Click <a href="admin_packageinclude.php" target="_blank">here</a> to view a format to be used by default.</font></i><br> <textarea cols="110" rows="15" name="includes">'.$row['includes'].'</textarea><br><br>
<strong>Does not Include:</strong><i><font color="#C11B17" size="0.5px"> IE: Air transportation, gratuities, personal expenses.</font></i><br>
<textarea cols="110" rows="15" name="doesnotinclude">'.$row['doesnotinclude'].'</textarea><br><br>
<strong>More Details:</strong><i><font color="#C11B17" size="0.5px"> Additional info (Optional tours, etc.)</font></i><br> <textarea cols="110" rows="10" name="moredetails">'.$row['moredetails'].'</textarea><br><br>
<strong>More Cities:</strong><i><font color="#C11B17" size="0.5px"> List small cities which will not have a city page (seperated by a &lt;br>).</font></i><br> <textarea cols="110" rows="10" name="morecities">'.$row['morecities'].'</textarea><br><br>
<strong>More Attractions:</strong><i><font color="#C11B17" size="0.5px"> List small attractions which will not have a attraction page (seperated by a &lt;br>).</font></i><br> <textarea cols="110" rows="10" name="moreinfo">'.$row['moreinfo'].'</textarea><br><br>
 

<strong>Price Layout:</strong> <input size="5" type="text" name="price_layout" value="'.$row['price_layout'].'" /><i><font color="#C11B17" size="0.5px">Enter \'1\' for price packages with different hotel ratings in each.  Enter \'2\' for pricing based on a star rating. Enter \'3\' for pricing based on pricing notes.</font><b  Leave blank if price is not available.</font><br><br>
<strong>Price Notes:</strong><i><font color="#C11B17" size="0.5px"> </font></i><br>'.'&nbsp;'.'<textarea cols="110" rows="15" name="price_notes">'.$row['price_notes'].'</textarea><br><br>

<strong>Long Term Package:</strong><br> <input size="5" type="text" name="longterm" value="'.$row['longterm'].'" /><i><font color="#C11B17" size="0.5px"><br> If this package should appear in the "Long Term" listing, enter yes in this box.</font></i><br><br><br>

<strong>Offer Item:</strong><br><input size="5" type="text" name="saleitem" value="'.$row['saleitem'].'" /><i><font color="#C11B17" size="0.5px"><br> If this package should appear in the "Special Offers" listing, enter yes in this box.</font></i>';
}
?>

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






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

</div>

</body>

</html>