The error is in the sql command for the database, replace it with:
$sql = 'SELECT a.*, a.name AS aircraft,
COUNT(p.pirepid) AS routesflown,
SUM(p.distance) AS distance,
SEC_TO_TIME(SUM(p.flighttime*60*60)) AS totaltime,
AVG(p.distance) AS averagedistance,
AVG(p.flighttime) as averagetime
FROM '.TABLE_PREFIX.'aircraft a
LEFT OUTER JOIN '.TABLE_PREFIX.'pireps p ON (p.aircraft = a.id)
WHERE enabled = 1
GROUP BY a.name';
That will only show enabled aircraft. Also, I am not sure how the current location in the template is relavent unless you only have one unit of each model in your fleet. The module combines all the like aircrtaft in one group, then displays a current location, but that would be just for the last ac in the list. Just pondering...
the module runs slow on my local machine, but I have a lot of data in the database. Might benefit in speed to combine some of the data calls from the template into the model.