Aircraft statistics...

Go to core/common/TouchdownStatsData.class.php

Add this to the file:

public function get_planemd11_stats($howmany) {

$query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM ".TABLE_PREFIX."pireps

WHERE landingrate < ‘0’

AND Aircraft = ‘2’

ORDER BY landingrate DESC

LIMIT $howmany";

return DB::get_results($query);

}

planemd11 can be edited to the plane that you would like to show.

AND Aircraft = ‘2’ the 2 can be changed to the aircraft that you would like to show. (See the phpvms_aircraft table)

So in my case the MD11 has ID ‘2’ in the ‘phpvms_aircraft’ table.

Next, you need to add the following rules to the core/modules/Touchdownstats/TouchdownStats.php

public function planemd11_landings($howmany) {

$this->set(‘stats’, TouchdownStatsData::get_planemd11_stats($howmany));

$this->show(‘touchdownstats/touchdownstats_index.tpl’);

}

Again, please make sure that the planemd11 in both rules are the changed to the same name as used in the core/common/TouchdownStatsData.class.php file.

When this is done, you can use this link to view the results:

yoursite/index.php/TouchdownStats/planemd11_landings/20 (and again, planemd11 needs to be the same as in the two files we have edited.

DEMO:

http://serious-airlines.com/index.php/pages/aircraftstatistics

It’s my first little project…

Regards

Lucas

Ola is very good yes the more it is better either welcome

I’d prefer it with just a page with each aircraft’s tables rather than each link.

Jon

I’d prefer it with just a page with each aircraft’s tables rather than each link.

Jon

OK. I’ll just post it as i got it. You can create one page yourself. Shouldn’t be that hard.

I’ll post it tomorrow i think.

Regards

Lucas

Great !! Thanks for sharing

for all of you interested.

One question??? How do you combine the stats for ONE type of aircraft, when you have multiple registrations?? For instance, I have 5 different registration for the MD11. They do NOT show up under one total, for the purpose of the landing stats?! I tried to do:

public function get_planemd11_stats($howmany) {

$query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM ".TABLE_PREFIX."pireps

WHERE landingrate < ‘0’

AND Aircraft = ‘105,106,107,108,109’

ORDER BY landingrate DESC

LIMIT $howmany";

return DB::get_results($query);

}

Under the AND Aircraft = part, but it did not like that format. Is there a way to combine the same types??

Ok, that would be great, but how do I display the individual aircraft then? I would add what you just said into the “core/common/TouchdownStatsData.class.php” correct? Then what for the “core/modules/Touchdownstats/TouchdownStats.php” section? Sorry, I get lost too easy trying to follow

What was said in the above mentioned part. I have multiple MD11’s, lets say, with different registrations. The code Lucas mentioned at the top of this thread works, but only shows for ONE registration of MD11, for instance; it does not lump all the MD11’s into one, as I would want, to show the proper stats for all. Does that not make sense?!

Thanks Jeff, as usual.

One question??? How do you combine the stats for ONE type of aircraft, when you have multiple registrations?? For instance, I have 5 different registration for the MD11. They do NOT show up under one total, for the purpose of the landing stats?! I tried to do:

public function get_planemd11_stats($howmany) {

$query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM ".TABLE_PREFIX."pireps

WHERE landingrate < ‘0’

AND Aircraft = ‘105,106,107,108,109’

ORDER BY landingrate DESC

LIMIT $howmany";

return DB::get_results($query);

}

Under the AND Aircraft = part, but it did not like that format. Is there a way to combine the same types??

Hi guys,

I saw that the above issue was already resolved… i just wanted to say that for my 737-800 i used this code:


public function get_plane738_stats($howmany) {

$query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM ".TABLE_PREFIX."pireps

WHERE landingrate < ‘0’

AND Aircraft = ‘1’ OR Aircraft = ‘3’ OR Aircraft = ‘8’ OR Aircraft = ‘9’ OR Aircraft = ‘12’

ORDER BY landingrate DESC

LIMIT $howmany";

return DB::get_results($query);

}


To answer the above question.

Bye!

Lucas

Thanks Lucas, that is what I wanted. Now, how would I add Average Landing rate per pilot, to your code?

Thanks Lucas, that is what I wanted. Now, how would I add Average Landing rate per pilot, to your code?

So sorry for the late response (almost a month!!)

I think your answer is in here, thanks to Simpilot..