TOPPilot beta 1.0

TOPPilot beta 1.0

phpVMS module to extract monthly flight statistics for individual pilots from your phpVMS based virtual airline.

Developed by:

simpilot

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!

Code hosted on Github - Link In Signature.

Top man!!!

What a fantastic addition…

Thank you very much, this is now on my site. Easy to install and customise.

1 Like

Awesome! Thanks for the hard work you do with all these MODS, and thank you very much for sharing. Very much appreciated!

1 Like

Hi Simpilot, thank you again for your outstanding work. This module is the dogs wotsits! I have just finished styling the page up on my site, and I am well pleased with the end result. The module really is a great addon!!

Thanks,

Stu

See it in action here!

4 Likes

As Usual simpilot another sweet addon

Thanks again for your work

Thanks Guys

Nice work styling the tables everyone.

Don’t forget to create a free account and submit news releases about your va and your Pilots of the Month at simpilotgroup.com, we are moving up in the google ranks!

Hi,

as usually a very nice add-on . Just one short question: The old stats start with January 1970. Where can I edit this date & the names for the months. As we are a German airline we’d like to have the names in German, but I didn’t find a way to change the names.

Once again thank you for those useful add-ons.

Kind regards

Bueno

Thank you for usefull addons !!

Hi,

as usually a very nice add-on . Just one short question: The old stats start with January 1970. Where can I edit this date & the names for the months. As we are a German airline we’d like to have the names in German, but I didn’t find a way to change the names.

Once again thank you for those useful add-ons.

Kind regards

Bueno

To change the month names to German,

Open tp_index.tpl

After the opening php tag of the file add

date_default_timezone_set('Europe/Berlin');
setlocale(LC_ALL, "de_DE", "de_DE@euro", "deu", "deu_deu", "german") ;

find around line 58

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) );

and replace with

if(!$topflights) {$month = strftime( '%B', mktime(0, 0, 0, $today[mon])); echo 'No Pireps Filed For '.$month.' '.$today[year]; }
else {
   $month_name = strftime( '%B', mktime(0, 0, 0, $topflights[0]->month) );

find around line 136

$month_name = date( 'F', mktime(0, 0, 0, $startmonth) );

and replace with

$month_name = strftime( '%B', mktime(0, 0, 0, $startmonth) );

Save it and refresh

For the first month being Jan 1970 tells me that there is probably a pirep in your database with a submit date of 0000 00 00, as jan 1970 is the start of php/mysql time function. Look for a pirep with 0’s for a submit date and fix the date, I think you will find it will correct itself at that point.

Hi,

everything is fixed now. Thank you once again for your support .

Kind regards

Can anyone give me some advice on editing this module? A kick in the right direction would be very much appreciated!

Cheers,

DeeQ @ OWV

You need to do some reading up on CSS to be able to apply styles to the tables. Once you get the basics sussed out in your mind, it’s pretty easy to use CSS to good effect. The page is made up of tables, and the tables are split into table headers and table bodies. Each component of the table can be styled individually or collectively, by applying a style class. Here’s a decent website that works through the basics of CSS, with examples:

http://www.w3schools.com/css/default.asp

There are also many other websites that offer CSS tutorials too. It’s really worth getting to know CSS, as it allows you to make stylistic changes across your website very easily, with the use of a CSS stylesheet. It also helps to mess around with a stylesheet on a localhosted or live testing site, and make changes here and there to see what effect they have. That’s how I got interested in CSS. I’m very far from an expert, but I do like experimenting.

3 Likes

How do I add a table to sort the rank touchdown?

Att: presidente Rico virtual

www.ricovirtual.br.tp

You need to do some reading up on CSS to be able to apply styles to the tables. Once you get the basics sussed out in your mind, it’s pretty easy to use CSS to good effect. The page is made up of tables, and the tables are split into table headers and table bodies. Each component of the table can be styled individually or collectively, by applying a style class. Here’s a decent website that works through the basics of CSS, with examples:

http://www.w3schools.com/css/default.asp

There are also many other websites that offer CSS tutorials too. It’s really worth getting to know CSS, as it allows you to make stylistic changes across your website very easily, with the use of a CSS stylesheet. It also helps to mess around with a stylesheet on a localhosted or live testing site, and make changes here and there to see what effect they have. That’s how I got interested in CSS. I’m very far from an expert, but I do like experimenting.

+1 for me, guys just take the time to understand, hey im in my late 30’s and i have learnt it and still am, check out that page it will help you loads http://www.w3schools.com/css/default.asp

Hi,

For some reason i have just noticed that my history stats show the same month, the only change i have made is the update to beta 2.1.910.

Clearly there have been some edits to the tpl but i removed all the added code and still get the same, any ideas on this one please?

I noticed it on my site last evening as well. I will look at it this evening when I get in. Odd it displays the same month but links to the correct month…

Who can I download this file?

All Sim Pilots modules have been temporary removed while they are licensed, they will be back soon.

Hi,

For some reason i have just noticed that my history stats show the same month, the only change i have made is the update to beta 2.1.910.

Clearly there have been some edits to the tpl but i removed all the added code and still get the same, any ideas on this one please?

Seemed to fix itself on my site Has your listings corrected themselves as well?

Yes it did, cheers.

Dont know what all that was about be it seems OK now,