<?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>
    <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>Moreno Travel Admin Portal</h1>
<?php


require_once('connectvars.php');

	

$dbh = mysql_connect(hostname, username, password)

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

mysql_select_db (dbname, $dbh);


  if (isset($_GET['package_id'])) {
    // Grab the package data from the GET
    $package_id = $_GET['package_id'];
	$package_name = $_GET['package_name'];
$duration = $_GET['duration'];
$startingprice = $_GET['startingprice'];
$feature = $_GET['feature'];
$overview = $_GET['overview'];
$overviewpic = $_GET['overviewpic'];
$overviewpic2 = $_GET['overviewpic2'];
$brochurepic = $_GET['brochurepic'];
$includes = $_GET['includes'];
$doesnotinclude = $_GET['doesnotinclude'];
$saleitem = $_GET['saleitem'];
$price_layout = $_GET['price_layout'];
$price_notes = $_GET['price_notes'];
$longterm = $_GET['longterm'];
$moredetails = $_GET['moredetails'];
$morecities = $_GET['morecities'];
$moreinfo = $_GET['moreinfo'];
$location_id = $_GET['location_id'];

  }
  else if (isset($_POST['package_id'])) {
    // Grab the package data from the POST
  $package_id = $_POST['package_id'];
	$package_name = $_POST['package_name'];
$duration = $_POST['duration'];
$startingprice = $_POST['startingprice'];
$feature = $_POST['feature'];
$overview = $_POST['overview'];
$overviewpic = $_POST['overviewpic'];
$overviewpic2 = $_POST['overviewpic2'];
$brochurepic = $_POST['brochurepic'];
$includes = $_POST['includes'];
$doesnotinclude = $_POST['doesnotinclude'];
$saleitem = $_POST['saleitem'];
$price_layout = $_POST['price_layout'];	
$price_notes = $_POST['price_notes'];	
$longterm = $_POST['longterm'];	
$moredetails = $_POST['moredetails'];	
$morecities = $_POST['morecities'];	
$moreinfo = $_POST['moreinfo'];
$location_id = $_POST['location_id'];	

 $query="UPDATE packages SET package_name='$package_name',
duration='$duration',
startingprice='$startingprice',
feature='$feature',
overview='$overview',
overviewpic='$overviewpic',
overviewpic2='$overviewpic2',
brochurepic='$brochurepic',
includes='$includes',
doesnotinclude='$doesnotinclude',
price_layout='$price_layout',
price_notes='$price_notes',
saleitem='$saleitem',
longterm='$longterm',
moredetails='$moredetails',
morecities='$morecities',
moreinfo='$moreinfo', 
location_id='$location_id'
WHERE package_id=$package_id";
$result= mysql_query($query) or die(mysql_error());

        echo "<p>The package ".$package_name." was successfully edited.  Click <a href=\"admin_packagelist.php\">here</a> to edit another package.";
    }
    else {
      echo '<p class="error">The package was not edited.</p>';
    }
  

?>
</div>
</div>


</body>

</html>