<?php
include_once 'db_functions.php';     
$db = new DB_Functions();  

$ei = $_REQUEST['eid'];    
$res_leave = $db->LeaveList($ei);     
$a = array();     
$b = array(); 
 
   
 if ($res_leave != false){ 
   while($row = mysql_fetch_array($res_leave)) {
	   
	$b["id"] = $row["id"];
  	$b["leave_type"] = $row["leave_type"];
	$b["from_date"] = $row["from_date"];
	$b["to_date"] = $row["to_date"];	
	$b["leave_duration"] = $row["leave_duration"];	
	$b["purpose"] = $row["purpose"];
	$b["status"] = $row["status"];	
	array_push($a,$b);
   }	
	echo json_encode($a);
 }

?>