Gabriel Fernandez Posted July 13, 2010 Report Share Posted July 13, 2010 Hello People, i want get de last 5 flights with this iformations: Flight No Departure Arrival Equipment Flight Time Submitted By Type Status Status( Is rejectd or acepetd) Thanks Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted July 14, 2010 Report Share Posted July 14, 2010 Same as my other code just modified a bit <?php $count = 5; $pireps = PIREPData::getRecentReportsByCount($count); ?> <table> <thead> <tr> <th>Flight #</th> <th>Departure</th> <th>Arrival</th> <th>Aircraft</th> <th>Duration</th> <th>Pilot</th> <th>Flight Type</th> <th>Status</th> </tr> </thead> <tbody> <?php if(count($pireps) > 0) { foreach ($pireps as $pirep) { $pilotinfo = PilotData::getPilotData($pirep->pilotid); $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); if($pirep->accepted == 0) { $status = "PENDING"; } else if($pirep->accepted == 1) { $status = "APPROVED"; } else { $status = "REJECTED"; } echo "<tr>"; echo "<td>'.$pirep->code.$pirep->flighnum.'</td>"; echo "<td>'.$pirep->depicao.'</td>"; echo "<td>'.$pirep->arricao.'</td>"; echo "<td>'.$pirep->aircraft.'</td>"; echo "<td>'.$pirep->flighttime.'</td>"; echo "<td>'.$pilotid.' '.$pilotinfo->firstname.' '.$pilotinfo->lastname.'</td>"; echo "<td>'.$pirep->flighttype.'</th>"; echo "<td>'.$status.'</td>"; echo "</tr>"; } } else { echo "<tr><td>There are no recent flights!</td></tr>"; } ?> </tbody> </table> 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.