当前位置: 首页>>代码示例>>PHP>>正文


PHP Vehicle::addTrack方法代码示例

本文整理汇总了PHP中Vehicle::addTrack方法的典型用法代码示例。如果您正苦于以下问题:PHP Vehicle::addTrack方法的具体用法?PHP Vehicle::addTrack怎么用?PHP Vehicle::addTrack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vehicle的用法示例。


在下文中一共展示了Vehicle::addTrack方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: trim

<?php

require_once '../framework/Vehicle.php';
require_once '../framework/Job.php';
//print_r($_POST);
$criteria = trim($_POST['criteria']);
$vehicle = trim($_POST['vehicle']);
$lattitude = trim($_POST['lattitude']);
$longitude = trim($_POST['longitude']);
$address = trim($_POST['address']);
$city = trim($_POST['city']);
//echo "<br>".Vehicle::getIdByNumber($vehicle)."<br>";
$mVehicle = new Vehicle(Vehicle::getIdByNumber($vehicle));
$mVehicle->setLocation($lattitude, $longitude, $address, $city);
//not supporting Job feature now!!!
//$mJob = new Job($mVehicle->getCurrentJob());
//$mJob->setLocation($lattitude, $longitude);
if ($criteria == "location") {
    $mVehicle->addTrack($lattitude, $longitude, $address);
} else {
    $mVehicle->updateDuration($lattitude, $longitude);
}
开发者ID:rustydev19,项目名称:Navigator,代码行数:22,代码来源:upload.php

示例2: getAddress

     $error->reason = "VEHICLE ERROR";
     $error->message = "No such vehicle exists";
     $result->error = $error;
 } else {
     if ($mVehicle->getIMEI() == $imei) {
         $addressInfo = getAddress($lat, $lng);
         $address = $addressInfo->results[0]->formatted_address;
         $city = getCity($addressInfo->results[0]);
         //echo $address."   ".$city;
         if ($city != "" && $mVehicle->getCurrentCity() != $city) {
             $vehicleId = $mVehicle->getId();
             $driver = $mVehicle->getDriver();
             Notification::addLocationNotification($driver, $vehicleId, $lat, $lng, $city);
         }
         if (isset($_GET['accuracy']) && $_GET['accuracy'] <= 20) {
             if ($mVehicle->setLocation($lat, $lng, $address, $city) && $mVehicle->addTrack($lat, $lng, $address)) {
                 $setupResponse->status = "SUCCESS";
                 $setupResponse->request = "location, track";
             }
         } else {
             if ($mVehicle->setLocation($lat, $lng, $address, $city)) {
                 $setupResponse->status = "SUCCESS";
                 $setupResponse->request = "location";
             }
         }
     } else {
         $setupResponse->status = "FAILURE";
         $error = new Error();
         $error->reason = "AUTHENTICATION ERROR";
         $error->message = "You are not authorized for this action.";
         $result->error = $error;
开发者ID:rusty1909,项目名称:Navigator,代码行数:31,代码来源:location.php


注:本文中的Vehicle::addTrack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。