Moderators mark1million Posted February 2, 2011 Moderators Report Share Posted February 2, 2011 Thank you, worked a treat. Hope you don't mind but im going to put your group icon on my home page, i get quote a lot of traffic so hopefully you will get some of it Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted February 2, 2011 Author Administrators Report Share Posted February 2, 2011 Thank you, worked a treat. Hope you don't mind but im going to put your group icon on my home page, i get quote a lot of traffic so hopefully you will get some of it That would be great Mark Glad the change worked for you. Quote Link to comment Share on other sites More sharing options...
Brian Posted February 11, 2011 Report Share Posted February 11, 2011 TopPilot/refresh_pilot_stats did not add anything from the pireps into the top_flights database. It appears to work from in the browser although it doesn't say it imported anything. It just results in a basic template with nothing else. Not sure what to do to get the previously filed pireps into the system. Thanks, Brian. Never mind... had to change the database.... as I read from some of the other posts... sorry for the post. Quote Link to comment Share on other sites More sharing options...
Daniel Gallagher Posted February 12, 2011 Report Share Posted February 12, 2011 Does anyone know how i would be able to remove the top pilot sorted by hours table? Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 12, 2011 Moderators Report Share Posted February 12, 2011 Yep just remove it from the tpl The middle table by hours flown? Quote Link to comment Share on other sites More sharing options...
Daniel Gallagher Posted February 12, 2011 Report Share Posted February 12, 2011 i tried having a look in the tpl file but couldn't find anything to change :/ wondering if you would be able to post where and what i should change? thanks Quote Link to comment Share on other sites More sharing options...
Daniel Gallagher Posted February 12, 2011 Report Share Posted February 12, 2011 fixed it now Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 12, 2011 Moderators Report Share Posted February 12, 2011 Ok find this, //current month stats echo '<h3 align="left">Current Month Stats</h3>'; echo '<table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td width="30%" valign="top">'; echo '<center>'; $topflights = TopPilotData::top_pilot_flights($today[mon], $today[year], 10); if(!$topflights) {$month = date( 'F', mktime(0, 0, 0, $today[mon])); echo 'No Pireps Filed For '.$month.' '.$today[year]; } else { $month_name = date( 'F', mktime(0, 0, 0, $topflights[0]->month) ); echo '<b>Top Pilot for '.$month_name.' '.$topflights[0]->year.' </b><br />Flights Flown'; echo '<table cellspacing="1" cellpadding="1" border="1">'; echo '<tr>'; echo '<th><div align="left">Pilot</div></th>'; echo '<th><div align="center">Flights</div></th>'; echo '</tr>'; foreach ($topflights as $top) { $pilot = PilotData::GetPilotData($top->pilot_id); echo '<tr>'; echo '<td><div align="left">'.$pilot->firstname.' '.$pilot->lastname.' - '.PilotData::GetPilotCode($pilot->code, $pilot->pilotid).'</div></td>'; echo '<td><div align="center">'.$top->flights.'</div></td>'; echo '</tr>'; } echo '</table>'; echo '</center>'; echo '</td><td width="30%" valign="top">'; echo '<center>'; //top hours flown $tophours = TopPilotData::top_pilot_hours($today[mon], $today[year], 10); echo '<b>Top Pilot for '.$month_name.' '.$tophours[0]->year.' </b><br />Hours Flown'; echo '<table cellspacing="1" cellpadding="1" border="1">'; echo '<tr>'; echo '<th><div align="left">Pilot</div></th>'; echo '<th><div align="center">Hours</div></th>'; echo '</tr>'; foreach ($tophours as $top) { $pilot = PilotData::GetPilotData($top->pilot_id); echo '<tr>'; echo '<td><div align="left">'.$pilot->firstname.' '.$pilot->lastname.' - '.PilotData::GetPilotCode($pilot->code, $pilot->pilotid).'</div></td>'; echo '<td><div align="center">'.$top->hours.'</div></td>'; echo '</tr>'; } echo '</table>'; echo '</center>'; echo '</td><td width="30%" valign="top">'; echo '<center>'; //top miles flown $topmiles = TopPilotData::top_pilot_miles($today[mon], $today[year], 10); echo '<b>Top Pilot for '.$month_name.' '.$tophours[0]->year.' </b><br />Miles Flown'; echo '<table cellspacing="1" cellpadding="1" border="1">'; echo '<tr>'; echo '<th><div align="left">Pilot</div></th>'; echo '<th><div align="center">Miles</div></th>'; echo '</tr>'; foreach ($topmiles as $top) { $pilot = PilotData::GetPilotData($top->pilot_id); echo '<tr>'; echo '<td><div align="left">'.$pilot->firstname.' '.$pilot->lastname.' - '.PilotData::GetPilotCode($pilot->code, $pilot->pilotid).'</div></td>'; echo '<td><div align="center">'.$top->miles.'</div></td>'; echo '</tr>'; } echo '</table>'; echo '</td></tr>'; } echo '</center></table>'; ?> and comment out this section /* //top hours flown $tophours = TopPilotData::top_pilot_hours($today[mon], $today[year], 10); echo '<b>Top Pilot for '.$month_name.' '.$tophours[0]->year.' </b><br />Hours Flown'; echo '<table cellspacing="1" cellpadding="1" border="1">'; echo '<tr>'; echo '<th><div align="left">Pilot</div></th>'; echo '<th><div align="center">Hours</div></th>'; echo '</tr>'; foreach ($tophours as $top) { $pilot = PilotData::GetPilotData($top->pilot_id); echo '<tr>'; echo '<td><div align="left">'.$pilot->firstname.' '.$pilot->lastname.' - '.PilotData::GetPilotCode($pilot->code, $pilot->pilotid).'</div></td>'; echo '<td><div align="center">'.$top->hours.'</div></td>'; echo '</tr>'; } echo '</table>'; echo '</center>'; echo '</td><td width="30%" valign="top">'; echo '<center>'; */ Just like that Quote Link to comment Share on other sites More sharing options...
deactivated Posted February 15, 2011 Report Share Posted February 15, 2011 Top man!!!!! What a fantastic addition.... Thank you very much, this is now on my site. Easy to install and customise. Me Too! This Is Awesome Dude! Thanks Alot Quote Link to comment Share on other sites More sharing options...
5SA CEO Posted March 13, 2011 Report Share Posted March 13, 2011 Hi guys, I have added top pilot to our site today, the sql database is in and has been populated, all the relevent parts have now been placed into the root core files etc.. I have created a new page on the site - http://5starvirtualaviation.com/phpvms/index.php/pages/toppilotstats - where I would like the info to display. -to view the main TopPilot index create a link yoursite/index.php/TopPilot but how do I do I this part, I dont have much of a clue about, php,css or much else, just managing to get by with all the great work these guys have created. And got to ask, any further news on when 2 will be ready? Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted March 13, 2011 Report Share Posted March 13, 2011 To add the link just open your core nav file and see how the urls work. If you wish to hard code it in, add http://yoursite.com/index.php/TopPilot The place where you put the link is up to you. Quote Link to comment Share on other sites More sharing options...
5SA CEO Posted March 14, 2011 Report Share Posted March 14, 2011 Thanks TAV1702 I looked at the urls, but when I instered the link nothing came up, I tried to put the link in as you said above as well but all I got was modules does not exist, checked the file and I know they are all there. I am stumped at this time. will have another look at it later and see what I am doing wrong. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted March 14, 2011 Author Administrators Report Share Posted March 14, 2011 Thanks TAV1702 I looked at the urls, but when I instered the link nothing came up, I tried to put the link in as you said above as well but all I got was modules does not exist, checked the file and I know they are all there. I am stumped at this time. will have another look at it later and see what I am doing wrong. You have phpvms in a sub folder named phpvms so it would be; http://5starvirtualaviation.com/phpvms/index.php/toppilot Like This Quote Link to comment Share on other sites More sharing options...
5SA CEO Posted March 15, 2011 Report Share Posted March 15, 2011 Thanks simpilot & Tav I eventually figured it out, and got it working, next touch down stats. Deano Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted April 5, 2011 Report Share Posted April 5, 2011 Hey fellers, I am curious to know if it is at all remotely possible for this to keep track of all time miles flown too. I was looking and there is nothing for all time miles in PilotDataClass.php from phpVMS. Curious if it would be possible to tweak Top Pilot module to keep track instead or what. Has anyone else pulled this off? And if so, care to share maybe? I figured since it is able to track all time hours and flights, why not miles too. That would be the cats meow! Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted April 5, 2011 Moderators Report Share Posted April 5, 2011 Stat Detail Totals Total Fuel Burned (kg) 49018719 Total Miles Flown 5136168 Total Aircraft 302 Total Schedules 1788 Total News Items 98 Total Pilots 768 Total Flights 9278 Total Flights Today 33 Total Flight Hours 17240.08 Total PAX Carried 1400430 Average Landing Rate -399.43 This is a table i have in the top pilots module by Dave ffs lol thats the thread we in Its late here thats my excuse Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted April 5, 2011 Report Share Posted April 5, 2011 Any way at all to make it pull stats for each pilot? Like now it has 2 tables. Top Pilots All Time (Hours Flown) and Top Pilots All Time (Flights Flown) and in those it lists the pilots stats accordingly. I am curious if we can pull the miles and make it in to an Top Pilots All Time (Miles Flown) and have it list the pilots totals like it does for the other two. And on a side note, can your table above tell the difference between actual passengers hauled and cargo hauled? Right now the stats I have on my front page are counting cargo loads as passengers too. Now that I added cargo flights, my passengers hauled has went through the roof. I posted in another thread about that though so I'll be quiet about that in this thread. Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted April 6, 2011 Moderators Report Share Posted April 6, 2011 Yeh im just looking at it now i believe it would be possible with a mod on the code in that top hours for current month table. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted April 6, 2011 Report Share Posted April 6, 2011 Well, lets see who can beat who to it. lol I am not a pro at php at all. I am in my first php class at school as we speak. So it takes me a while to come up with stuff on my own. I hate being a newbie still after 9 years of doing this kind of stuff. Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted April 6, 2011 Moderators Report Share Posted April 6, 2011 I had a pop earlier and yes, basically add a new sql function to Core->Common->TopPilotData.Class.php its very similar to the public function top_pilot_flights($month, $year, $howmany) { $query = "SELECT * FROM top_flights WHERE month='$month' AND year='$year' ORDER BY flights DESC LIMIT $howmany"; return DB::get_results($query); } Function but just remove the month, and call it something else like top_pilot_flights_year get rid of the month selection and just use the year. Quote Link to comment Share on other sites More sharing options...
Jeff Posted April 7, 2011 Report Share Posted April 7, 2011 Any news for Version 2? Quote Link to comment Share on other sites More sharing options...
turtle6340 Posted April 8, 2011 Report Share Posted April 8, 2011 Well, lets see who can beat who to it. lol I am not a pro at php at all. I am in my first php class at school as we speak. So it takes me a while to come up with stuff on my own. I hate being a newbie still after 9 years of doing this kind of stuff. Maybe not the cleanest way but this works for me .... Add this to TopPilotData.class public function alltime_miles ($howmany) { $query = "SELECT pilot_id, SUM(miles)AS 'total' FROM top_flights GROUP BY pilot_id ORDER BY total DESC LIMIT $howmany"; return DB::get_results($query); } Then in tp_index I added .. $all_miles= TopPilotData::alltime_miles(5); foreach($all_miles as $all) { $pilot = PilotData::GetPilotData($all->pilot_id); echo '<tr>'; echo '<td align="center">'.$pilot->firstname.' '.$pilot->lastname.' - '.PilotData::GetPilotCode($pilot->code, $pilot->pilotid).'</td>'; echo '<td align="center">'.$all->total.'</td>'; echo '</tr>'; Hope this helps 1 Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted April 11, 2011 Report Share Posted April 11, 2011 Hey thanks! I'll take a look at it. Sorry for the slow reply. Was away this weekend getting engaged and all that good stuff. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted April 12, 2011 Report Share Posted April 12, 2011 +1 Turtle. Thanks man. I had a go at it and with some minor tinkering, she looks real good on my site. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted April 14, 2011 Report Share Posted April 14, 2011 You could replace the table and the php loop with this and it will give you a drop down with a go button; <script type="text/javascript"> function submitForm() { var list = document.navList.subMenu; var page = list.options[ list.selectedIndex ].value; if (page != "home") window.location = page; return false; } </script> <form name="navList" onsubmit="return submitForm();"> <select name="subMenu"> <option value="home">Current Month</option> <?php while ($startyear <= $today[year]): { $month_name = date( 'F', mktime(0, 0, 0, $startmonth) ); echo '<option value="'.url('/TopPilot/get_old_stats?month='.$startmonth.'&year='.$startyear.'').'">'.$month_name.' - '.$startyear.'</option>'; //advance dates if ($startmonth == $today[mon] && $startyear == $today[year]) { break; } if ($startmonth == 12) { $startyear++; $startmonth = 01; } else { $startmonth++; } } endwhile; ?> </select> <input type="submit" value="Go" /> </form> An example is at the bottom of the page here -> http://www.virtualaca.net/index.php/TopPilot While I understand this code and I know what it does, I am kind of lost where to put it. I found the loop and table, but it is all being echo because it is inside php. Do I simply end the php from the regular stats and then add this little ditty of code here after? Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted April 14, 2011 Moderators Report Share Posted April 14, 2011 While I understand this code and I know what it does, I am kind of lost where to put it. I found the loop and table, but it is all being echo because it is inside php. Do I simply end the php from the regular stats and then add this little ditty of code here after? Just replace the code at the bottom on the tpl where you can see the function to list all the dates. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted April 14, 2011 Report Share Posted April 14, 2011 Thanks mark. It took my blond haired self a minute to figure out what you guys were saying. Works a treat. Now I know when creating a form in the action statement we can use <?php echo $_SERVER['PHP_SELF']; ?> which will open called info back on to the same page from which it was opened. I am curious if that is possible in this situation. I see no action at all in the form in which to use this code. The only place I see anything related is it says Home in the script. In the end, I guess it would be sweet if I could open up historic tables UNDER the current stats instead of opening up a new page. Quote Link to comment Share on other sites More sharing options...
Sava Posted April 25, 2011 Report Share Posted April 25, 2011 What do you mean by inital install in the instructions. I put the files in the folder in root and than executed the query but when I direct to site/index.php/toppilot it says The module "TOPPILOT" doesn't exist! eDIT; managed to do it but how to add a link from the menu to the TopPilot Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted April 25, 2011 Author Administrators Report Share Posted April 25, 2011 Add the link to your menu, probably located in core_navigation.tpl Quote Link to comment Share on other sites More sharing options...
Industrialshadow Posted May 1, 2011 Report Share Posted May 1, 2011 Hello First i must say a great Addon. have a question. Where can i delete the old statistic from 1970??? look here in our testsystem http://test.dhl-aircargo.de/index.php/TopPilot Thanks for Infos 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.