faraz Posted February 6, 2010 Report Posted February 6, 2010 HI when I created 3more Airlines , Total Hours Flown and Total Flight Today stop working. In Reports page (Admin): VA Stats: At a Glance Total Pilots: 10 Total Flights: 18 Total Hours Flown: Total Miles Flown: 7980 Total Fuel Burned: 225404 Total Flight Today: 0 Total PAX Carried: 3499 Stats for SAS Total Pilots: 2 Total Flights: 13 Total Hours Flown: Total Miles Flown: 5834 Total Fuel Burned: 189907 Total Flight Today: 0 Total PAX Carried: 2950 Quote
faraz Posted February 7, 2010 Author Report Posted February 7, 2010 Does anyone have any idea how i fix it? Quote
Administrators Nabeel Posted February 7, 2010 Administrators Report Posted February 7, 2010 Did you make ay changes to that code? It's probably a bug then Quote
faraz Posted February 7, 2010 Author Report Posted February 7, 2010 I didn't change any code . /** * Get the total number of flights flown */ public static function TotalFlights($airline_code = '') { $sql = 'SELECT COUNT(*) AS `total` FROM `'.TABLE_PREFIX.'pireps` WHERE `accepted`='.PIREP_ACCEPTED; if($airline_code != '') { $sql .= " AND `code`='{$airline_code}' GROUP BY `code`"; } $result = DB::get_row($sql); if(!$result) { return 0; } return $result->total; } /** * Get the top routes */ public static function TopRoutes($airline_code='') { $sql = 'SELECT * FROM `'.TABLE_PREFIX.'schedules`'; if($airline_code != '') { $sql .= " AND `code`='{$airline_code}' GROUP BY `code`"; } $sql =' ORDER BY `timesflown` DESC LIMIT 10'; return DB::get_results($sql); } <strong>Total Hours Flown: </strong><?php echo StatsData::TotalHours($airline_code = 'UAE'); ?><br /> Quote
Administrators Nabeel Posted February 8, 2010 Administrators Report Posted February 8, 2010 That code has changed in the next update, let me debug, thanks Quote
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.