本文整理汇总了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);
}
示例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;