<?php



require_once("../config/configDB.php"); 



$vehicleID    = $_GET['vehicleID'];



$resultClosingKM = mysqli_query($conn,"SELECT  (totalrunning_hr) as totalrunning_hr,(engineclosing_hr) as engineclosing_hr  FROM trip_transportation_hdr as tth WHERE tth.vehicleno='".$vehicleID."' and  tth.isdelete=1  ORDER BY tth.id DESC LIMIT 1");



$resultClosing    = mysqli_fetch_array($resultClosingKM,MYSQLI_ASSOC);



$resultClosing_thr   = ($resultClosing['totalrunning_hr']>0) ? $resultClosing['totalrunning_hr'] : 0;



$resultClosing_ehr   = ($resultClosing['engineclosing_hr']>0) ? $resultClosing['engineclosing_hr'] : 0;



$res = array();		



array_push($res, array(

    "opening_hr"=>$resultClosing_thr,

    "elosing_hr" => $resultClosing_ehr));



echo json_encode($res);



?>