Jump to content

Current Pilot Position


alwaysva

Recommended Posts

I've got: /core/templates/pilot_list.tlp

section where you need to insert:

></td>

<td><?php echo $pilot->totalflights?></td>

<td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>

<?php

$params = (array('a.registration'=>$aircraft->registration, 'p.accepted'=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location = $pirep[0]->arricao;

$current_location2 = $pirep[0]->arrname;

?>

<td>Here

Link to comment
Share on other sites

  • Moderators

></td>
<td><?php echo $pilot->totalflights?></td>
<td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
<td><?php echo $report->arricao; ?></td>
<?php
$params = (array('a.registration'=>$aircraft->registration, 'p.accepted'=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);
$current_location = $pirep[0]->arricao;
$current_location2 = $pirep[0]->arrname;
?>

<td>Here

I think you can understand what will we do.

Link to comment
Share on other sites

It's not working yet.

how? to do that?

That's my code:

<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>PID</th>

<th>Rank</th>

<th>Flights</th>

<th>Hours</th>

<th>Current Position</th>

</tr>

</thead>

<tbody>

<?php

foreach($allpilots as $pilot)

{

/*

To include a custom field, use the following example:

<td>

<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>

</td>

For instance, if you added a field called "IVAO Callsign":

echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign');

*/

// To skip a retired pilot, uncomment the next line:

//if($pilot->retired == 1) { continue; }

?>

<tr>

<td width="1%" 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><?php echo $pilot->vatsim_PID?> </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><?php echo $report->arricao; ?></td>

<?php

}

?>

</tbody>

</table>

Edited by alwaysva
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...