Jump to content

Recommended Posts

Guest lorathon
Posted

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>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...