Jump to content

Recommended Posts

Posted

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

  • Moderators
Posted

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>'
 }

Posted

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

  • 7 months later...

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