<? include("si_confi.php"); ?>
<? include("ad_head.php"); ?>

  <div class="container">
  <? include("mn_option.php");?>

<?
$id=$_REQUEST['id'];

if(isset($_REQUEST['submit_emp']))
{
	$name=$_REQUEST['name'];
	$id=$_REQUEST['id'];
	$insert_employeee_details=mysql_query("update  `department` set `department`='$name' where id='$id'");
	?><script>window.location="viwe_department.php?ed=suc";</script><?
}
    $select=mysql_query("select * from `department` where `id`='$id'");
	$selectdatass=mysql_fetch_array($select);
 ?>


<link type="text/css" href="calender/jquery.datepick.css" rel="stylesheet">
<script type="text/javascript" src="calender/jquery.min.js"></script>
<script type="text/javascript" src="calender/jquery.datepick.js"></script>
<script type="text/javascript">
$nocal=$.noConflict();
$nocal(function() {
	$nocal('#popupDatepicker').datepick();
	$nocal('#inlineDatepicker').datepick({onSelect: showDate});
});
function showDate(date) {
	alert('The date chosen is ' + date);
}
</script>
<script type="text/javascript">
$nocal(function() {
	$nocal('#popupDatepicker2').datepick();
	$nocal('#inlineDatepicker2').datepick({onSelect: showDate});
});
function showDate(date) {
	alert('The date chosen is ' + date);
}
</script>


<? if($_REQUEST['ad']=='suc'){ ?>
  <div class="success" style="width:92%;margin:0 auto;margin-top:9px;">Department Name  Added successfully.</div><? } ?>
  
  
  <? if($_REQUEST['al']=='exist'){ ?>
  <div class="warning" style="width:92%;margin:0 auto;margin-top:9px;">Department Name Already Exists.</div><? } ?>
  
 

   <div style="border:groove;margin-top:10px;border-width:thin;padding:20px;border-radius:4px;border-color:#cccccc;box-shadow: 10px 9px 90px #000;">
   <h2>Edit Department Name</h2>
  <form method="post" enctype="multipart/form-data" id="add_employee" onSubmit="return confirm('Are you sure you want to confirm add this Employee Details ?');" autocomplete="off" action="<?php echo $_SERVER['PHP_SELF']; ?>">
        <script type="text/javascript" src="prototype.js"></script>
        <script type="text/javascript" src="validation.js"></script>
        <table cellpadding="9" id="add_employee">
        <tr>
        <tr>
        <td valign="top">Department Name</td>
        <td><input type="text" name="name" class="required" value="<? echo $selectdatass['department']; ?>" >
        <input type="hidden" name="id" class="required" value="<? echo $selectdatass['id']; ?>" >
        </td>
        </tr>
         <tr>
        

        <tr>
        <td valign="top">&nbsp;</td>
        <td><input type="submit" name="submit_emp"></td>
        </tr>
        </table>
			
		</form>
         <script type="text/javascript">
						function formCallback(result, form) 
						{window.status = "valiation callback for form '" + form.id + "': result = " + result;}
						var valid = new Validation('add_employee', {immediate : true, onFormValidate : formCallback});
					</script>
  
  
  </div>
  
 
</div><!-- container -->
  </body>
</html>
