Jump to content

Airline Stats


mattsmith

Recommended Posts

  • Moderators

Number of Daily Departures:

<?php echo StatsData::totalflightstoday(); ?>

For the number of destinations i do not think that there is already a counter but you can use this. Just open your StasData.class.php file and place this:

public static function total_destinations() {
 $key = 'total_destinations';
 $total = CodonCache::read($key);
 if($total === false)
 {
   $sql = "SELECT COUNT(DISTINCT arricao) AS total FROM ".TABLE_PREFIX."schedules WHERE enabled=1";
   $result = DB::get_row($sql);
   if(!$result) {
 return 0;
   }
   $total = $result->total;
   CodonCache::write($key, $total, '15minute');
 }
 return $total;
}

after that, you can use this part of code to show the number of destinations:

<?php echo StatsData::total_destinations(); ?>

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