當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Vehicle::setLocation方法代碼示例

本文整理匯總了PHP中Vehicle::setLocation方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vehicle::setLocation方法的具體用法?PHP Vehicle::setLocation怎麽用?PHP Vehicle::setLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Vehicle的用法示例。


在下文中一共展示了Vehicle::setLocation方法的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::setLocation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。