<? include("si_confi.php"); ?>
<? include("ad_head.php"); ?>
  <div class="container">
  <? include("mn_option.php");
  date_default_timezone_set("Asia/Kolkata");
  ?>
<?
if(isset($_REQUEST['submit_emp']))
{
	$username=$_REQUEST['username'];
    $work=$_REQUEST['work'];
	$date_allocation=$_REQUEST['date_allocation'];
	$time_allocation=$_REQUEST['time_allocation'];
	
	$insert_employeee_details=mysql_query("insert into `work_allocation` (`username`,`work`,`date_allocation`,`time_allocation`,`status`,`particulars`,`date`,`time`) values ('$username','$work','$date_allocation','$time_allocation','NULL','NULL','0000-00-00','NULL')");
	?><script>window.location="ad_work.php?ad=suc";</script><?
}
 ?>

<? if($_REQUEST['ad']=='suc'){ ?>
  <div class="success" style="width:92%;margin:0 auto;margin-top:9px;">Work Allocation Details Added Successfully.</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>Add Work Allocation</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>
        <table cellpadding="9" id="add_certi">
        <tr>
        <td valign="top">Employee ID</td>
        <td>
        <select name="username" class="validate-selection" autofocus>
        <option value="" hidden="">Select</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;"></textarea></td>
        </tr>
         <tr>
        <td valign="top">Date</td>
        <td><input type="text" name="date_allocation" value="<? echo date("Y-m-d"); ?>" readonly style="background:#CCC;" class="required"></td>
        </tr>
         <tr>
        <td valign="top">Time</td>
        <td><input type="text" name="time_allocation" value="<? echo date("g:i a"); ?>" readonly style="background:#CCC;" class="required"></td>
        </tr>
        <td valign="top">&nbsp;</td>
        <td><input type="submit" name="submit_emp" onClick="return confirm('Are you sure you want to confirm add Details ?');"></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>