Jump to content

Show pilot rank & aircraft rank in details of pirep [Solved]


ARV187

Recommended Posts

Hi there,

1- I want modify pireps_list.tpl to show pilot rank & aircraft rank. Its because that i want verify if the pilot used the right aircraft to their pilot rank.

The pilot rank work, but not the aircraft rank.

2- By other side i think that i see a id number (corresponding with aircraft rank) i can show this rank in words and not in id number? How???

<tr>
<td><strong>Rango de piloto: </strong><?php echo $pirep->pilots. " ($pirep->rank)";?></td>
<td><strong>Rango de aeronave: </strong><?php echo $aircraft->minrank. " ($aircraft->minrank)";?></td>
</tr>

*rango de piloto= pilot rank.

*rango de aeronave= aircraft rank.

Click to see image attached:

post-5667-0-88141400-1394186955_thumb.jpg

Link to comment
Share on other sites

  • Members

Copy and paste this in pirep_viewreport.tpl where you want to display it

What it does in each pirep view it displays a line

  • Rank Control: Min rank for B737-800 is First Office Pilots Rank is New Hire

Basec on the airplane and pilots rank

<li><strong>Rank Control: </strong>
<?php $acinfo=(OperationsData::getAircraftByReg($pirep->registration));
$acrankname=RanksData::GetRankInfo($acinfo->minrank);
$pilotInfo= PilotData::getPilotData($pirep->pilotid);
$pilotrank=$pilotInfo->rank ;
echo "Min rank for ",$pirep->aircraft," is ",$acrankname->rank," Pilots Rank is ",$pilotrank ;?></li>

Small demo

http://www.baggelis.com/phpvms/index.php/pireps/view/46

  • Like 1
Link to comment
Share on other sites

Thank you very much!! I needed that to admin pireps page, I wrote the code in pirep_viewreport.tpl, and in pireps_list.tpl to admin staff (accept, reject,...)

In pireps_list.tpl its:

<td><strong>Flight Time: </strong> <?php echo $pirep->flighttime_stamp; ?></td>
<td><strong>Distance: </strong><?php echo $pirep->distance; ?> </td>
<td><strong>Landing Rate: </strong><?php echo $pirep->landingrate; ?> </td>
</tr>
<tr>
<td><strong>Rank Control: </strong>
<?php $acinfo=(OperationsData::getAircraftByReg($pirep->registration));
$acrankname=RanksData::GetRankInfo($acinfo->minrank);
$pilotInfo= PilotData::getPilotData($pirep->pilotid);
$pilotrank=$pilotInfo->rank ;
echo "Min rank for ",$pirep->aircraft," is ",$acrankname->rank," <br /> Pilots Rank is ",$pilotrank ;?></td>
</tr>
<tr>
<td colspan="5"><strong>Route: </strong><?php echo $pirep->route;?>

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