CPC900
January 10, 2010, 7:29pm
1
I just want to add to the “pilots_list.tpl” where the pilot last landed at after the total hours are listed. Now, I can obviously add <th>Last Location</th> for the option in the table but how/where to I get that data from?? I am a bit confused how I would code that?! I want to pull the Last entry in pireps:arricao in the database for the pilot, but I am at a loss for how to code the line pertaining to it. I was thinking:
<td><?php echo PilotData::GetFieldValue($pireps->arricao, ‘Last Location’); ?></td>
But that is obviously stupid
faraz
January 10, 2010, 7:40pm
2
I used This Code :
<?php
if(!$report)
{
echo $pilot->hub
;
}
?>
<?php echo $report->arricao
; ?>
</td>
CPC900
January 10, 2010, 7:53pm
3
So that code was used in your ‘pilots_list.tpl’???
faraz
January 10, 2010, 8:10pm
4
Yes.
i use that Code In pilots_list !!
<th bgcolor=#F2F2F2>Location</th>
<td bgcolor=#FFFFFF width=10% height=5 align=center><font face=Tahoma color=#7E7E7E size=2><?php
if(!$report)
{
echo $pilot->hub
;
}
?>
<?php echo $report->arricao
; ?>
</td>
nabeel
January 11, 2010, 2:11am
5
If you do a search, this has come up before. I will search it tomorrow too
faraz
January 11, 2010, 2:14pm
6
HI
That code is not working ?
Is it possible to get the last airport landed at BY aircraft?
So it will be like:
<?php echo OperationsData::GetLastAirport($aicraftreg)
Thanks in advance!
Mitch
CPC900
January 17, 2010, 6:53pm
10
Sorry for beating a dead horse, but…
I was wrong about Faraz’s code. It only ends up showing the Hub that the pilot belongs to. Is there a way to add the Last airport the pilot landed at?? Did this get added, or no?? Sorry to ask again.
nabeel
January 17, 2010, 7:39pm
11
If you do a search the code is out there
CPC900
January 17, 2010, 8:32pm
12
I saw the code for showing where the aircraft last landed at, but not the pilots last arricao?! I will look again…
CPC900
January 17, 2010, 8:45pm
13
I am pretty sure you are referring to this thread, but I sill can’t get it to display correctly. I want to add this function to my “pilots_list.tpl”?!
faraz
January 17, 2010, 9:07pm
14
HI
why $pirep->arricao doesn’t show pilot location in Pilot page ( Roster ) ?
?>
<?php echo $report->arricao
; ?>
CPC900
January 17, 2010, 9:31pm
15
Ok, here is what I have. It only shows the Hub of the pilot. What am I missing?! I am a bit slow on this one. :-[
<h3><?php echo $title?></h3>
<?php
if(!$allpilots)
{
echo ‘There are no pilots!’;
return;
}
?>
<table id=“tabledlist” class=“tablesorter”>
<thead>
<tr>
<th>Pilot ID</th>
<th>Name</th>
<th>Rank</th>
<th>Flights</th>
<th>Hours</th>
<th>Last Location</th>
</tr>
</thead>
<tbody>
<?php
foreach($allpilots as $pilot)
{
?>
<tr>
<td width=“20%” nowrap><a href=“<?php echo url(‘/profile/view/’.$pilot->pilotid);?>”>
<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a>
</td>
<td>
<img src=“<?php echo Countries::getCountryImage($pilot->location);?>”
alt=“<?php echo Countries::getCountryName($pilot->location);?>” />
<?php echo $pilot->firstname.’ '.$pilot->lastname?>
</td>
<td><img src=“<?php echo $pilot->rankimage?>” alt=“<?php echo $pilot->rank;?>” /></td>
<td><?php echo $pilot->totalflights?></td>
<td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
<td align=center><?php
if(!$report)
{
echo $pilot->hub
;
}
?>
<?php echo $report->arricao
; ?>
</td>
<?php
}
?>
</tbody>
</table>
CPC900
January 18, 2010, 10:01pm
18
Thanks Nabeel!! I had some trouble grasping that one. I have never claimed to be that smart! ;D