<?php


// =============== Get referral code api ===================================

$time = (time() - 60 * 60)*1000;

$url = "https://api.fleeteng.com.au/v2/graph/role/vehicles?access_token=9olkJkrIcttN8Zlh1lgAch70KFC_nJiIpUiCeaBMswbs";
			$curlObj = curl_init();
			curl_setopt($curlObj, CURLOPT_URL, $url);
			curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
			curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0);

			$response = curl_exec($curlObj);

			curl_close($curlObj);
	
			$json = json_decode($response, true);
			
			


			
			$time = "api.fleeteng.com.au";
			

			$array = array_filter($json['items'], function($v) use ($time) {
				
                                          return $v["driver"]["api_host"] >= $time; });
                                           
                        $array = reset($array);
                        
                        //['points']['items'][0]['reported']

	$Res["message"] = "Customer not found"; 
	$Res["status"] = "error"; 
	
	
	
	
//;
	
echo time();
echo "<br>";
echo $time;
echo "<br>";
echo $json["items"][0]["driver"]["api_host"];	
echo "<br>";
echo $response;	
echo "<br><br>";	
 
echo "<pre>";
//print_r($Res);
print_r($array);
echo "</pre>";




?>