Jump to content

Pilot roster duplicates [SOLVED]


Edwin

Recommended Posts

I'm having the problem that when I add a second hub into my VA, all pilots are duplicated, so you see every pilot twice.

I looked everywhere on the forum, but can't seem to find the correct search keys to find a solution for this.

Basically what I would like to have is that my list is sorted by hub without any duplications from other hubs.

Hope someone can help me or guide me into the correct direction.

Thanks in advance!

(note that i tried several codes found on the forum, but they all duplicate the table, so it must be in something else, but no idea where)

Link to comment
Share on other sites

Please take a test this on your page scripit

Pilots_list.tpl

<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
<div class="cufon underline" style="width:auto; padding:5px; margin-top:10px; margin-bottom:10px; border-bottom: 3px solid; font-size: 24px;">Pilots</div>
<?php
if(!$allpilots)
{
echo 'There are no pilots!';
return;
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tbody>
</tbody>
 <td width="9%" height="10" align="center" bgcolor="#e97714" class="roster_header style1">Piloto ID</td>
 <td width="23%" height="10" align="center" bgcolor="#e97714" class="roster_header style1">Name</td>
<td width="10%" height="10" align="center" bgcolor="#e97714" class="roster_header style1">Rank</td>
<td width="7%" height="10" align="center" bgcolor="#e97714" class="roster_header style1">Flight</td>
<td width="11%" height="10" align="center" bgcolor="#e97714" class="roster_header style1">Hours</td>
<td width="10%" height="10" align="center" bgcolor="#e97714" class="roster_header style1">Lasted Flight </td>
<td width="10%" height="10" align="center" bgcolor="#e97714" class="roster_header style1">Status</td>
<?php
foreach($allpilots as $pilot)
{

// To skip a retired pilot, uncomment the next line:
//if($pilot->retired == 1) { continue; }
?>
<tr class="roster_data" style="height: 20px;">
<td height="10" class="roster_data" align="center" style="border-bottom:1px dotted #CCCCCC"><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </td>
<td height="10" class="roster_data" align="center" style="border-bottom:1px dotted #CCCCCC"><img src="<?php echo Countries::getCountryImage($pilot->location);?>"
alt="<?php echo Countries::getCountryName($pilot->location);?>" /> <?php echo $pilot->firstname.' '.$pilot->lastname?> </td>
<td height="10" class="roster_data" align="center" style="border-bottom:1px dotted #CCCCCC"><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td>
<td height="10" class="roster_data" align="center" style="border-bottom:1px dotted #CCCCCC"><?php echo $pilot->totalflights?></td>
<td height="10" class="roster_data" align="center" style="border-bottom:1px dotted #CCCCCC"><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
<td height="10" class="roster_data" align="center" style="border-bottom:1px dotted #CCCCCC"><?php
if($pilot->lastpirep == 0)
{
echo 'None';
}

else
{
$report = PIREPData::GetLastReports($pilot->pilotid, 1);
echo date('d/m/Y', strtotime($report->submitdate));
}
?> </td>
<td height="10" class="roster_data" align="center" style="border-bottom:1px dotted #CCCCCC"><?php
if($pilot->retired == '1')
{echo '<font class="inactive">Inactive</font>';}
 else
 {echo '<font class="active">Active</font>';}
?></td>
<?php
}
?>
</tr>
</table>

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