if ($fetch_fin_info[vfi_own_hired] == 2) {
             $vehiStatus = "Hired";
             $vehiOwner = $fetch_getDetails[vi_ownerName];
             $vehiContact = $fetch_fin_info[vfi_hired_contact_no];
         } else {
             $vehiStatus = "New";
             $vehiOwner = $fetch_getDetails[vi_ownerName];
             $vehiContact = "Not Set";
         }
     }
 }
 $file = $dataPath . "client_" . $_SESSION[clientID] . "/" . date("d-m-Y", strtotime($sdate)) . "/" . $fetch_getDetails[vi_reg_no] . ".txt";
 //if(file_exists("../../reports_test/data/".date("d-m-Y", strtotime($z[$y]))."/TN22AM3207.csv"))
 if (chk_folder($file)) {
     //$op = kmsPerDay($file);
     $data = split("#", kmsPerDay($file));
     $timediff1 = getOverAllTripReport($sdate, $fetch_getDetails[vi_reg_no], $_POST[selPoint]);
 }
 if (count($timediff1) > 0) {
     foreach ($timediff1 as $key => $value) {
         $destPt = explode(",", $timediff1[$key]);
         for ($u = 0; $u < count($destPt); $u++) {
             $destVal = explode("#", $destPt[$u]);
             $endTime .= $destVal[1] . ',';
         }
         $strtHtml = $destVal[0] . ' - ' . count($destPt) . ' (' . $endTime . ')';
         $endTime = "";
         $r++;
     }
 } else {
     $strtHtml = "";
Beispiel #2
0
         $km = explode(",", kmsPerDay($path));
         $kmdata['tmsi_clientId'] = $fetDevice[di_clientId];
         $kmdata['tmsi_imei'] = $fetDevice[di_imeiId];
         $kmdata['tmsi_readDate'] = date('Y-m-d', strtotime($z[$y]));
         $kmdata['tmsi_kmpd'] = $km[0];
         //print_r($kmdata);
         //exit;
         $db->query_insert("tb_speed_meter_info", $kmdata);
     } else {
         $sToTime = strtotime($z[$y]);
         $eToTime = strtotime(date("d-m-Y"));
         if ($sToTime == $eToTime) {
             $fetDateReading = $db->fetch_array($resDateReading);
             //print_r($fetDateReading);
             $path = $GLOBALS[dataPath] . "src/data/" . date('d-m-Y', strtotime($z[$y])) . "/" . $fetDevice[di_imeiId] . ".txt";
             $km = explode(",", kmsPerDay($path));
             //print_r($km);
             $kmdata['tmsi_clientId'] = $fetDevice[di_clientId];
             $kmdata['tmsi_imei'] = $fetDevice[di_imeiId];
             $kmdata['tmsi_readDate'] = date('Y-m-d', strtotime($z[$y]));
             $kmdata['tmsi_kmpd'] = $km[0];
             //print_r($kmdata);
             //exit;
             $db->query_update("tb_speed_meter_info", $kmdata, "tsmi_id = " . $fetDateReading[tsmi_id]);
         }
     }
     //echo "<br><br>";
 }
 //print_r($fetDevice);
 //exit;
 //$path=$GLOBALS[dataPath]."src/data/".date('d-m-Y')."/".$fetDevice[di_imeiId].".txt";