Jeff Posted May 27, 2010 Report Share Posted May 27, 2010 TOPPilot beta 1.0 phpVMS module to extract monthly flight statistics for individual pilots from your phpVMS based virtual airline. Developed by: simpilot www.simpilotgroup.com Developed on: phpVMS 2.0.874 php 5.2.11 mysql 5.0.51 apache 2.2.11 Included files: readme.txt top_flight.sql TopPilot.php TpPilotData.class.php tp_index.tpl tp_previous.tpl Install: -Download the attached package. -unzip the package and place the files as structured in your root phpVMS install. -use the top_flights.sql file to create the table needed in your sql database using phpmyadmin or similar. -after the initial install point your browser to yoursite/index.php/TopPilot/refresh_pilot_stats one time. This will populate the database table with any data available. -to view the main TopPilot index create a link yoursite/index.php/TopPilot -everytime a pirep is filed the module will recalculate the pilot stats and update the database There are three main display functions within the TopPilotData class that you can configure to use in various parts of your site. Flights flown - TopPilotData::top_pilot_flights($month, $year, 5) Hours flown - TopPilotData::top_pilot_hours($month, $year, 5) Miles flown - TopPilotData::top_pilot_miles($month, $year, 5) $month should be the two digit month id of the month you want data from – ie 06 = June $year is the four digit year you are pulling – ie 2010 5 – can be changed to how many records you want returned. Excluding PIREPS that are not accepted yet. TopPilot.php line 52. Uncomment the trailing section and the module will not include unapproved PIREPS. Doing this will cause the module not to display any newly accepted PIREPS in the TopPilot data listings until after another PIREP is filed although you can refresh the stats at anytime using – yoursite/index.php/TopPilot/refresh_pilot_stats Although this script carries no limits of use a link back to www.simpilotgroup.com would be greatly appreciated! Have fun! Can someone explain to me in layman's terms on how to create a table using phpmyadmin, I don't think I understand how it actually works, I am very new to doing these kinda things. Quote Link to comment Share on other sites More sharing options...
TennShadow Posted May 27, 2010 Report Share Posted May 27, 2010 Can someone explain to me in layman's terms on how to create a table using phpmyadmin, I don't think I understand how it actually works, I am very new to doing these kinda things. What you do is log into your database with phpmyadmin or something similar and then you import the top_flights.sql file. It will then automatically create the needed tables for this module. Hope this helps. Quote Link to comment Share on other sites More sharing options...
Jeff Posted May 31, 2010 Report Share Posted May 31, 2010 What you do is log into your database with phpmyadmin or something similar and then you import the top_flights.sql file. It will then automatically create the needed tables for this module. Hope this helps. Would it be placed in the www/core/modules folder or where? Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted May 31, 2010 Moderators Report Share Posted May 31, 2010 I notice from today that the months are messed up again Quote Link to comment Share on other sites More sharing options...
CPC900 Posted May 31, 2010 Report Share Posted May 31, 2010 BUMP My other question is.....can transferred hours be accounted for in the Top Pilots Hours Flown?? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted May 31, 2010 Author Administrators Report Share Posted May 31, 2010 I notice from today that the months are messed up again I think it is something to do with the end of the month and the time difference from the server and GMT... It always seems to correct itself after the 1st of the month, on my site anyway. I have not messed with this mod for a bit, I am not sure what or if I tracked it down. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted May 31, 2010 Author Administrators Report Share Posted May 31, 2010 BUMP My other question is.....can transferred hours be accounted for in the Top Pilots Hours Flown?? I did not respond to it as it did not make sense to me to include transfered hours every month to a pilots stats. If you want to, you can: Open TopPilotData.class.php find line 54 $totaltime=0; and change to $totaltime=$pilot->transferhours; That will add the transfer hours to the pilots time each month. Quote Link to comment Share on other sites More sharing options...
Jeff Posted June 1, 2010 Report Share Posted June 1, 2010 Would it be placed in the folder or where? This question got skipped for reply, still need answer if you have one. (^5 posts up^) Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted June 1, 2010 Author Administrators Report Share Posted June 1, 2010 This question got skipped for reply, still need answer if you have one. (^5 posts up^) The sql file is to create the needed table in your database. You need to go into phpMyAdmin and either import it into your database with the import function or copy the text of the file into the sql box and run it that way. The file does not need to be on your server, once you have loaded it into the database you should not need it again. Quote Link to comment Share on other sites More sharing options...
CPC900 Posted June 1, 2010 Report Share Posted June 1, 2010 I did not respond to it as it did not make sense to me to include transfered hours every month to a pilots stats. If you want to, you can: Open TopPilotData.class.php find line 54 $totaltime=0; and change to $totaltime=$pilot->transferhours; That will add the transfer hours to the pilots time each month. Sorry, I guess I meant for the TOTAL numbers for the pilots, not the monthly ones. But I see your point. I just wanted the total hours to add the transferred hours in for that...not for the month totals. Thanks. Quote Link to comment Share on other sites More sharing options...
CPC900 Posted June 1, 2010 Report Share Posted June 1, 2010 I see you meant TopPilot.php See, now I just want to add the transfer hours to the ONE total of "public function alltime_hours ($howmany) {" on Line 57 of TopPilotDataClass.php....I think?! But not having much luck. I don't want to screw up any of the monthly stuff....just that ONE total is all. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted June 1, 2010 Author Administrators Report Share Posted June 1, 2010 I see you meant TopPilot.php See, now I just want to add the transfer hours to the ONE total of "public function alltime_hours ($howmany) {" on Line 57 of TopPilotDataClass.php....I think?! But not having much luck. I don't want to screw up any of the monthly stuff....just that ONE total is all. To include transfer hours in the totals -> open TopPilotData.class.php find line 58 $query = "SELECT pilotid, totalhours FROM phpvms_pilots ORDER BY totalhours DESC LIMIT $howmany"; and change to $query = "SELECT pilotid, totalhours, transferhours FROM phpvms_pilots ORDER BY totalhours DESC LIMIT $howmany"; Open tp_index.tpl find line 70 echo $row->totalhours; and change to echo ($row->totalhours + $row->transferhours); Quote Link to comment Share on other sites More sharing options...
CPC900 Posted June 1, 2010 Report Share Posted June 1, 2010 In "tp_index.tpl" I don't have a line that says "echo $row->totalhours;". Line 70 says " foreach ($topflights as $top) {" ?!? Quote Link to comment Share on other sites More sharing options...
CPC900 Posted June 1, 2010 Report Share Posted June 1, 2010 I re-installed the module, but now I have a problem with this: "Warning: Invalid argument supplied for foreach() in /home/woodsdom/public_html/CPC/core/templates/tp_index.tpl on line 24" Line 24 is: "foreach($all_flights as $all) {" I don't understand where this went wrong. Nothing was edited except for pointing to the correct database in the "TopPilotDataClass.php file". It was working fine the other day! http://www.canadianclassicairlines.com/CPC/index.php/TopPilot Quote Link to comment Share on other sites More sharing options...
CPC900 Posted June 2, 2010 Report Share Posted June 2, 2010 *Bump* Please let me know what is wrong here?! The monthly stuff workis fine, but I get the error for the all time totals, and I can't figure out why. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted June 5, 2010 Author Administrators Report Share Posted June 5, 2010 *Bump* Please let me know what is wrong here?! The monthly stuff workis fine, but I get the error for the all time totals, and I can't figure out why. My guess is that you are not using the standard phpvms_ table prefix in your db. If this is the case, you will have to change the sql commands on lines 52 & 58 in TopPilotData.class.php in root/core/common/ to reflect your db prefix, or you could insert the TABLE_PREFIX command, which I should have done in the first place... Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted June 5, 2010 Author Administrators Report Share Posted June 5, 2010 In "tp_index.tpl" I don't have a line that says "echo $row->totalhours;". Line 70 says " foreach ($topflights as $top) {" ?!? My bad - it is actually line 45. I was looking at a customized version of the custom module of a ... .... errr...... you get the idea. Way too many files floating around on my box, time to start deleting some I think. Quote Link to comment Share on other sites More sharing options...
CPC900 Posted July 1, 2010 Report Share Posted July 1, 2010 I just noticed that my top pilot lists the last 6 months as: January - 2010 March - 2010 March - 2010 April - 2010 May - 2010 June - 2010 The first march stats are actually February?! But I can't find where/why it list March twice?! Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted July 1, 2010 Moderators Report Share Posted July 1, 2010 Have a look today, i fixed it Only messing but i bet its back to normal though, It messes with up slightly on the last day of the month but after that itsOK again. Quote Link to comment Share on other sites More sharing options...
CPC900 Posted July 1, 2010 Report Share Posted July 1, 2010 Ahh....yeah, it is fine now. Quote Link to comment Share on other sites More sharing options...
filipe Posted October 15, 2010 Report Share Posted October 15, 2010 Good day guys I'm having trouble installing the module TopPilot. let the following description of the error that this showing me Ouvir Ler foneticamente: Warning: Invalid argument supplied for foreach() in /home/vhosts/kaflyportugal.noads.biz/core/templates/tp_index.tpl on line 24 please help me! thanks Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted October 16, 2010 Author Administrators Report Share Posted October 16, 2010 Could be a number of things: Did you load the sql tables to your database? If so, did you run the "refresh_pilot_stats" command? Are there any contents in the db after running that? Also, if the va has no pireps the module will not work. Quote Link to comment Share on other sites More sharing options...
kimi Posted October 16, 2010 Report Share Posted October 16, 2010 my friend I have already approved the flights go, and already ran the command you mentioned, but stays the same. I put the contents in the right folders on the server! a question: if command is executed in the browser or phpmyadmin? thanks Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted October 16, 2010 Author Administrators Report Share Posted October 16, 2010 I have already approved the flights go, and already ran the command you mentioned, but stays the same. I put the contents in the right folders on the server! a question: if command is executed in the browser or phpmyadmin? The sql files would be loaded using phpmyadmin and the refresh command would be used in your browser address bar, but you say you already did this, right? Quote Link to comment Share on other sites More sharing options...
filipe Posted October 22, 2010 Report Share Posted October 22, 2010 exactly how did all this in the explanation of installation Quote Link to comment Share on other sites More sharing options...
Daniel Posted October 26, 2010 Report Share Posted October 26, 2010 how do i align it so it is normal on the Obsess Blue Template? as it is way at the bottom Thanks Daniel Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted October 26, 2010 Moderators Report Share Posted October 26, 2010 how do i align it so it is normal on the Obsess Blue Template? as it is way at the bottom Thanks Daniel Everything needs to sit between those two divs, class="mcright" Quote Link to comment Share on other sites More sharing options...
Daniel Posted October 26, 2010 Report Share Posted October 26, 2010 tried that but still no luck Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted October 26, 2010 Moderators Report Share Posted October 26, 2010 In the template tpindex.tpl at the very top <div class="mcright"> and close it off at the bottom Quote Link to comment Share on other sites More sharing options...
Daniel Posted October 28, 2010 Report Share Posted October 28, 2010 Fixed It! Thanks alot Mark! 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.