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();
}