本文整理匯總了PHP中Driver::getCurrentVehicle方法的典型用法代碼示例。如果您正苦於以下問題:PHP Driver::getCurrentVehicle方法的具體用法?PHP Driver::getCurrentVehicle怎麽用?PHP Driver::getCurrentVehicle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Driver
的用法示例。
在下文中一共展示了Driver::getCurrentVehicle方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: header
require_once "../../framework/User.php";
require_once "../../framework/Vehicle.php";
require_once "../../framework/Job.php";
require_once "../../framework/Driver.php";
if (!isset($_SESSION['user'])) {
header('Location:../user/login.php');
}
$mUser = new User();
if (!isset($_GET['id'])) {
header("Location:index.php");
return;
}
$mId = $_GET['id'];
$mDriver = new Driver($mId);
$mVehicle = new Vehicle($mDriver->getCurrentVehicle());
?>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>FindGaddi</title>
<!-- CSS -->
<!-- Reset Stylesheet -->
<link rel="stylesheet" href="../../res/reset.css" type="text/css" media="screen">
<!-- Main Stylesheet -->
<link rel="stylesheet" href="../../res/style.css" type="text/css" media="screen">
<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
示例2: Driver
<a href="#" class="number current" title="3">3</a>
<a href="#" class="number" title="4">4</a>
<a href="#" title="Next Page">Next »</a><a href="#" title="Last Page">Last »</a>
</div> <!-- End .pagination -->
<div class="clear"></div>
</td>
</tr>
</tfoot>
<tbody>
<?php
$mDriverList = $mPreviousDriverList;
for ($i = 0; $i < sizeof($mDriverList); $i++) {
$mDriver = new Driver($mDriverList[$i]);
$mJob = new Job($mDriver->getCurrentJob());
$mVehicle = new Vehicle($mDriver->getCurrentVehicle());
echo "<tr>";
echo "<td>" . $mDriver->getName() . "</td>";
echo "<td>" . $mDriver->getPhone() . "</td>";
echo "<td><a href='../vehicle/detail.php?id=" . $mVehicle->getId() . "'>" . $mVehicle->getVehicleNumber() . "</a></td>";
echo "\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<!-- Icons -->\n\t\t\t\t\t\t\t\t\t\t <a href='#' title='Edit'><img src='../../res/pencil.png' alt='Edit'></a>\n\t\t\t\t\t\t\t\t\t\t <a href='#' title='Delete' onClick='onDelete(" . $mDriver->getId() . ")'><img src='../../res/cross.png' alt='Delete'></a> \n\t\t\t\t\t\t\t\t\t\t <a href='#' title='Edit Meta'><img src='../../res/hammer_screwdriver.png' alt='Edit Meta'></a>\n\t\t\t\t\t\t\t\t\t</td>";
echo "</tr>";
}
?>
</tbody>
</table>
<?php
}
?>
</div> <!-- End #prev -->
示例3: getAvailableDriverList
function getAvailableDriverList()
{
//require_once '../framework/DBConnect.php';
// opening db connection
$db = new Connection();
$conn = $db->connect();
if (empty($_SESSION['user'])) {
return null;
}
$result = array();
if ($this->companyId > 0) {
$sql = "SELECT id FROM driver WHERE company_id = '{$this->companyId}' AND status = '1'";
} else {
$sql = "SELECT id FROM vehicle WHERE added_by = '{$this->id}' AND status = '1'";
}
//echo "--->".$sql;
$action = mysqli_query($conn, $sql);
if (mysqli_num_rows($action) > 0) {
while ($row = mysqli_fetch_assoc($action)) {
$driver = new Driver($row['id']);
if ($driver->getCurrentVehicle() == 0) {
array_push($result, $row['id']);
}
}
}
//echo sizeof($result)." < size";
return $result;
}