Virtualei Posted September 18, 2012 Report Share Posted September 18, 2012 Hi all, If a pilot files a manual pirep it gives a landing rate of 0. I understand why this happens but I have been reading this post http://forum.phpvms....t-modification/ and would like to use it. I think I display it a different way as I keep getting errors. I have it on my front page and this is my code. <h2>LAST FIVE FLIGHTS</h2> <div style="width:550px;height:130px;border:2px solid green;"> <?php> $count = 5; $pireps = PIREPData::getRecentReportsByCount($count); ?> <div> <table> <thead> <tr> <th>Flight </th> <th>Departure</th> <th>Arrival</th> <th>Duration</th> <th>Pilot</th> <th>Landing Rate</th> </tr> </thead> <tbody> </div> <?php if(count($pireps) > 0) { foreach ($pireps as $pirep) { $pilotinfo = PilotData::getPilotData($pirep->pilotid); $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); echo '<td>'.$pirep->code.$pirep->flightnum.'</td>'; echo '<td>'.$pirep->depicao.'</td>'; echo '<td>'.$pirep->arricao.'</td>'; echo '<td>'.$pirep->flighttime.'</td>'; echo '<td>'.$pilotid.' '.$pilotinfo->firstname.' '.$pilotinfo->lastname.'</td>'; echo '<td>'.$pirep->landingrate.'</td>'; echo '</tr>'; } } else { echo '<tr><td colspan="6">There are no recent flights!</td></tr>'; } ?> </table> </div> Can anyone tell me how to change the code to get it to work. Thanks in advance. Alan Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted September 18, 2012 Moderators Report Share Posted September 18, 2012 Instead of this: echo '<td>'.$pirep->landingrate.'</td>'; Write this: if($pirep->landingrate == "0") { echo '<td> No record </td>'; } else { echo '<td>'.$pirep->landingrate.' ft/m </td>' } Quote Link to comment Share on other sites More sharing options...
Virtualei Posted September 18, 2012 Author Report Share Posted September 18, 2012 Hi Parko thanks for answering. I am getting this mate Parse error: syntax error, unexpected '}', expecting ',' or ';' in /home/airlingu/public_html/lib/skins/brilliancev1/frontpage_main.tpl on line 133 Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted September 18, 2012 Moderators Report Share Posted September 18, 2012 if($pirep->landingrate == "0") { echo '<td> No record </td>'; } else { echo '<td>'.$pirep->landingrate.' ft/m </td>'; } Try this Quote Link to comment Share on other sites More sharing options...
Virtualei Posted September 18, 2012 Author Report Share Posted September 18, 2012 Cheers my good friend all working now Alan Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted September 18, 2012 Moderators Report Share Posted September 18, 2012 Persians say "Salamaty" means Cheers Quote Link to comment Share on other sites More sharing options...
Virtualei Posted September 18, 2012 Author Report Share Posted September 18, 2012 Persians say "Salamaty" means Cheers Salamaty Quote Link to comment Share on other sites More sharing options...
FlyingMachine Posted May 5, 2013 Report Share Posted May 5, 2013 Good morning PHPVMSS how i can put this code only in first page mean index not others pasge i try in layout but the code appears in all pages thanks in advence Quote Link to comment Share on other sites More sharing options...
freshJet Posted May 5, 2013 Report Share Posted May 5, 2013 frontpage_main.tpl 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.