<?php
include("../include/config.php");
require_once "../include/Database_functions.php";
$sqlObj=new sqlclass();

		$mon=date('m');
		$year=date('Y');
		$id=$_REQUEST['num'];
		$tablename='tbl_emp_leave';
		$sqlObj->tablename="tbl_emp_leave";
		$condition=" where emp_no='$id'";
		$sqlObj->condition=$condition;
		$sqlObj->fieldvalue="*";
		$fieldvalue=$sqlObj->fieldvalue;
		$sql=$sqlObj->SelectTable();
		
		$from= $sql['from'];
		$to=$sql['to'];
		$reason=$sql['reason'];
		$status=$sql['status'];
		$month=substr($from, 5, 2);
		$year=substr($from, 0, 4);
?>
<table width="57%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
      <th colspan="2" align="left" valign="middle">Leave Request</th>
    </tr>
      <tr>
      <td width="48%" height="48" class="tr_td" >Date</td>
      <td width="52%" class="tr_td tr_td_r">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="51%" align="center">From</td>
          <td width="49%" align="center">To</td>
        </tr>
        <tr>
          <td align="center"><input type="hidden" name="stat" value="<?php echo $id; ?>" /><input type="text" class="content" name="from"  id="ldate" size="10" maxlength="100" value="<?php echo $from; ?>"></td>
          <td align="center"><input type="text" class="content" name="to"  id="sdate" size="10" maxlength="100" value="<?php echo $to; ?>"></td>
        </tr>
      </table>
        </td>
     </tr>
	   <tr>
      <td class="tr_td">Reason</td>
      <td class="tr_td tr_td_r"><textarea name="reason" cols="20" rows="10"><?php echo stripcslashes($reason); ?></textarea></td>
	   </tr>
	   <tr>
      <td class="tr_td">Select Status</td>
      <td class="tr_td tr_td_r">
  
	  <select name="status">
	  <option value="pend" <? if($status=='pend'){?>selected="selected"<? }?>>Pending</option>
	  <option value="app" <? if($status=='app'){?>selected="selected"<? }?>>Approved</option>
	  <option value="not app" <? if($status=='not app'){?>selected="selected"<? }?>>Not Approved</option>
	  </select>
	  </td>
	   </tr>
	      <tr>
      <td class="tr_td tr_td_r" colspan="2" align="center"><input type="submit" name="save" value="save" /></td>
      	   </tr>
  </table>