Taran Posted December 16, 2013 Report Share Posted December 16, 2013 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 2 Quote Link to comment Share on other sites More sharing options...
Taran Posted December 18, 2013 Author Report Share Posted December 18, 2013 Anyone know a way? Quote Link to comment Share on other sites More sharing options...
Taran Posted December 18, 2013 Author Report Share Posted December 18, 2013 Maybe a way of using a SUM function to add the stats from the airports within that region? If this would work could someone show how to do that? Quote Link to comment Share on other sites More sharing options...
Taran Posted December 21, 2013 Author Report Share Posted December 21, 2013 Or maybe a way to get the stats between certain lat/long? Anyone???? Quote Link to comment Share on other sites More sharing options...
Taran Posted December 22, 2013 Author Report Share Posted December 22, 2013 Still nothing? :/ Quote Link to comment Share on other sites More sharing options...
Taran Posted January 4, 2014 Author Report Share Posted January 4, 2014 I'm guessing this is not possible and calling it quits? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted January 6, 2014 Administrators Report Share Posted January 6, 2014 Tom has a robust Hub Stats class here -> https://github.com/t...erritt/HubStats Why not use that and call the airports you want to include in a region and just add them together on the fly? <?php $flights = (HubStats::CountFlights(ABCD) + HubStats::CountFlights(EFGH) + HubStats::CountFlights(IJKL)); ?> Quote Link to comment Share on other sites More sharing options...
Taran Posted January 6, 2014 Author Report Share Posted January 6, 2014 I didn't even think about that! Thanks! Quote Link to comment Share on other sites More sharing options...
Taran Posted January 17, 2015 Author Report Share Posted January 17, 2015 I never could get this to work. Any other ideas for this? Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted January 18, 2015 Moderators Report Share Posted January 18, 2015 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! Quote Link to comment Share on other sites More sharing options...
Taran Posted January 18, 2015 Author Report Share Posted January 18, 2015 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. Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted January 18, 2015 Moderators Report Share Posted January 18, 2015 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));?> Quote Link to comment Share on other sites More sharing options...
Taran Posted January 19, 2015 Author Report Share Posted January 19, 2015 That worked! Could you post the code to pull the Hours? Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted January 19, 2015 Moderators Report Share Posted January 19, 2015 This should do the trick. <?php echo (HubStats::TotalHours(KATL) + HubStats::TotalHours(KBOS) + HubStats::TotalHours(KSEA));?> Cheers! Quote Link to comment Share on other sites More sharing options...
Taran Posted January 19, 2015 Author Report Share Posted January 19, 2015 Awesome! How about if I want to get the entire roster of pilots within this region? would it be the same? Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted January 19, 2015 Moderators Report Share Posted January 19, 2015 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! Quote Link to comment Share on other sites More sharing options...
Taran Posted January 19, 2015 Author Report Share Posted January 19, 2015 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? Quote Link to comment Share on other sites More sharing options...
Taran Posted January 24, 2015 Author Report Share Posted January 24, 2015 anyone? Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted January 25, 2015 Moderators Report Share Posted January 25, 2015 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 } ?> Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted January 25, 2015 Moderators Report Share Posted January 25, 2015 Uhhh, I think you want a roster within the region with multiple hubs? Quote Link to comment Share on other sites More sharing options...
Taran Posted January 27, 2015 Author Report Share Posted January 27, 2015 yes to Kyle. i want all the pilots from each of the region's hubs on one list Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.