<?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>Change Default Package Order</h1>


<ul>

<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
require_once('connectvars.php');
<?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>Manage Packages</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>

<ul>
<p>Select from the following list of countries to manage packages:</p>
<center>




<?php


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 location ORDER BY location_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 "<center><div class=\"button\"> 
<a href=\"admin_packagelist.php?location_id=".$row['location_id']."\">".$row['location_name']."</a></font</center></div>";

}
?>




</center>
<br><br>




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


</div>

</body>

</html>
$dbh = mysql_connect(hostname, username, password)

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

mysql_select_db (dbname, $dbh);

$result = mysql_query("SELECT * FROM packages ORDER BY package_order ASC");

// start a counter in order to number the input fields for each record
$i = 0;

// open a form
print "<form name='edititinerary' method='post' action='admin_packageorderscript.php'>\n";

// start a loop to print all of the courses with their book information
// the mysql_fetch_array function puts each record into an array. each time it is called, it moves the array counter up until there are no more records left
while ($packageorder = mysql_fetch_array($result)) {

print "<input type='hidden' name='package_id[$i]' value='{$packageorder['package_id']}' />";
print "<table><tr><td><input size='1' type='text' name='package_order[$i]' value='{$packageorder['package_order']}' /></td>";
print "<td>{$packageorder['package_name']}<br><img width='182px' height='158px' src='/pkgimg/{$packageorder['overviewpic']}'></td><hr></tr></table>";

// add 1 to the count, close the loop, close the form, and the mysql connection
++$i;
}
print "<br><input type='submit' value='submit' />";
print "</form>";
mysql_close();
?>




</form>


<br><br>




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


</div>

</body>

</html>