Jump to content

Recommended Posts

Posted

Does anybody know a way for me to get the stats for a certain region?

We're wanting to run our airline by Regions instead of HUBS (our Regions would obviously consist of a large part of a continent).

Is there a way for us to get the stats for different regions (like you can do with HUBs)?

Maybe a code to get the stats for multiple airports and have them all add together?

Please help!

Thanks in advance,

Taran

  • Like 2
  • 2 weeks later...
  • 1 year later...
  • Moderators
Posted

I never could get this to work. Any other ideas for this?

What are you trying to do? Can you post the error and the code here?

Cheers!

Posted

I'm trying to get the stats for multiple hubs to add automatically and show as one number. i.e. our North American region has 3 hubs (KATL,KBOS,KSEA) I want the stats for those hubs to be pulled as one. when I try it the way simpilot said it just shows nothing.

  • Moderators
Posted

I'm trying to get the stats for multiple hubs to add automatically and show as one number. i.e. our North American region has 3 hubs (KATL,KBOS,KSEA) I want the stats for those hubs to be pulled as one. when I try it the way simpilot said it just shows nothing.

Try this...

<?php echo (HubStats::CountFlights(KATL) + HubStats::CountFlights(KBOS) + HubStats::CountFlights(KSEA));?>

  • Moderators
Posted

This should do the trick.

<?php echo (HubStats::TotalHours(KATL) + HubStats::TotalHours(KBOS) + HubStats::TotalHours(KSEA));?>

Cheers! ;)

  • Moderators
Posted

Awesome! How about if I want to get the entire roster of pilots within this region? would it be the same?

Here's the counting function for the pilots...

<?php echo (HubStats::CountPilots(KATL) + HubStats::CountPilots(KBOS) + HubStats::CountPilots(KSEA));?>

Cheers! ;)

Posted

That's to get the number of pilots. Is there a way to get a single roster for this region? I want to make a Region page so I want to get a roster put together to show all the pilots of the HUBs within the region all in one. Is there a way?

  • Moderators
Posted

Sorry, for the late response.

Here's the code how you would get the pilot list... ;)

<?php $hubpilots = HubStats::Pilots(KATL);?>
<?php if(!$hubpilots)
{
 echo 'There are no pilots in this hub!';
 return;
}
else
{
?>
<table id="tabledlist" class="tablesorter">
<thead>
<tr>
<th>Pilot ID</th>
<th>Name</th>
<th>Rank</th>
<th>Flights</th>
<th>Hours</th>
</tr>
</thead>
<tbody>
<?php
foreach($hubpilots 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 $pilot->totalflights?></td>
<td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
<?php
}
?>
</tbody>
</table>
<?php
}
?>

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