Administrators Nabeel Posted January 18, 2010 Administrators Report Posted January 18, 2010 $last_location = PIREPData::getLastReports([PILOT_ID], 1, PIREP_ACCEPTED); echo "This pilot's last location is: {$last_location->arricao}"; Of course, replacing the [PILOT ID] with the variable holding the pilot's ID Quote
Administrators Nabeel Posted January 18, 2010 Author Administrators Report Posted January 18, 2010 Anywhere Quote
faraz Posted January 18, 2010 Report Posted January 18, 2010 HI please check below code : $last_location = PIREPData::getLastReports($pilotid,1, PIREP_ACCEPTED); echo $last_location->arricao; I put that in Pilot_list , But doesn't show Pilot current location ! Quote
Administrators Nabeel Posted January 19, 2010 Author Administrators Report Posted January 19, 2010 Because $pilotid is probably not the right variable replacement which is supposed to go there. Quote
CPC900 Posted January 19, 2010 Report Posted January 19, 2010 Forgive my lack of knowledge, but I don't get it!? What would be the correct variable replacement? Quote
Administrators Nabeel Posted January 19, 2010 Author Administrators Report Posted January 19, 2010 Depends where you're using it. Look in that template file to see where else a pilot ID is being used and mimic it. It could be $pilot->pilotid, or $userinfo->pilotid Quote
AFVA | Mitchell Posted January 19, 2010 Report Posted January 19, 2010 For example: Pilot Center <?php $last_location = PIREPData::getLastReports($pilotcode, 1, PIREP_ACCEPTED); echo "This pilot's last location is: {$last_location->arricao}"; ?> $pilotcode returns the pilot ID (works in pilot center only) Pilot List (Roster) <?php $last_location = PIREPData::getLastReports($pilot->pilotid, 1, PIREP_ACCEPTED); echo "This pilot's last location is: {$last_location->arricao}"; ?> $pilot->pilotid returns the pilotid varible for the $pilot array. Quote
CPC900 Posted January 19, 2010 Report Posted January 19, 2010 I used this after MANY trials and errors. It was the "($pilot->pilotid, 1, PIREP_ACCEPTED);" part that was catching me. I know it seems dumb now that I was having a real bottleneck there. Thanks for help! <td><?php $last_location = PIREPData::getLastReports($pilot->pilotid, 1, PIREP_ACCEPTED); echo $last_location->arricao; ?></td> Quote
AFVA | Mitchell Posted January 19, 2010 Report Posted January 19, 2010 Full Code for Pilot Center (with all the code set up for it): <?php $last_pirep = PIREPData::getLastReports($userinfo->pilotid, 1, PIREP_ACCEPTED); ?> <li><strong>Your Location:</strong><?php echo $lastpirep->arricao.'-'.$lastpirep->arrname; ?></li> Quote
Administrators Nabeel Posted January 19, 2010 Author Administrators Report Posted January 19, 2010 Thanks, Mitchell! Quote
TennShadow Posted January 23, 2010 Report Posted January 23, 2010 Sorry to be a pain here. I've tried <?php $last_pirep = PIREPData::getLastReports($pilotcode, 1, PIREP_ACCEPTED); ?> <li><strong>Your Location:</strong><?php echo $lastpirep->arricao.'-'.$lastpirep->arrname; ?></li> and <?php $last_location = PIREPData::getLastReports($pilotcode, 1, PIREP_ACCEPTED); echo "This pilot's last location is: {$last_location->arricao}"; ?> in the pilot center and it never shows my last location. I filed a manual PIREP after I inserted the code and it didn't work then either. Any ideas I can try? Quote
Administrators simpilot Posted January 23, 2010 Administrators Report Posted January 23, 2010 Try changing $pilotcode to $userinfo->pilotid like this -> <?php $last_location = PIREPData::getLastReports($userinfo->pilotid, 1, PIREP_ACCEPTED); echo "This pilot's last location is: {$last_location->arricao}"; ?> This works for me in the pilot center. Quote
TennShadow Posted January 23, 2010 Report Posted January 23, 2010 That worked! Thanks for the help!! Quote
Artjom Posted February 1, 2010 Report Posted February 1, 2010 How can I make Last location (ICAO) and Airpot name??? Quote
Flightguy123 Posted March 13, 2010 Report Posted March 13, 2010 Is it possible to have the pilot only fly from there last location? Quote
Guest lorathon Posted March 13, 2010 Report Posted March 13, 2010 Yes. We have a search by last location function. A pilot will see all flights originating from where they are. I have also put a last location tag on each filed PIREP so that we can check to be sure that they did fly from the last. Also a pair of images attached to filed PIREP's. If a green plane is attached to the PIREP that pilot flew from last arrival airport. If is red then the pilot did not. Quote
selwynorren Posted March 24, 2010 Report Posted March 24, 2010 Yes. We have a search by last location function. A pilot will see all flights originating from where they are. I have also put a last location tag on each filed PIREP so that we can check to be sure that they did fly from the last. Also a pair of images attached to filed PIREP's. If a green plane is attached to the PIREP that pilot flew from last arrival airport. If is red then the pilot did not. Hi lorathon Would it be possible to share that code you have created? Thanks Selwyn Quote
Guest lorathon Posted March 24, 2010 Report Posted March 24, 2010 Hi lorathon Would it be possible to share that code you have created? Thanks Selwyn I can try and give you some pieces. The code is all over the place. This is at the top of the pirep_pending.tpl in the admin templates. Right below Flight: <?php $last_location = PIREPData::getLastReports($pirep->pilotid, 1, PIREP_ACCEPTED); echo "Pilots last location: {$last_location->arricao}"; ?> This is at the bottom of the pirep_pending.tpl in the admin templates. Right after the cancel <?php if ($last_location->arricao == $pirep->depicao) { echo "<img src='<?php echo SITE_URL?>/lib/images/inair.png'></a>"; } else { echo "<img src='<?php echo SITE_URL?>/lib/images/onground.png'></a>"; } ?> Quote
ThomasH Posted April 10, 2010 Report Posted April 10, 2010 In the pilot roster a table in which the last location (current location) is indicated should appear. In addition I have in the pilots_list.tpl following code: <table width="789" class="tablesorter" id="tabledlist"> <thead> <tr bgcolor="#336699"> <th>Pilot ID</th> <th width="25%">Name</th> <th width="10%">Rank</th> <th width="16%">Flights</th> <th width="23%">Hours</th> <th>Location</th> </tr> </thead> <?php foreach($roster as $pilot) { ?> <tr align="left" valign="middle" bgcolor="#DFF4FF"> <td width="9%" align="right" nowrap> <img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" /> <a href="<?php echo SITE_URL?>/index.php/profile/view/<?php echo $pilot->pilotid?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </td> <td nowrap="nowrap"> <left><?php echo $pilot->firstname.' '.$pilot->lastname?></center> </td> <center><td align="center"><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td></center> <center><td><?php echo $pilot->totalflights?></td></center> <center><td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td></center> <td colspan="2"><center> <?php $last_location = PIREPData::getLastReports($pilot->pilotid, 1, PIREP_ACCEPTED); echo "This pilot's last location is: {$last_location->arricao}"; ?> </tbody> </table> Then I get the error message in the browser: Parse error: syntax error, unexpected $end in /kunden/265414_32756/html/phpvms/core/templates/pilots_list.tpl on line 45 Where is the mistake? Greetings Thomas Quote
Moderators mark1million Posted April 10, 2010 Moderators Report Posted April 10, 2010 What is your line 45? Quote
ThomasH Posted April 10, 2010 Report Posted April 10, 2010 What is your line 45? ah sorry 37 <center><td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td></center> 38 <td colspan="2"><center> 39 <?php 40 $last_location = PIREPData::getLastReports($pilot->pilotid, 1, PIREP_ACCEPTED); 41 42 echo "This pilot's last location is: {$last_location->arricao}"; 43 ?> 44 </tbody> 45 </table> Quote
ThomasH Posted April 11, 2010 Report Posted April 11, 2010 Does know to no answer, how does one make this right? Quote
Administrators simpilot Posted April 11, 2010 Administrators Report Posted April 11, 2010 You never close the foreach loop or the last table cell or row. try adding this between 43 and 44. </td> </tr> <?php } ?> Quote
ThomasH Posted April 12, 2010 Report Posted April 12, 2010 Yes exactly this it was. Small cause - big effect. I thank you. Quote
Jacob Armstrong Posted July 15, 2010 Report Posted July 15, 2010 I can try and give you some pieces. The code is all over the place. This is at the top of the pirep_pending.tpl in the admin templates. Right below Flight: <?php $last_location = PIREPData::getLastReports($pirep->pilotid, 1, PIREP_ACCEPTED); echo "Pilots last location: {$last_location->arricao}"; ?> This is at the bottom of the pirep_pending.tpl in the admin templates. Right after the cancel <?php if ($last_location->arricao == $pirep->depicao) { echo "<img src='<?php echo SITE_URL?>/lib/images/inair.png'></a>"; } else { echo "<img src='<?php echo SITE_URL?>/lib/images/onground.png'></a>"; } ?> I don't see a pirep_pending.tpl in my templates folder under the admin subfolder. I looked in the folder that I uploaded to my ftp and have found that it was not there. Quote
Guest lorathon Posted July 15, 2010 Report Posted July 15, 2010 The pirep_pending.tpol has been discontinued. The new template for pireps in the admin section is pireps_list.tpl. Quote
Jacob Armstrong Posted July 15, 2010 Report Posted July 15, 2010 The pirep_pending.tpol has been discontinued. The new template for pireps in the admin section is pireps_list.tpl. Ok. Thanks! It works now. Quote
Marmus Posted October 19, 2012 Report Posted October 19, 2012 Hi All, I am new here, sorry is a stupid question, I searched and this was the closest topic that fit what I am loking for.... ...is there a way to get the pilot's last location to show on the Live Map, as a static icon with label until the next flight? Thanks Marmus 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.