<? include("si_confi.php"); ?>
<? include("ad_head.php");
$get_emp_id=base64_decode($_REQUEST['isd']);

  $select_employee_details=mysql_query("select * from `work_allocation` where `id`='$get_emp_id'");
  $fetch_employee_details=mysql_fetch_array($select_employee_details);
  
   ?>
  <div class="container">
  <? include("mn_option.php");
  
  
if(isset($_REQUEST['submit_emp']))
{
	$username=$_REQUEST['username'];
    $work=$_REQUEST['work'];
	
	$emp_row_id=$_REQUEST['emp_row_id'];
	
	$insert_employeee_details=mysql_query("update `work_allocation` set `username`='$username',`work`='$work' where `id`='$emp_row_id'");
	?><script>window.location="viwe_work.php?ed=suc";</script><? } ?>
 

   <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 Certificate Details&nbsp;&nbsp;&nbsp;&nbsp;
   <input type="button" value="Back" style="background:#F00;color:#FFF;cursor:pointer;" onClick="window.location='viwe_work.php'"></h2>
  <form method="post" enctype="multipart/form-data" name="form" id="add_certi" autocomplete="off" action="<?php echo $_SERVER['PHP_SELF']; ?>">
        <script type="text/javascript" src="prototype.js"></script>
        <script type="text/javascript" src="validation.js"></script>
        <input type="hidden" name="emp_row_id" value="<? echo $get_emp_id ?>"  />
        <table cellpadding="9" id="add_certi">
        <tr>
        <td valign="top">Employee ID</td>
        <td>
        <select name="username" autofocus>
        <? $empiddd=$fetch_employee_details['username'];
		$select_employee_detailsempname=mysql_query("select * from `employee_mng` where `emp_id`='$empiddd'");
  $fetch_employee_detailsname=mysql_fetch_array($select_employee_detailsempname);
   ?>
        <option value="<? echo $fetch_employee_details['username']; ?>" hidden=""><? echo ucwords($fetch_employee_detailsname['name']); ?> - <? echo ucwords($fetch_employee_details['username']); ?></option>
        <? $seleect_employee=mysql_query("select * from `employee_mng`");
		while($fetch_employee=mysql_fetch_array($seleect_employee)){ ?>
        <option value="<? echo $fetch_employee['emp_id']; ?>"><? echo ucwords($fetch_employee['name']); ?> - <? echo ucwords($fetch_employee['emp_id']); ?></option>
		<? } ?>
        </select>
        </td>
        </tr>
         <tr>
        <td valign="top">Work</td>
        <td><textarea name="work" class="required" style="width:300px;height:100px;"><? echo $fetch_employee_details['work']; ?></textarea></td>
        </tr>
        <td valign="top">&nbsp;</td>
        <td><input type="submit" name="submit_emp" value="Update"></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_certi', {immediate : true, onFormValidate : formCallback});
					</script>
  </div>
</div><!-- container -->
  </body>
</html>