TB1 Posted December 21, 2013 Report Share Posted December 21, 2013 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> 1 Quote Link to comment Share on other sites More sharing options...
StartVM Posted December 26, 2013 Report Share Posted December 26, 2013 I am not positive if this is what you are looking for but here is what I resolved. http://pastebin.com/kyVCzZBF Quote Link to comment Share on other sites More sharing options...
TB1 Posted December 26, 2013 Author Report Share Posted December 26, 2013 I found a fix but thanks anyway 1 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.