</td> </tr> </tfoot> <tbody> <?php //$mDriverList = $mAllDriverList; 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><img height='15' width='15' src='../../../images/driver_icon.png'> <b><a href='detail.php?id=" . $mDriver->getId() . "' style='text-transform:uppercase;vertical-align:2px;'>" . $mDriver->getName() . "</a></b></td>"; echo "<td><b><img height='20' width='20' src='../../../images/phone_icon.png'><span style='vertical-align:5px;'>+91-" . $mDriver->getPhone() . "</span></b></td>"; if ($mVehicle->getId() != "") { echo "<td><b><img height='15' width='15' src='../../../images/vehicle_types/" . $mVehicle->getType() . ".png'> <a style='text-transform:uppercase;vertical-align:2px;' href='../vehicle/detail.php?id=" . $mVehicle->getId() . "'>" . $mVehicle->getVehicleNumber() . "</a></b></td>"; } else { echo "<td></td>"; } echo "</tr>"; } ?> </tbody> </table> <?php } ?> </div> <!-- End #all -->
?> </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> </body>
//echo $mVehicle->getAddress(); ?> <div id="googleMap" style="width:70%;height:100%;float:left;"></div> <?php } } ?> <div class="content-box-content-detail" style="width:30%;height:100%;float:right;overflow-y:auto"> <div id="vehicle_number" style="margin:15px 5px 20px 5px"> <b style="font-size:30px"><?php echo $mVehicle->getVehicleNumber(); ?> </b> <span style="font-size:12px">(<?php echo $mVehicle->getType(); ?> )</span> <br><br><input type='button' value='View full details'> <input type='button' value='Notifications'> </div> <div class="content-box" style="margin:5px 5px 5px 5px" id="address_block"> <div style="display: block;" class="content-box-content-no-border"> <div style="display: block;" class="tab-content default-tab"> <b> Current Location : </b><br><br> <div id="address_view"> Locating... </div><br>
} ?> </div> --> <div class="clear"></div> </td> </tr> </tfoot> <tbody> <?php $mVehicleList = $mWaitingVehicleList; for ($i = 0; $i < sizeof($mVehicleList); $i++) { $mVehicle = new Vehicle($mVehicleList[$i]); $mJob = new Job($mVehicle->getCurrentJob()); $mDriver = new Driver($mJob->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><a href='detail.php?id=" . $mVehicle->getId() . "'>" . $mVehicle->getVehicleNumber() . "</a></td>"; echo "<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='Delete' onClick='onDelete(" . $mVehicle->getId() . ")'><img src='../../../images/cross.png' alt='Delete'></a>\n\t\t\t\t\t\t\t\t\t</td>"; echo "</tr>"; } ?> </tbody> </table> <?php
$result = new Result(); if (isset($_GET['vehicle']) && isset($_GET['type']) && isset($_GET['imei']) && isset($_GET['mac'])) { $vehicle = trim($_GET['vehicle']); $type = trim($_GET['type']); $imei = trim($_GET['imei']); $mac = trim($_GET['mac']); $vehicleId = Vehicle::getIdByNumber($vehicle); if ($vehicleId == null) { $setupResponse->status = "FAILURE"; $error = new Error(); $error->reason = "VEHICLE"; $error->message = "No such vehicle registered."; $result->error = $error; } else { $mVehicle = new Vehicle($vehicleId); if ($mVehicle->getType() != $type) { $setupResponse->status = "FAILURE"; $error = new Error(); $error->reason = "VEHICLE_TYPE"; $error->message = "Vehicle type does not match"; $result->error = $error; } else { if ($mVehicle->isDeployed() == 1) { $setupResponse->status = "FAILURE"; $error = new Error(); $error->reason = "VEHICLE"; $error->message = $vehicle . " is already deployed"; $result->error = $error; } else { if ($mVehicle->deploy($imei, $mac)) { $setupResponse->status = "SUCCESS";
} else { if ($mVehicle->isLocationAvailable() == null) { echo "<div class='notification attention png_bg' style='width:50%;float:left;margin:10px 10px 10px 10px;'><div>Could not find location at this moment, Please be patient and be with us.</div></div> "; } else { //echo $mVehicle->getAddress(); ?> <div id="googleMap" style="width:70%;height:100%;float:left;"></div> <?php } } ?> <div class="content-box-content-detail" style="width:30%;height:100%;float:right;overflow-y:auto"> <div id="vehicle_details" style="margin:15px 5px 20px 10px"> <img id="type" height="45" width="45" src="../../../images/vehicle_types/<?php echo $mVehicle->getType(); ?> .png" title="<?php echo $mVehicle->getType() . " : " . $mVehicle->getModel(); ?> " alt="<?php echo $mVehicle->getType(); ?> "> <span style="vertical-align:12px;"><b style="font-size:30px;"><?php echo $mVehicle->getVehicleNumber(); ?> </b> </span> <br><br><input class="button" type='button' value='View full details'> <br><br><br> <div id="location_info"> <table>
if (isset($_GET['vehicle']) && isset($_GET['type'])) { $setup = array(); $vehicle = trim($_GET['vehicle']); $type = trim($_GET['type']); $vehicleId = Vehicle::getIdByNumber($vehicle); $setup['setup']['model'] = ""; $setup['setup']['type'] = ""; $setup['setup']['number'] = ""; $setup['setup']['company_name'] = ""; $setup['setup']['owner'] = ""; $setup['setup']['contact'] = ""; if ($vehicleId == null) { $setup['setup']['result'] = "fail_vehicle"; } else { $mVehicle = new Vehicle($vehicleId); if ($mVehicle->getType() != $type) { $setup['setup']['result'] = "fail_type"; //echo "fail_type"; } else { if ($mVehicle->isDeployed() == 1) { $setup['setup']['result'] = "already"; //echo "already"; } else { if ($mVehicle->deploy()) { $setup['setup']['result'] = "success"; $companyId = $mVehicle->getCompany(); $setup['setup']['model'] = $mVehicle->getModel(); $setup['setup']['type'] = $mVehicle->getType(); $setup['setup']['number'] = $mVehicle->getVehicleNumber(); $mCompany = new Company($companyId); $setup['setup']['company_name'] = $mCompany->getName();
<div class="column-right" style="width:35%;height:88%"> <div class="content-box-header"> <h3 style="cursor: s-resize;">Current Status</h3> </div> <!-- End .content-box-header --> <br> <div id="vehicle_info"> <?php //$mVehicle1 = new Vehicle($mId); //echo $mVehicle->getCurrentDriver(); if ($mDriver->getCurrentVehicle() == 0) { ?> <b><img id="driver_icon" height="20" width="20" src="../../res/vehicle_types/Truck.png" title="Vehicle" alt="Vehicle"> <span style='vertical-align:5px;'>Click</span> <a class="js-open-modal" href="#" data-modal-id="popup" style="font-size:11px" ><img id="add" height="15" width="15" src="../../res/add.png" title="Add Driver" alt="Add Driver"></a> <span style='vertical-align:5px;'>to assign vehicle</span></b> <?php } else { echo "<img id='driver_icon' height='20' width='20' src='../../res/vehicle_types/" . $mVehicle->getType() . "' title='" . $mVehicle->getType() . "' alt='" . $mVehicle->getType() . "'> <span style='vertical-align:5px;'><b><a href='../vehicle/detail.php?id=" . $mVehicle->getId() . "'>" . $mVehicle->getVehicleNumber() . "</a></b></span>"; ?> <?php } ?> </div> <br> <?php if ($mDriver->getCurrentVehicle() != 0) { ?> <div id="location_info"> <img id="location_icon" height="15" width="15" src="../../res/location_icon.png" title="Location" alt="Location"> <b><span id="location_view" style='vertical-align:2px;'> Locating...
} else { echo "<script>alert('There was some error, please try again... !!!');</script>"; echo "<script>window.location.href = 'http://www.findgaddi.com/navigator/Ver2.0/ui/pages/user/login.php'</script>"; } break; case "billdetail": if (!isset($_GET['id'])) { break; } $id = $_GET['id']; $mExpense = new Expense($id); $vehicleId = $mExpense->getVehicle(); $mVehicle = new Vehicle($vehicleId); $vehicleDetail['id'] = $mVehicle->getId(); $vehicleDetail['number'] = $mVehicle->getVehicleNumber(); $vehicleDetail['type'] = $mVehicle->getType(); $driverId = $mExpense->getDriver(); $mDriver = new Driver($driverId); $driverDetail['id'] = $mDriver->getId(); $driverDetail['name'] = $mDriver->getName(); $detail['id'] = $mExpense->getId(); $detail['vehicle'] = $vehicleDetail; $detail['driver'] = $driverDetail; $detail['reason'] = $mExpense->getReason(); $detail['amount'] = $mExpense->getAmount(); $detail['filename'] = $mExpense->getFilename(); $detail['date_added'] = $mExpense->getDateAdded(); $detail['location'] = $mExpense->getLocation(); echo json_encode($detail); break; case "billapproval":