Jump to content

Recommended Posts

Posted

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

Posted

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

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