ARV187 Posted March 7, 2014 Report Posted March 7, 2014 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: Quote
Moderators servetas Posted March 8, 2014 Moderators Report Posted March 8, 2014 Replace this: <?php echo $pirep->pilots. " ($pirep->rank)";?> with this: <?php $pilot_data = PilotData::getPilotData($pirep->pilots); echo $pilot_data->rank; ?> PS: Did not check if it works. Just give it a try. Quote
ARV187 Posted March 8, 2014 Author Report Posted March 8, 2014 Hi servetas, That is to show pilot rank?, was working to my with first code, but my trouble is to show min aircraft rank. I dont know how make it. Quote
ARV187 Posted March 13, 2014 Author Report Posted March 13, 2014 Nothing to solvent this? please... Quote
Members Vangelis Posted March 15, 2014 Members Report Posted March 15, 2014 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 1 Quote
ARV187 Posted March 15, 2014 Author Report Posted March 15, 2014 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;?> Quote
Members Vangelis Posted March 15, 2014 Members Report Posted March 15, 2014 I realized it after i pressed post that you want it for another template but wherever you put it should work . So as far as i understand this code is what you wanted and it is working right ? Quote
ARV187 Posted March 15, 2014 Author Report Posted March 15, 2014 Yes, its working Great!! Thanks! Quote
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.