} elseif ($y == count($z) - 1) { $strtTime = 0; $endTime = $_GET[eTime]; } elseif ($y < count($z) - 1) { $strtTime = 0; $endTime = 1439; } //echo $strtTime ."-".$endTime; /*else { $strtTime = $_GET[sTime]; $endTime = $_GET[eTime]; } */ //$xml .=gpspathFun($_SESSION[clientID],$z[$y],$_GET["deviceIMEI"],$_GET[sTime],$_GET[eTime]); $data = gpspathFun($_SESSION[clientID], $z[$y], $_GET["deviceIMEI"], $strtTime, $endTime); $km = liveKmsPerDay($data, $strtTime, $endTime); //$km = //print_r($km); //exit; $devName = getDeviceName($_GET["deviceIMEI"]); $data1 = explode("#", $data); $latnlong_values = ""; $km = explode("#", $km); $totKm += $km[0]; $totPath .= $km[1]; //echo $totKm." ".$totPath."<br><br>"; //print_r($km); //$xml .= 'totPt="'.$totPath.'" geoData="" geoPointName="" totalDist="'.$totKm.'">'; $timeArr = array(); $totalDistance = 0; $ct = 0;
for ($y = 0; $y < count($z); $y++) { if ($y == 0) { $strtTime1 = $strtTime; $endTime1 = 1439; $data = gpspathFunAll($z[$y], $_POST[map_device_id]); $finData[] = $z[$y] . "#" . liveKmsPerDay($data, $strtTime1, $endTime1); } elseif ($y == count($z) - 1) { $strtTime1 = 0; $endTime1 = $endTime; $data = gpspathFunAll($z[$y], $_POST[map_device_id]); $finData[] = $z[$y] . "#" . liveKmsPerDay($data, $strtTime1, $endTime1); } elseif ($y < count($z) - 1) { $strtTime1 = 0; $endTime1 = 1439; $data = gpspathFunAll($z[$y], $_POST[map_device_id]); $finData[] = $z[$y] . "#" . liveKmsPerDay($data, $strtTime1, $endTime1); } } } //print_r($finData); $kiloData = "Date,Kilometer"; $kiloData .= "@"; $z = GetDays($sdate, $edate); $cont = 0; if (count($finData) > 0) { for ($x = 0; $x < count($finData); $x++) { $splitData = explode("#", $finData[$x]); $kiloData .= date("d-m-Y", strtotime($splitData[0])) . ',' . $splitData[1]; $kiloData .= '@'; $totKm += $splitData[1]; ?>