<?php 
/**  * Creates fault detail data as JSON  */    
include_once 'db_functions.php';     
$db = new DB_Functions();  
$user_id=$_REQUEST['eid'];
$from_date=$_REQUEST['from'];
$to_date=$_REQUEST['to'];

$users1 = $db->getEng_attendance($user_id, $from_date, $to_date);  
$a = array();     
$b = array();   
$atten = array();
$sarray = array();
if ($users1!= false){
	         
while ($row = mysqli_fetch_array($users1)) { 

$b["userid"] = $user_id;                    
$b["status_in"] =$row['status_in'];

$sarray=explode(" ",$atten);
$b["in_date_time"] = $row["in_datetime"];
$b["status_out"] =$row['status_out'];
$b["out_date_time"] = $row["out_datetime"];

$b["longitude_in"] = $row["longitude_in"];
$b["latitude_in"] = $row["latitude_in"];

$b["longitude_out"] = $row["longitude_out"];
$b["latitude_out"] = $row["latitude_out"];
$b["address_in"] = $row["address_in"];   
$b["address_out"] = $row["address_out"];
$b["status"] = $row["status"];
array_push($a,$b);         
}    
	
echo json_encode($a);     
} 

?>