Curshad Posted November 5, 2014 Report Share Posted November 5, 2014 Please can anyone assist me with a coding problem I am having? This is for the ocean blue front page recent.tpl Basically I just want this: "Latest Flights" (Image was photo edited) The Airline Tab is what I want but i cant figure the coding out. I always seem to be onto something but then nothing :/ Here's the coding what i have so far: <?php $count = 10; $pireps = PIREPData::getRecentReportsByCount($count); ?> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ocean_table"> <tr> <th>Airline</th> <th>Flight</th> <th>Pilot</th> <th>Departure</th> <th>Arrival</th> <th>Aircraft</th> <th>Duration</th> <th>V/S</th> <th>Info</th> </tr> <?php if (count($results) > 0); if (count($pireps) > 0) { foreach ($results as $flight); foreach ($pireps as $pirep) { $pilotinfo = PilotData::getPilotData($pirep->pilotid); $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); $acrid = OperationsData::getAircraftByReg($pirep->registration); $results = ACARSData::GetACARSData(); $fcode = substr($flight->flightnum, 0, 3); echo '<tr>'; if($fcode == SIL) echo '<td><img src="http://greenvillems.org/wp-content/uploads/2012/11/Silver-Logo.jpg" width="120" height="35"/></td>'; elseif($fcode == SBM) echo '<td><img src="http://tblocations-airlinelogores.s3.amazonaws.com/200-75-4c3f16e6579e2-sky-bahamas-google-chrome-15-7-2010-160848-bmp.jpg" width="120" height="35"/></td>'; echo '<td><a href="'.SITE_URL.'/index.php/pireps/viewreport/'.$pirep->pirepid.'">'.$pirep->code.$pirep->flightnum.'</a></td>'; echo '<td><a href="'.SITE_URL.'/index.php/profile/view/'.$pilotinfo->pilotid.'">'.$pilotinfo->firstname.' '.$pilotinfo->lastname.'</a></td>'; echo '<td>'.$pirep->depicao.'</td>'; echo '<td>'.$pirep->arricao.'</td>'; echo '<td>'.$pirep->aircraft.'</td>'; echo '<td>'.$pirep->flighttime.'</td>'; echo '<td>'.$pirep->landingrate.' ft/m</td>'; if($pirep->accepted == PIREP_ACCEPTED) echo '<td><span class="label label-important"><font color="green">Accepted</font></span></td>'; elseif($pirep->accepted == PIREP_REJECTED) echo '<td><span class="label label-important"><font color="red">Rejected</font></span></td>'; elseif($pirep->accepted == PIREP_PENDING) echo '<td><span class="label label-warning"><font color="orange">Pending</font></span></td>'; elseif($pirep->accepted == PIREP_INPROGRESS) echo '<td>On Progress</td>'; echo '</tr>'; } } else { echo '<tr><td>There are no recent flights!</td></tr>'; } ?> </tbody> </table> <div class="clear"></div> <div class="clear"></div> And in my old template i got the airline thing to show up with this coding: <?php $results = ACARSData::GetACARSData(); if (count($results) > 0) { foreach($results as $flight) { ?> <tr> <td align="center"><?php $fcode = substr($flight->flightnum, 0, 3); if($fcode == 'SIL') {echo '<img src="http://greenvillems.org/wp-content/uploads/2012/11/Silver-Logo.jpg" width="120" height="35"/>';} elseif($fcode == 'SBM') {echo '<img src="http://tblocations-airlinelogores.s3.amazonaws.com/200-75-4c3f16e6579e2-sky-bahamas-google-chrome-15-7-2010-160848-bmp.jpg" width="120" height="35"/>';} ?></td> Here's an image of what It looks like: So please anyone that could help can you? I tried and tried some tweaking and stuff but that echo '<td> other coding info</td>; Makes it difficult. :( 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.