Jump to content

Pilot List repeats itself? [SOLVED]


James142

Recommended Posts

If you click on this link: http://flyirelandva....ndex.php/pilots, you can see the list keeps repeating itself in every airport? How do I get rid of the airport heading thats on top?

The code that I have in the pilots_list.tpl file is:

 

<h3><?php echo $title?></h3>

<?php $roster = PilotData::getAllPilots();  ?> 
<?php 
  if(!$roster) 
  { 
 	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>HUBs</th> 
</tr> 
</thead> 
<tbody> 
<?php foreach($roster as $pilot) { ?> 
<tr> 
  <td width="1%" 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> 


 	<center><?php echo $pilot->firstname.' '.$pilot->lastname?></center> 
  </td> 
  <center><td><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> 
  <center><td><?php echo $pilot->hub?></td></center> 
</tr> 
<?php } ?> 
</tbody> 
</table>

Link to comment
Share on other sites

  • Moderators

Hey i like your site it look very good, clean layout, how do you get the acars info in the scrolling marquee :) if you wouldnt mind sharing.

As for the pilots list i have an example of all the pilots with out the airports for aerosoft so they can verify my guys hours,

<h3>Hours Validation</h3>
<p>To Quick search name or pilot id hit Ctrl + F and and type in data.</p>
<?php

  if(!$allpilots)

  {

     echo 'There are no pilots!</div>';

     return;

  }

?>

<table width="380" cellspacing="1" cellpadding="5" border="1">
 <thead>
   <tr>
     <th width="60px">Pilot ID</th>
     <th width="200px">Name</th>
     <th width="55px">Hours</th>
     <th width="65px">Active/Inactive</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');

   */

?>

<tr>

  <td width="1%" nowrap><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>

     <div align="left"><img src="<?php echo Countries::getCountryImage($pilot->location);?>" 

        alt="<?php echo Countries::getCountryName($pilot->location);?>" />
<?php echo $pilot->firstname.' '.$pilot->lastname?>
        </div></td>
  <td><div align="center"><?php echo $pilot->totalhours?></div></td>
<td><div align="center"><?php
   If ($pilot->retired == 0)
         { echo '<img src="/images/green-status.gif" />'; }
   else
         { echo '<img src="/images/red-status.gif" />'; }
?></div></td></div></td>
<?php

}

?>
</div>
</tbody>
</table>

You get the idea so you can add or remove columns as you wish

Link to comment
Share on other sites

Hey i like your site it look very good, clean layout, how do you get the acars info in the scrolling marquee :) if you wouldnt mind sharing.

As for the pilots list i have an example of all the pilots with out the airports for aerosoft so they can verify my guys hours,

<h3>Hours Validation</h3>
<p>To Quick search name or pilot id hit Ctrl + F and and type in data.</p>
<?php

  if(!$allpilots)

  {

     echo 'There are no pilots!</div>';

     return;

  }

?>

<table width="380" cellspacing="1" cellpadding="5" border="1">
 <thead>
   <tr>
     <th width="60px">Pilot ID</th>
     <th width="200px">Name</th>
     <th width="55px">Hours</th>
     <th width="65px">Active/Inactive</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');

   */

?>

<tr>

  <td width="1%" nowrap><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>

     <div align="left"><img src="<?php echo Countries::getCountryImage($pilot->location);?>" 

    	alt="<?php echo Countries::getCountryName($pilot->location);?>" />
<?php echo $pilot->firstname.' '.$pilot->lastname?>
    	</div></td>
  <td><div align="center"><?php echo $pilot->totalhours?></div></td>
<td><div align="center"><?php
   If ($pilot->retired == 0)
         { echo '<img src="/images/green-status.gif" />'; }
   else
         { echo '<img src="/images/red-status.gif" />'; }
?></div></td></div></td>
<?php

}

?>
</div>
</tbody>
</table>

You get the idea so you can add or remove columns as you wish

Thank you so much! As for the acars info in the scrolling marquee, I put this code in the layout.tpl:

<div class="green_background">

<?php
$pilotsflying = count(ACARSData::GetACARSData()); 
   	echo '<marquee align="left" direction="left" onmouseover="this.stop();" onmouseout="this.start();" behavior="scroll" width="900">';
   	if($pilotsflying > 0)
       	{ echo 'There is currently '.$pilotsflying.' XACARS flight(s) - Click <a href="'.SITE_URL.'/index.php/acars">here</a> to view'; }
       	else
       	{ echo 'There are currently no XACARS flights'; }
   	echo '</marquee>';
?></div>

Then put this code into the Style.css file:

.green_background{ 
           	border:solid 1px #349534;  
           	background:#6DFC6F; 
           	color:#008000; 
           	font-weight:bold #000000;
           	font color:#000000; 
           	padding:4px; 
           	text-align:center; 
   	}

Link to comment
Share on other sites

Can you post your code for that list and ill have a look,

with that code this is the results with my VA but this is on a separate page with an include,

http://www.easyjetva.../Aerosoftid.php

<h3><?php echo $title?></h3>
<?php
if(!$allpilots)
{
 echo '';
 return;
}
?>

<table width="380" cellspacing="1" cellpadding="5" border="1"> 
 <thead> 
<tr> 
 	<th width="60px">Pilot ID</th> 
 	<th width="100px">Name</th> 
 	<th width="80px">Rank</th>
 	<th width="55px">Hours</th> 
 	<th width="65px">Active?</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'); 

*/ 

?> 

<tr> 

  <td width="1%" nowrap><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> 

 	<div align="left"><img src="<?php echo Countries::getCountryImage($pilot->location);?>"  

   	alt="<?php echo Countries::getCountryName($pilot->location);?>" /> 
<?php echo $pilot->firstname.' '.$pilot->lastname?> 
   	</div></td> <td ALIGN=center><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td>

  <td><div align="center"><?php echo $pilot->totalhours?></div></td> 
<td><div align="center"><?php 
If ($pilot->retired == 0) 
     	{ echo '<img src="/images/yes.png" />'; } 
else 
     	{ echo '<img src="/images/no.png" />'; } 
?></div></td></div></td> 
<?php 

} 

?> 
</div> 
</tbody> 
</table>

(the code you gave me)

http://flyirelandva....ndex.php/pilots But the airports that have no pilots there are still showing up :(

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