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

$ref_no = $_REQUEST['LeaveNo'];

$res_tada = $db->LeaveItems($ref_no);     
$a = array();     
$b = array(); 
 
 if ($res_tada != false){ 
   while($row = mysqli_fetch_array($res_tada)) {
	   
	$b["id"] = $row["id"];
  	$b["empid"] = $row["empid"];
	$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["description"] = $row["description"];
	$b["status"] = $row["status"];
	$b["entry_date"] = $row["entry_date"];
	$b["entry_time"] = $row["entry_time"];
	$b["approve_by"] = $row["approve_by"];
	$b["approve_date"] = $row["approve_date"];
	$b["remark"] = $row["remark"];
		
	array_push($a,$b);
   }	
	echo json_encode($a);
 }
?>