本文整理汇总了PHP中Vehicle::getDriver方法的典型用法代码示例。如果您正苦于以下问题:PHP Vehicle::getDriver方法的具体用法?PHP Vehicle::getDriver怎么用?PHP Vehicle::getDriver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vehicle
的用法示例。
在下文中一共展示了Vehicle::getDriver方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setDriver
function setDriver($driver)
{
//require_once '../framework/DBConnect.php';
// opening db connection
$db = new Connection();
$conn = $db->connect();
$vehicle = new Vehicle($this->id);
$prevDriver = $vehicle->getDriver();
if ($prevDriver == $driver) {
return false;
}
$mUser = new User();
$sql = "UPDATE vehicle SET driver = '{$driver}' WHERE id = '{$this->id}'";
//print_r($sql);
if (mysqli_query($conn, $sql)) {
//print_r("<br>Record updated successfully");
if ($driver != 0) {
$action = 1;
//assigning driver
} else {
$action = -1;
//removing driver
$driver = $prevDriver;
}
return Timeline::addTimelineEvent("driver_allotment", $this->id, $driver, "", $mUser->getId(), $action);
} else {
//print_r("<br>Error updating record: " . mysqli_error($conn));
return false;
}
}
示例2: Vehicle
$mVehicle = new Vehicle($vehicle);
if ($mVehicle == null || $mVehicle->getCompany() != $company) {
$setupResponse->status = "FAILURE";
$error = new Error();
$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";
示例3: Vehicle
echo "<a href='#' title='Next Page'>Next »</a><a href='#' title='Last Page'>Last »</a>";
}
?>
</div> -->
<div class="clear"></div>
</td>
</tr>
</tfoot>
<tbody>
<?php
$mVehicleList = $mDeployedVehicleList;
for ($i = 0; $i < sizeof($mVehicleList); $i++) {
$mVehicle = new Vehicle($mVehicleList[$i]);
$mJob = new Job($mVehicle->getCurrentJob());
$mDriver = new Driver($mVehicle->getDriver());
$vehType = $mVehicle->getType();
if (empty($vehType)) {
$vehType = 'Truck';
}
echo "<tr>";
echo "<td><img id='type' height='20' width='20' src='../../../images/vehicle_types/" . $vehType . ".png' title=" . $vehType . " alt=" . $vehType . " style='vertical-align:-5px;'></td>";
echo "<td>" . $mVehicle->getModel() . "</td>";
echo "<td><b><a style='text-transform:uppercase;' href='detail.php?id=" . $mVehicle->getId() . "'>" . $mVehicle->getVehicleNumber() . "</a></b></td>";
if ($mVehicle->getDriver() != "0") {
echo "<td><img height='15' width='15' src='../../../images/driver_icon.png'> <b><a href='../driver/detail.php?id=" . $mDriver->getId() . "' style='text-transform:uppercase;vertical-align:2px;'>" . $mDriver->getName() . "</a></b></td>";
} else {
echo "<td></td>";
}
echo "</tr>";
}