I apologize if this has been brought up before…
G’day all,
Is their a way to find out how much HOURS a pilot has spent in each aircraft? The pie chart doesn’t give us enough information…
Thanks!
Mitch
I apologize if this has been brought up before…
G’day all,
Is their a way to find out how much HOURS a pilot has spent in each aircraft? The pie chart doesn’t give us enough information…
Thanks!
Mitch
Or you can use the API. Don’t do manual queries, chances are 99% you can do it all without touching the API.
I’m re-vamping for statistics, to add a flexible query system like I added for PIREPS and Schedules and Pilots, but for now, you can do this (which actually is using the PIREP query system, this shows how flexible it is)
<?php
$params = array(
'p.pilotid' => [pilotid],
'p.registration' => [aircraft registration],
);
// Look for the last 24 months
$totals = PIREPData::getIntervalDataByMonth($params, 24);
$flown_time = 0;
foreach($totals as $total)
{
$flown_time = Util::AddTime($flown_time, $total->total);
}
echo 'Total time flown: '.$flown_time;
It’ll be a bit slow, but I’m working on better functions for statistics as part of the cleanup. It might not work completely, but I’ll let you figure out the pieces. You can put that in a loop for each aircraft
What does the Pie Chart show anyway? I show on my own stats 2 flights for a total of 1.32 hours in my pilot center. But when I go to My Stats, the Pie Chart shows 0.92 of 0.92 and 100% of 100%?? Is the pie chart showing flight time or something and the pilot center showing total time??
What does the Pie Chart show anyway? I show on my own stats 2 flights for a total of 1.32 hours in my pilot center. But when I go to My Stats, the Pie Chart shows 0.92 of 0.92 and 100% of 100%?? Is the pie chart showing flight time or something and the pilot center showing total time??
Yes, shows the flight time per aircraft for that pilot. Are the times not adding up? The times might be a little different, due to the fact that the stats counter is using mysql to add up the times, whereas I do it manually. It shouldn’t differ too much, though.
Which actually bring me back to the OP’s question:
$flown_counts = StatsData::pilotAircraftFlownCounts($pilotid);
Do a print_r($flown_counts), that will return loads of information, per-aircraft. Chances are, what you’re looking for is probably in there
Ok Nabeel, just so I understand…the time it shows in the Pilot Center is correct; 1.32 hours. Which is 1 hour and 32 minutes. Now, the pie chart comes up with a value of .92! Now I can see where 1 hour(60 mins) + 32mins makes 1.32 hours…but why does the pie chart show it like a 100 minute clock value of 0.92!? I have only used ONE aircraft so far, so should it not also show 1.32 in the pie chart?! Or is there some setting I need to change?!
Also, I have no idea where that code would go, that you mentioned, sorry.
Because the pie chart doesn’t really handle times, it just doing it as a fraction of a number, not a 60-minute time interval. The overall ratio should be correct.
The code, well, I guess the OP wanted it for a module
Is this pie chart still in the phpvms system?
I’ve never seen it.
Is there another way to show aircraft usage per pilot? I’ve tried this, but this also give no results:
There is a couple of charts including the pie chart for aircraft usage on this page -> /index.php/profile/stats
Thanks
is there also a pie chart that counts just the flights per aircraft and not the hours?