Exemple #1
0
                    //echo $dif." ".$j1." ".count($data1)."<br>";
                } else {
                    $j1 = $j1 + 1;
                    //echo $dif." ".$j1." ".count($data1)."<br>";
                }
                //exit;
            }
            // while
        }
        $xml .= '<OtherData totPt="' . $totPath . '" geoData="" geoPointName="" totalDist="' . $totKm . '" />';
        $xml .= '</gps>';
        header('Content-Type: text/xml');
        echo $xml;
    }
} else {
    gpspathFunAll($_SESSION[clientID], $_GET["date_offline"], $_GET["deviceIMEI"]);
}
function gpspathFunAll($clientId, $date_offline, $deviceIMEI)
{
    $date_offline = $_GET[date_offline];
    $path1 = $GLOBALS[dataPath] . "src/data/" . date('d-m-Y', strtotime($date_offline)) . "/" . $deviceIMEI . ".txt";
    if (chk_folder($path1)) {
        $file1 = @fopen($path1, "r");
        if ($file1) {
            $i = 0;
            while (!feof($file1)) {
                $data1 = fgets($file1);
            }
            $data1 = getSortedData($data1);
            $km = liveKmsAllPerDay($data1);
            //exit;
Exemple #2
0
         } elseif ($y == count($z) - 1) {
             $strtTime1 = 0;
             $endTime1 = $endTime;
             $data = gpspathFunAll($z[$y], $_POST[map_device_id]);
             $one_pos_instr = strpos($data, "[2=1]");
             $zero_pos_instr = strpos($data, "[2=0]");
             if ($one_pos_instr == '') {
                 $finData[] = array($z[$y] . ',' . $_POST[time3] => array($z[$y] . ',' . $_POST[time4] => '0'));
             } else {
                 $s = getTimediff($data);
                 $finData[] = $s;
             }
         } elseif ($y < count($z) - 1) {
             $strtTime1 = 0;
             $endTime1 = 1439;
             $data = gpspathFunAll($z[$y], $_POST[map_device_id]);
             $one_pos_instr = strpos($data, "[2=1]");
             $zero_pos_instr = strpos($data, "[2=0]");
             if ($one_pos_instr == '') {
                 $finData[] = array($z[$y] . ',' . $_POST[time3] => array($z[$y] . ',' . $_POST[time4] => '0'));
             } else {
                 $s = getTimediff($data);
                 $finData[] = $s;
             }
         }
     }
 }
 /*	
 for($x=0; $x<count($finData); $x++){
               $splitData = $finData[$x];
          foreach($splitData as $key=>$f){