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


<p> Please edit as required.<br><br></p>
<?php

require_once('connectvars.php');

$dbh = mysql_connect(hostname, username, password)

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

mysql_select_db (dbname, $dbh);

// run the query and put the results in an array variable called $result
$result = mysql_query("SELECT * FROM staff ORDER BY staff_id ASC");

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

// open a form
print "<form name='editteam' method='post' action='admin_editteamscript.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 ($staffedit = mysql_fetch_array($result)) {

// assuming you have three important columns (the index (itinerary_id_id), the course name (day), and the book info (headline))
  // start displaying the info; the most important part is to make the name an array (notice headline[$i])
  print "<input type='hidden' name='staff_id[$i]' value='{$staffedit['staff_id']}' />";
print "<strong>First Name:</strong> <input type='text' size='40' name='staff_firstname[$i]' value='{$staffedit['staff_firstname']}' />&nbsp;&nbsp;
<strong>Last Name:</strong> <input type='text' size='40' name='staff_lastname[$i]' value='{$staffedit['staff_lastname']}' /><br><br>";  
print "Title: <input type='text' size='40' name='title[$i]' value='{$staffedit['title']}' /><br>"; 
print "eMail: <input type='text' size='40' name='contact[$i]' value='{$staffedit['contact']}' /><br>"; 
print "Picture: <input type='text' size='40' name='staff_picture[$i]' value='{$staffedit['staff_picture']}' /><br>";
  print " <textarea cols='110' rows='20' name='details[$i]'>{$staffedit['details']}</textarea><br><br><hr>"; 

   
// 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();
?>





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


</div>

</body>

</html>