<? include("si_confi.php"); ?>
<? include("ad_head.php");
date_default_timezone_set("Asia/Kolkata");?>
   <div class="container">
   <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>Update Work Status</h2>
   
   <? 
   $get_row_id=$_REQUEST['isd'];
   $select_work_details=mysql_query("select * from `work_allocation` where `id`='$get_row_id'");
   $fetch_work_detais=mysql_fetch_array($select_work_details);
   $work_status=$fetch_work_detais['status'];
   if($work_status=='NULL'){$statuswork="Pending";} else {$statuswork=$work_status;}
   
   if(isset($_REQUEST['submit_status']))
   {
	   $status=$_REQUEST['status'];
	   $particulars=$_REQUEST['particulars'];
	   $editrowid=$_REQUEST['editrowid'];
	   
	   
	   $status_date=date("Y-m-d");
	   $status_time=date("g:i a");
	   $update_workallocaiton=mysql_query("update `work_allocation` set `status`='$status',`particulars`='$particulars',`date`='$status_date',`time`='$status_time' where `id`='$editrowid'");
	   ?><script>window.opener.location="viw_work.php?up=suc";
       self.close();</script><?
	   
   }
   ?>
   
  
  <form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" onSubmit="return confirm('Please Confirm the Status.');">
  <table cellpadding="8" id="add_certi">
  <input type="hidden" name="editrowid" value="<? echo $get_row_id; ?>">
  <tr>
  <td>Status</td>
  <td><select required name="status">
<option value="<? echo $statuswork; ?>" hidden=""><? echo $statuswork; ?></option>
<option>Complete</option>
<option>Cancel</option>
</select></td>
  </tr>
  <tr>
  <td valign="top">Particulars</td>
  <td><textarea name="particulars" style="width:340px;height:80px;" required placeholder="Particulars"></textarea></td>
  </tr>
  <tr>
  <td>&nbsp;</td>
  <td><input type="submit" name="submit_status" value="Update"></td>
  </tr>
  </table>
  
  </form>
      
  </div>
</div><!-- container -->
  </body>
</html>