Jump to content

ACARS Map


mclaren99uk

Recommended Posts

Guest lorathon

You can try

<%=flight.icao%>

If that does not work you will need to change the ACARSData::GetACARSData() function. I have changed mine already so not sure what is in the standard query.

Link to comment
Share on other sites

Guest lorathon

core/common/ACARSData.class.php

Find and replace with this. Be advised that if you upgrade to a new version of phpVMS this will be overwritten. The following shuld allow you to use the <%flight.icao%> (NOT TESTED)

public static function GetACARSData($cutofftime = '') {
       //cutoff time in days
       if (empty($cutofftime)) {
           // Go from minutes to hours
           $cutofftime = Config::Get('ACARS_LIVE_TIME');
           //$cutofftime = $cutofftime / 60;
       }

       $sql = 'SELECT a.*, c.name as aircraftname, c.*,
				p.code, p.pilotid as pilotid, p.firstname, p.lastname,
				dep.name as depname, dep.lat AS deplat, dep.lng AS deplng,
				arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng
			FROM ' . TABLE_PREFIX . 'acarsdata a
			LEFT JOIN ' . TABLE_PREFIX . 'aircraft c ON a.`aircraft`= c.`registration`
			LEFT JOIN ' . TABLE_PREFIX . 'pilots p ON a.`pilotid`= p.`pilotid`
			LEFT JOIN ' . TABLE_PREFIX . 'airports AS dep ON dep.icao = a.depicao
			LEFT JOIN ' . TABLE_PREFIX . 'airports AS arr ON arr.icao = a.arricao ';

       if ($cutofftime !== 0) {
           $sql .= 'WHERE DATE_SUB(NOW(), INTERVAL ' . $cutofftime .
               ' MINUTE) <= a.`lastupdate`';
       }

       return DB::get_results($sql);
       DB::debug();
   }

Link to comment
Share on other sites

Hi

Sorry for the delay, as was late here and needed some sleep.

Below is the section you have asked for

public static function GetACARSData($cutofftime = '')
{
	//cutoff time in days
	if(empty($cutofftime))
	{
		// Go from minutes to hours
		$cutofftime = Config::Get('ACARS_LIVE_TIME');
		//$cutofftime = $cutofftime / 60;			
	}

	$sql = 'SELECT a.*, c.name as aircraftname,
				p.code, p.pilotid as pilotid, p.firstname, p.lastname,
				dep.name as depname, dep.lat AS deplat, dep.lng AS deplng,
				arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng
			FROM ' . TABLE_PREFIX .'acarsdata a
			LEFT JOIN '.TABLE_PREFIX.'aircraft c ON a.`aircraft`= c.`registration`
			LEFT JOIN '.TABLE_PREFIX.'pilots p ON a.`pilotid`= p.`pilotid`
			LEFT JOIN '.TABLE_PREFIX.'airports AS dep ON dep.icao = a.depicao
			LEFT JOIN '.TABLE_PREFIX.'airports AS arr ON arr.icao = a.arricao ';

	if($cutofftime !== 0)
	{
		$sql .= 'WHERE DATE_SUB(NOW(), INTERVAL '.$cutofftime.' MINUTE) <= a.`lastupdate`';
	}

	return DB::get_results($sql);
	DB::debug();
}

Link to comment
Share on other sites

Guest lorathon

There is a change.

The original only pulls the name from the aircraft table

c.name as aircraftname,

The modified pulls the name and then everything else

c.name as aircraftname, c.*,

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