Exemple #1
0
 $sdate = date("d-m-Y", strtotime($fetDevice[di_createDate]));
 $edate = date("d-m-Y", strtotime($_GET[date_offline]));
 $z = GetDays($sdate, $edate);
 for ($y = count($z); $y > 0; $y--) {
     $path = $GLOBALS[dataPath] . "src/data/" . date('d-m-Y', strtotime($z[$y])) . "/" . $fetDevice[di_imeiId] . ".txt";
     $fp_load = @fopen($path, "rb");
     if ($fp_load) {
         /*$path1 = $path;
         		$datDate1 = $z[$y];*/
         break;
     }
     @fclose($path);
 }
 //echo $path;
 //exit;
 if ($mydata = gpspathFun($path)) {
     $data1 = explode("#", $mydata);
     $data2 = explode("@", $data1[count($data1) - 2]);
     if (count($data2) > 1) {
         $data3 = explode(",", $data2[1]);
         //print_r($data3);
         $vehi = $data3[0];
         $pos1 = calLat($data3[2]);
         $pos2 = calLong($data3[1]);
         $recTime = date("h:i A", strtotime($data3[9]));
         $d = explode("-", $data3[8]);
         $result_pt = $fetDevice[di_deviceId] . "#" . $fetDevice[di_imeiId] . "#" . "00ff00" . "#0#" . $_GET[sessionid] . "#" . $d[0] . "#" . $d[1] . "#" . $d[2] . "#" . $fetDevice[di_imeiId] . "#" . $recTime . "#" . $pos1 . "#" . $pos2 . "#" . $fetDevice[di_deviceName] . "#" . $data3[3];
     }
     //$d = explode("-",$_GET[date_offline]);
     //$result_pt = $fetDevice[di_deviceId]."#".$fetDevice[di_imeiId]."#"."00ff00"."#0#".$_GET[sessionid]."#".$d[0]."#".$d[1]."#".$d[2]."#".$fetDevice[di_imeiId]."####".$fetDevice[di_deviceName]."#-1";
     //$result_pt = $fetDevice[di_deviceId]."#".$fetDevice[di_imeiId]."#"."ff0000"."#"."n"."#".$fetDevice[di_deviceName];
Exemple #2
0
     $endTime = 1439;
 } 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;
}
//$path1=$dataPath."client_".$_GET[sessionID]."/".date('d-m-Y',strtotime($_GET["date_offline"]))."/".$_GET["phoneNumber"].".txt";
if ($_SESSION[superAdminSID] != '') {
    $matches = array();
    $c = 0;
    $client_array = array();
    $res_clients = SuperAdminSF::getClients();
    while ($clientIds = mysql_fetch_assoc($res_clients)) {
        array_push($client_array, $clientIds);
    }
    for ($cl = 0; $cl < count($client_array); $cl++) {
        gpspathFun($client_array[$cl][clin_id], $_GET["date_offline"], $_GET["phoneNumber"]);
        //echo $dataPath."client_".$client_array[$cl][clin_id]."/".date('d-m-Y',strtotime($_GET["date_offline"]))."/".$_GET["phoneNumber"].".txt";
    }
} else {
    gpspathFun($_GET[sessionID], $_GET["date_offline"], $_GET["phoneNumber"]);
    //$path1=$dataPath."client_".$_GET[sessionID]."/".date('d-m-Y',strtotime($_GET["date_offline"]))."/".$_GET["phoneNumber"].".txt";
    //echo $latnlong_values;
}
function calVal1($val)
{
    $g9 = round($val, 0);
    $h9 = round(60 * ($val - $g9), 0);
    $i9 = round(3600 * ($val - $g9 - $h9 / 60), 4);
    $e9 = $g9 + $h9 / 100 + $i9 / 10000;
    return round(floatval($e9), 4);
}
function calVal2($val)
{
    $v1 = round($val, 0);
    $v2 = ($val - $v1) * 100 / 60;