AFVA | Mitchell Posted January 12, 2010 Report Share Posted January 12, 2010 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 Quote Link to comment Share on other sites More sharing options...
Guest CableGuy Posted January 13, 2010 Report Share Posted January 13, 2010 Humm, Just do a bit of thinking and you can do it all from php. First you have to select the pilot from the table, then select all aircraft from the table where pilotid = "Pilot id",then find all of the planes that pilot has flown, and calculate the hours for each aircraft. If it seems a bit confusing ill expain better, its just hard for me to type in my current condition. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted January 13, 2010 Administrators Report Share Posted January 13, 2010 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 Quote Link to comment Share on other sites More sharing options...
CPC900 Posted January 13, 2010 Report Share Posted January 13, 2010 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?? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted January 13, 2010 Administrators Report Share Posted January 13, 2010 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 Quote Link to comment Share on other sites More sharing options...
CPC900 Posted January 13, 2010 Report Share Posted January 13, 2010 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. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted January 13, 2010 Administrators Report Share Posted January 13, 2010 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 Quote Link to comment Share on other sites More sharing options...
CedGauche Posted April 13, 2015 Report Share Posted April 13, 2015 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: http://forum.phpvms.net/topic/4823-aircraft-type-usage-chart/ Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted April 13, 2015 Administrators Report Share Posted April 13, 2015 There is a couple of charts including the pie chart for aircraft usage on this page -> /index.php/profile/stats Quote Link to comment Share on other sites More sharing options...
CedGauche Posted April 15, 2015 Report Share Posted April 15, 2015 Thanks is there also a pie chart that counts just the flights per aircraft and not the hours? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.