Add the following code below to core/common/TouchdownStatsData.class
public static function airline_average() {
$stats = self::get_all_stats();
$total = 0;
$count = 0;
foreach ($stats as $stat)
{
$total = $total + $stat->landingrate;
$count++;
}
$average = $total / $count;
return $average;
}
public static function get_stats_by_cur_month($howmany) {
$query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps`
WHERE landingrate < '0'
AND MONTH(submitdate)=MONTH(now())
AND YEAR(submitdate)=YEAR(now())
ORDER BY landingrate DESC
LIMIT $howmany";
return DB::get_results($query);
}