<?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['info_id'])) {
    // Grab the info data from the GET
    $info_id = $_GET['info_id'];
	$info_name = $_GET['info_name'];
$info_details = $_GET['info_details'];
$info_pic = $_GET['info_pic'];
$location_id = $_GET['location_id'];

  }
  else if (isset($_POST['info_id'])) {
    // Grab the info data from the POST
  $info_id = $_POST['info_id'];
	$info_name = $_POST['info_name'];
$info_details = $_POST['info_details'];
$info_pic = $_POST['info_pic'];
$location_id = $_POST['location_id'];
	

 $query="UPDATE info SET info_name='$info_name',
info_details='$info_details',
info_pic='$info_pic',
location_id='$location_id'
WHERE info_id=$info_id";
$result= mysql_query($query) or die(mysql_error());

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

?>
</div>
<?php include 'footer.php'; ?>

</div>


</body>

</html>