<!--includes for all the database connections-->

<!--loads the php code to connect to databases and queries -->

<!--begin html-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/final_php.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!--template parameters-->
<!--use this editable area to add an additional style sheet-->

<!-- InstanceBeginEditable name="doctitle" -->
<title>Intranet</title>
<!-- InstanceEndEditable -->
<!-- use the editable area below to add any additional head items-->
<!--code to load css for page and menus-->
<?php require_once('../../int05c/incs/loadcss.inc'); ?>
<?php require_once('../../int05c/incs/loadscripts.inc'); ?>
<!--menu hack-->
<!--[if gte IE 5]>
<style>#p7TMnav div a {width: 100%;}</style>
<![endif]-->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>
<body onload="P7_swapClass(0,'none','open','closed','li')"> 
   <div class="skipLinks">
     skip to: <a href="#content">page content</a> | <a href="/pageNav">links on this page</a> | <a     href="#globalNav">site navigation</a> | <a href="#siteInfo">footer (site information)</a>
   </div>
   <div id="header">
    <?php require_once('../../int05c/incs/header.htm'); ?> 
   </div>
   <div id="utility">
    <?php require_once('../../int05c/incs/ut.htm'); ?>
   </div>
   <div id="content"> 
	   <!--left menus-->
	   <div id="pageNav">
	   <?php require_once('../../int05c/incs/nav3.htm'); ?>
	   </div>  
       <!--main content div--> 
       <div class="story"> <!-- InstanceBeginEditable name="content" --> 
<?php
	$db_name = "uclit_db";
	$table_name = "personnel";
	$today="";
	$today=date("Y-m-d");
	$connection = @mysql_connect("libitdb.lang.uc.edu", "phpadmin", "25or624")
		or die("Couldn't connect.");
		
	$ID = $_POST['ID'];	
	$lnametext = $_POST['lnametext'];
	$fnametext = $_POST['fnametext'];
	$depttext = $_POST['depttext'];
	$bldgtext = $_POST['bldgtext'];
	$roomtext = $_POST['roomtext'];
	$mloctext = $_POST['mloctext'];
	$phonetext = $_POST['phonetext'];
	$faxtext = $_POST['faxtext'];
	$emailtext = $_POST['emailtext'];
	$projecttext = $_POST['projecttext'];
	$secondarytext = $_POST['secondarytext'];
	$titletext = $_POST['titletext'];
	$workingtext = $_POST['workingtext'];
	
        
        
       	$query= "UPDATE $table_name SET last_name=\"$lnametext\", first_name=\"$fnametext\", 
	         	 	room=\"$roomtext\", phone=\"$phonetext\", dept_id=\"$depttext\",
			 		e_mail=\"$emailtext\", duties=\"$projecttext\", duties_sec=\"$secondarytext\", 
			 		title=\"$titletext\", working_title=\"$workingtext\" WHERE personnel_id=\"$ID\"" ;

	$db = @mysql_select_db($db_name, $connection)
		or die("Couldn't select database.");
	$result = @mysql_query($query,$connection)
		or die("Couldn't execute query; $query");
		if (!$result) {
			echo"<P>Couldn't update record!";
		}
		else
		{
                $query2= "UPDATE departments SET faxnum=\"$faxtext\", building=\"$bldgtext\", 
	         	 	mail_location=\"$mloctext\" WHERE dept_id=\"$depttext\"" ;

		$db2 = @mysql_select_db($db_name, $connection)
			or die("Couldn't select database.");
		$result2 = @mysql_query($query2,$connection)
		or die("Couldn't execute query; $query");
		if (!$result) {
			echo"<P>Couldn't update record!";
			}
		else
		{
                
                
                
                
                
		echo "
<p>Your record has been updated.</p><BR>
<a href=\"javascript: history.go(-2)\">Return to Staff selection.</a>
";}} ?>
<div id="siteInfo"> 
 <?php require_once('../../int05c/incs/footer.htm'); ?>    
</div>

</body>
<!-- InstanceEnd --></html>
<!-- clear all queries and free the databases-->