本文整理汇总了PHP中Vehicle::getCurrentJob方法的典型用法代码示例。如果您正苦于以下问题:PHP Vehicle::getCurrentJob方法的具体用法?PHP Vehicle::getCurrentJob怎么用?PHP Vehicle::getCurrentJob使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vehicle
的用法示例。
在下文中一共展示了Vehicle::getCurrentJob方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Vehicle
<div id="sidebar" style="float:left;width:15%;">
<?php
include 'sidebar.php';
?>
</div>
<div id="content" style="float:right;width:85%;">
Add Order
<form action="action.php?action=add" method="POST">
<table>
<tr><td>Title</td><td><input type="text" name="title" id="title"></td></tr>
<tr><td>Vehicle</td>
<td><select name="vehicle" id="vehicle"><option> --- Select Vehicle --- </option>
<?php
for ($i = 0; $i < sizeof($mVehicleList); $i++) {
$mVehicle = new Vehicle($mVehicleList[$i]);
if ($mVehicle->getCurrentJob() == "") {
echo "<option value=" . $mVehicleList[$i] . ">" . $mVehicle->getVehicleNumber() . "</option>";
}
}
?>
</select></td></tr>
<tr><td>Driver</td>
<td><select name="driver" id="driver"><option> --- Select Driver --- </option>
<?php
for ($i = 0; $i < sizeof($mDriverList); $i++) {
$mDriver = new Driver($mDriverList[$i]);
if ($mDriver->getCurrentJob() == "") {
echo "<option value=" . $mDriverList[$i] . ">" . $mDriver->getName() . "</option>";
}
}
?>
示例2: Vehicle
include 'sidebar.php';
?>
</div>
<div id="content" style="float:right;width:85%;">
<table>
<tr><td style="width:200px;">Vehicle Type</td>
<td style="width:200px;">Model</td>
<td style="width:200px;">Vehicle Number</td>
<td style="width:200px;">Current Job</td>
<td style="width:200px;">Current Driver</td>
<td style="width:200px;">Action</td>
</tr>
<?php
for ($i = 0; $i < sizeof($mVehicleList); $i++) {
$mVehicle = new Vehicle($mVehicleList[$i]);
$mJob = new Job($mVehicle->getCurrentJob());
$mDriver = new Driver($mJob->getDriver());
echo "<tr>";
echo "<td>" . $mVehicle->getType() . "</td>";
echo "<td>" . $mVehicle->getModel() . "</td>";
echo "<td>" . $mVehicle->getVehicleNumber() . "</td>";
echo "<td>" . $mJob->getCode() . "</td>";
echo "<td>" . $mDriver->getName() . "</td>";
echo "<td><input type='submit' value='Assign'><input type='submit' value='Track'></td>";
echo "</tr>";
}
?>
</table>
<div>
</div>
示例3: VehicleMailer
if (Vehicle::add($type, $model, $vehicle_number, $make_year, $description)) {
//mail to admin..
$veh_id = Vehicle::getIdByNumber($vehicle_number);
$adder = new VehicleMailer($veh_id);
$adder->sendVehicleAddedMessage();
header('Location:index.php');
} else {
header('Location:abc.php');
}
break;
case "delete":
$id = $_GET['id'];
echo $_GET['id'];
$mVehicle = new Vehicle($id);
/* if getCurrentJob() retruns o means vehicle is not on job... */
if ($mVehicle->isOnTrip() != 0 || $mVehicle->getCurrentJob() != 0) {
echo '<script language="javascript">';
echo 'alert("Vehicle is on Job, can\'t delte now !!!")';
echo '</script>';
header('Location:index.php');
break;
}
if ($mVehicle->delete()) {
$adder = new VehicleMailer($id);
$adder->sendVehicleDeletedMessage();
header('Location:index.php');
} else {
header('Location:index.php');
}
//header('Location:abc.php');
break;