Jump to content

Flight Board Code Help


TB1

Recommended Posts

Hi guys,

This is my code for a live flight board on my frontpage.

Can anyone suggest an addition to the code which would mean that when a pilot bids on a flight, it will appear on the flight board as 'In Flight'.

Thanks!

<div class="row-fluid">
<div class="span12">
<div class="box">
<table width="100%" border="0" bordercolor="#FFFFFF">
<h3><center>Latest Flights</h3>
</div>
<?php
$count = 5;
$pireps = PIREPData::getRecentReportsByCount($count);
?>

<style type="text/css">
table th { text-align: center; color:black; font-weight:bold;}
table td { text-align: center; }
</style>
<thead>
<tr>
<style type="text/css">
{ text-align: center; }
</style>
<th>Flight Number</th>
<th>Pilot</th>
<th>Departure</th>
<th>Arrival</th>
<th>Flight Duration</th>
<th>Aircraft</th>
<th>Date & Time Submitted (GMT)
<th>Flight Status</th>
</tr>
</font>
<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 = 'REJECTED';
if($pirep->accepted == '1') $status = 'ACCEPTED';
else $status = 'PENDING';

/*$aircraft = OperationsData::getAircraftInfo($pirep->aircraft);*/
}
?>
<tr>
<td class="small"><a href="<?php echo SITE_URL?>/index.php/pireps/view/<?php echo '' . $pirep->pirepid . ''; ?>"><?php echo $pirep->code.$pirep->flightnum; ?></a></td>
<td class="small"><a href="<?php echo SITE_URL?>/index.php/profile/view/<?php echo '' . $pilotinfo->pilotid . ''; ?>"><?php echo $pilotinfo->firstname.' '.$pilotinfo->lastname; ?></td>
<td class="small"><?php echo $pirep->depicao; ?></td>
<td class="small"><?php echo $pirep->arricao; ?></td>
<td class="small"><?php echo $pirep->flighttime; ?></td>
<td class="small"><?php echo $pirep->aircraft; ?></td>
<td class="small"><?php echo date(DATE_FORMAT, $pirep->submitdate); ?> at <?php echo date('H:i', $pirep->submitdate);?></td>
<td class="small"><?php

if($pirep->accepted == PIREP_ACCEPTED)
echo '<font color="green">Arrived</font>';
elseif($pirep->accepted == PIREP_REJECTED)
echo '<font color="red">Rejected</font>';
elseif($pirep->accepted == PIREP_PENDING)
echo '<font color="orange">Awaiting Information</font>';
elseif($pirep->accepted == PIREP_INPROGRESS)
echo '<font color="blue">In Flight</font>';

?>
</td>
</tr>
<?php
}
}
else
{
echo '<tr><td>There are no recent flights!</td></tr>';
}
?>



</tbody>
</div>
</table>

  • Like 1
Link to comment
Share on other sites

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...