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


PHP Vehicle::getDriver方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:rusty1909,项目名称:Navigator,代码行数:30,代码来源:Vehicle.php

示例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";
开发者ID:rusty1909,项目名称:Navigator,代码行数:31,代码来源:location.php

示例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'>&nbsp;<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>";
        }
开发者ID:rusty1909,项目名称:Navigator,代码行数:31,代码来源:index.php


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