shiljo Posted March 17, 2013 Report Share Posted March 17, 2013 Hi to all! One question, how can i get last aircraft position, some code or something to put it in table...thank you very much Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted March 21, 2013 Moderators Report Share Posted March 21, 2013 You can add this to your page: <?php $pilotid = Auth::$userinfo->pilotid; $report = PIREPData::getlasreports($pilotid, 1); $aircraft = OperationsData::getaircraftinfo($report->aircraft); ?> <table> <tr><td>Aircraft</td><td>Aircraft Location</td></tr> <tr><td><?php echo $aircraft->name ;?></td><td><?php echo $report->arricao ;?></td></tr> </table> You can add this to any page that you want. Quote Link to comment Share on other sites More sharing options...
shiljo Posted March 24, 2013 Author Report Share Posted March 24, 2013 Thank you Parkho, but i want that to incorporate that shows last location of aircraft, together wizh all A/C data such as Type, REg, Hours Flown, routes flown, cargo carried, status (GND or flight or reserved)...etc...Thare has been one script...but i lost track of it...So if such thing exist i would be very preciated to have that code... Thank you very much Quote Link to comment Share on other sites More sharing options...
shiljo Posted March 24, 2013 Author Report Share Posted March 24, 2013 You can add this to your page: <?php $pilotid = Auth::$userinfo->pilotid; $report = PIREPData::getlasreports($pilotid, 1); $aircraft = OperationsData::getaircraftinfo($report->aircraft); ?> <table> <tr><td>Aircraft</td><td>Aircraft Location</td></tr> <tr><td><?php echo $aircraft->name ;?></td><td><?php echo $report->arricao ;?></td></tr> </table> You can add this to any page that you want. Here is my code of fleet page...can you give me hint what to edit??? <h3>fleet</h3> </br> <div class="CSSTableGenerator" > <table> <tr> <td><b>ICAO</b></td> <td><b>Type</b></td> <td><b>Registration</b></td> <td><b>Range</b></td> <td><b>Empty Weight</b></td> <td><b>Cruise Alt</b></td> <td><b>Cargo carried</b></td> <td><b>Total Hours</b></td> <td><b>Total Routes Flown</b></td> <td><b>Aircraft status</b></td> <td><b>Location</b></td> </tr> <?php $fleet = OperationsData::GetAllAircraft(); ?> <?php foreach ($fleet as $aircraft) { ?> <tr> <td><?php echo $aircraft->icao; ?> </td> <td><?php echo $aircraft->name; ?> </td> <td><?php echo $aircraft->registration; ?></td> <td><?php echo $aircraft->range; ?> </td> <td><?php echo $aircraft->weight; ?></td> <td><?php echo $aircraft->cruise; ?></td> <td><#></td> <td><?php echo $aircraft->totaltime; ?></td> <td><?php echo $aircraft->routesflown; ?></td> <td><#></td> <?php $params = (array('a.registration'=>$aircraft->registration, 'p.accepted'=>PIREP_ACCEPTED)); $pirep = PIREPData::findPIREPS($params); $current_location = $pirep[0]->arricao; $current_location2 = $pirep[0]->arrname; ?> <td><?php echo $current_location.'-'.$current_location2; ?></td> </tr> <?php } ?> </table> </div> I am missing, caego carried...i dont know how to get that...status...GND, FLIGHT or RESERVED if possible and total time and routes flown...number of them...i have code for that inside, but i assume wrong one, doesnt show anything...thank you very much Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.