I’ve noticed the table lists the planes in order by their registration.
Example:
MD87 MD-87 N214AM 0 0 130 10000 0
MD88 MD-88 N401NV 0 0 150 15000 0
MD88 MD-88 N402NV 0 0 150 15000 0
MD88 MD-88 N403NV 0 0 150 15000 0
MD88 MD-88 N404NV 0 0 150 15000 0
MD83 MD-83 N405NV 0 0 150 15000 0
MD82 MD-82 N406NV 0 0 150 15000 0
MD82 MD-82 N407NV 0 0 150 15000 0
MD82 MD-82 N408NV 0 0 150 15000 0
How do we set it so that it lists in order by aircraft type ?
MD82 MD-82 N406NV 0 0 150 15000 0
MD82 MD-82 N407NV 0 0 150 15000 0
MD82 MD-82 N408NV 0 0 150 15000 0
MD83 MD-83 N405NV 0 0 150 15000 0
MD87 MD-87 N214AM 0 0 130 10000 0
MD88 MD-88 N401NV 0 0 150 15000 0
MD88 MD-88 N402NV 0 0 150 15000 0
MD88 MD-88 N403NV 0 0 150 15000 0
MD88 MD-88 N404NV 0 0 150 15000 0
Open up Fleet.php and instead of the default FleetInfo() change it to this code:
/**
* Return all possible information about the fleet
* Code by Mitchell W
* Enhanced by Stu (stuartpb)
* Fleet Table 2.0 Order by Aicraft Type Edit
*/
public static function FleetInfo()
{
$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)
GROUP BY a.name';
return DB::get_results($sql);
DB::debug();
return $ret;
}
This was exactly what I was about to ask!
Would be a great addition to a great module!!
Reasin being …
I duplicated then renamed the original fleet table and edited the out put only to display;
Type
Rego
Location - Location
Now all I need is the last pilot who flew it.
Then I can promote the Module as “Last Known Whereabouts” giving pilots the incentive to take that aircraft and fly it to where they want to go.
Any assistance in coding would be mostly appreciative.
Thanks in advance
Adam
AUZ
I have tried to get the last pilot who flew it but I can’t seem to get it to work, as soon as I get it working I’ll post the code here
a conclusion in the two tables, first table of Boeing 737 and the second table all Airbus
how can I create this?
First Table is (list of all Boeing aircraft's)
Boeing B737-300
EI-CHH, total flight time 00:12:50.
Located at the airport Cologne Bonn (EDDK).
Second Table is (list of all Airbus aircraft's)
Airbus A319-100
VP-BBG, total flight time 01:20:15.
Located at the airport Munich (EDDM).
please help!!
I've created this code but, this code show all aircraft's in list, but i needet 2 tabeles!
<?php foreach ($fleet as $aircraft)
{
?>
<?php $airbus = explode("EI", $aircraft->registration); echo $airbus[0];?>, total flight time <?php echo $aircraft->totaltime; ?>.<br> Located at the airport<?php
$params = (array('a.registration'=>$aircraft->registration, 'p.accepted'=>PIREP_ACCEPTED));
$pirep = PIREPData::findPIREPS($params);
$current_location = $pirep[0]->arricao;
$current_location2 = $pirep[0]->arrname;
{
echo ''.$current_location2.' ('.$current_location.')';
}
?>.<br><br>
<?php } ?>
Copy the table and move it below the first table and change the airbus stuff to boeing or whatever.