Jump to content

Pilot List


eliezerazevedo

Recommended Posts

I would like the list of pilots of my virtual airlines do not show inactive pilots, removed or banned.

In my database is as follows .

<?php

if($userinfo->retired == 0)

echo 'Active';

elseif($userinfo->retired == 1)

echo 'Inactive';

elseif($userinfo->retired == 2)

echo 'Banned';

elseif($userinfo->retired == 3)

echo 'On Leave';

?>

My pilots_list.tpl

<?php echo $page_htmlhead; ?>
<body>
<?php Template::Show('core_navigation.tpl'); ?> <!-- /. main-header -->

   <!-- /. Carousel -->
   <div class="page-acars text-center">
 <div class="container zoomIn animated">

  <h1 class="page-title"> TRIPULANTES <span class="title-under"></span></h1>
 </div>
</div>
   <?php
if(!$allpilots)
{
 echo 'There are no pilots!';
 return;
}
?>
<table id="tabledlist" class="table table-style-1">
<thead>
<tr>
<th>Piloto</th>
<th>Nome</th>
<th>Rank</th>
   <th>VATSIM ID</th>
<th>IVAO</th>
<th>Vôos Realizados</th>
<th>Horas</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><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td>
   <td><?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM'); ?></td>
   <td><?php echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO'); ?></td>
<td><?php echo $pilot->totalflights?></td>
<td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
<?php
}
?>
</tbody>
</table>
<?php Template::Show('footer.tpl'); ?>
   <!-- main-footer -->
   <!-- Scripts -->
   <!-- jQuery -->
   <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
   <script>window.jQuery || document.write('<script src="<?php echo SITE_URL?>/lib/skins/golv/assets/js/jquery-1.11.1.min.js"><\/script>')</script>
   <!-- Bootsrap javascript file -->
   <script src="<?php echo SITE_URL?>/lib/skins/golv/assets/js/bootstrap.min.js"></script>
   <!-- owl carouseljavascript file -->
   <script src="<?php echo SITE_URL?>/lib/skins/golv/assets/js/owl.carousel.min.js"></script>
   <!-- Template main javascript -->
   <script src="<?php echo SITE_URL?>/lib/skins/golv/assets/js/main.js"></script>
   <script src="<?php echo SITE_URL?>/lib/skins/golv/assets/js/modernizr-2.6.2.min.js"></script>
   </body>

Link to comment
Share on other sites

  • Moderators

As you can see, in the file you pasted it has the following commented:

// To skip a retired pilot, uncomment the next line:
//if($pilot->retired == 1) { continue; }

You will have to uncomment it and update it accordingly in order to include the rest of the retired values.

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