-
Posts
2773 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
phpVMS Resources
Downloads
Everything posted by simpilot
-
To round the number and remove the decimal use -> <p><strong>Fuel Burned (lbs.): </strong><?php echo round(StatsData::TotalFuelBurned(), 0); ?></p> As far as pax count it is pulling the load figure from each PIREP that has a flighttype of "P" -> $params = array( 'table' => TABLE_PREFIX.'pireps', 'fields' => 'SUM(`load`) as `total`', 'where' => array( 'accepted' => PIREP_ACCEPTED, 'flighttype' => 'P' ), I would check to see if your cargo flights are being recorded with the correct identifier in the flighttype column of the pireps table.
-
instead of <?php echo PilotData::GetFieldValue($pilot->userinfo, 'Vatsim ID'); ?> try <?php echo PilotData::GetFieldValue($userinfo->pilotid, 'Vatsim ID'); ?>
-
It is possible to do, I have the module bringing all the data back - you can extend the code to include some more stats and functions if you would like. You can do a print_r to see what is coming back in your tpl file for you to use in your stats equations.
-
@maiochine You have me lost at this point - who's code are you using? What I supplied to you for your custom pirep system or what Jeff gave you, which would be for the native pirep system. The limited number listings will have to be modified for your custom system, but if you are using the native system with the code from Jeff what is built in to the module will work.
-
Looking for VA's to test AIRmail system [DEPRECATED]
simpilot replied to simpilot's topic in Simpilot Group Addons
If you downloaded the files from this thread and are running vms ver 2.x it will not run, which I believe is what you have at this point. The link to AIRMail 2.x is a few posts up on this page. Delete everything for AIRMail 1.0 and install the 2.x version. -
There is part of the issue - not sure why but your db has the table named readstate not read_state. It looks like when you loaded the file for some reason it removed all the underscores. These all need to be changed. Dump the table and use this. -- -------------------------------------------------------- -- -- Table structure for table `airmail` -- CREATE TABLE IF NOT EXISTS `airmail` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `who_to` varchar(20) NOT NULL, `who_from` varchar(20) NOT NULL, `date` date NOT NULL DEFAULT '0000-00-00', `time` time NOT NULL DEFAULT '00:00:00', `read_state` smallint(1) unsigned NOT NULL DEFAULT '0', `deleted_state` smallint(4) NOT NULL DEFAULT '0', `sent_state` smallint(4) NOT NULL DEFAULT '0', `subject` varchar(20) NOT NULL DEFAULT '', `message` text NOT NULL, `notam` smallint(6) NOT NULL DEFAULT '0', `sender_folder` int(11) DEFAULT '0', `reciever_folder` int(11) DEFAULT '0', PRIMARY KEY (`id`), FULLTEXT KEY `subject` (`subject`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=175 ; This is the same as the download, it is probably going to do the same thing. If it does you will need to go in the table and rename al the columns to match the sql commands above. It must be something with your db and how it is configured, or you are opening the file in an editor that does not support underscores and it is dropping them which would probably make more sense as the other table is correct with underscores.
-
Doh! Line 79 then -> 'code' => $this->post->code, to 'code' => 'ABC', ABC being your airline prefix code.
-
Remove the selection from your tpl file and in registration.php file find line 81 -> 'hub' => $this->post->hub, and change it to -> 'hub' => 'ICAO', using the icao of the hub you want them to be assigned to. ie - KJFK etc
-
Turn on error reporting and see if anything shows up in the error log, also does anything else related to the database and changing it work, ie can a pilot register or file a pirep and have it inserted into the database?
-
The use of the limited function is within the first post of this thread. TouchdownStatsData::get_stats('10') This will only fill the variable with 10 listings, you can change the 10 to whatever you would like. You can use this in your module that calls the page (prefered) or within the template itself. or quite simply call the built in page of the module -> www.yoursite.com/index.php/TouchdownStats/top_landings/10
-
Wait - how did Jeff's code work, I thought you were using the custom PIREP system and table. If that code is working then you must be using the native format and all the other functions will work as they are, no modification is needed.
-
Try uploading all the files again and be sure everything is in the correct path as it is structured in the download.
-
If there are no errors being shown my guess at this point would be a corrupted file or something. Hard to tell without access. It seems that the files are in the proper tree as they show on your site and the database seems correct. What version of phpvms are you running?
-
Your PIREP system does not record pilotid or the aircraft id so you are not going to be able to use the native phpVMS functions for callsigns and getting aircraft data from the db. Without having a db in front of me to work with it looks like the best you may do is something like this -> <?php foreach($stats as $stat) { echo '<tr>'; echo '<td>'.$stat->PilotName.'</td>'; echo '<td>'.$stat->AircraftName.'</td>'; echo '<td>'.$stat->ArrivalIcaoName.'</td>'; echo '<td>'.$stat->TouchDownVertSpeedFt.'</td>'; echo '<td>'.$stat->datestamp.'</td>'; echo '</tr>'; } ?> also, how do you get a landing rate of +63 ft/min thats taking off isnt it? lol
-
Post a shot of the database with the tables and structure.
-
Has anyone sent you a message?
-
flights to or from? If Adamm approves I can extend the code a bit...
-
No, you should not have to run the update if it is a new install. Have you checked the db to see if the airmail tables do actually exsist?
-
My mistake on this-> Config::Get('RUN_MODULE') should be-> MainController::$activeModule
-
The easiest way is to open up your db using phpmyadmin, or similar, and use the built in import function in the tabs across the top to import the file into your database from there, it will create everything automatically at that point.
-
You can add a WHERE statement to the sql call to only pull data that matches the month you want. something like -> public function get_all_stats($month) { $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps` WHERE landingrate < '0' AND MONTH(submitdate) = '$month' ORDER BY landingrate DESC"; return DB::get_results($query); } $month would be the numerical representation of the month you want. Probably will want to name the year as well or you will get the data from that month for every year that is in the db. If I write another version I will include some monthly stats capability.
-
@maiochine You will have to make some changes to the data class to start (TouchdownData.class.php) this -> public function get_all_stats() { $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps` WHERE landingrate < '0' ORDER BY landingrate DESC"; return DB::get_results($query); } would change to something like -> public function get_all_stats() { $query = "SELECT * FROM flights WHERE TouchDownVertSpeedFt < '0' ORDER BY TouchDownVertSpeedFt DESC"; return DB::get_results($query); } You can leave touchdownstats.php as it is and make changes to your tpl file to reflect the new db column names. For example in touchdownstats_index.tpl this-> echo '<td>'.$stat->landingrate.'</td>'; would change to -> echo '<td>'.$stat->TouchDownVertSpeedFt.'</td>'; All the other variable names will need to be changed to match the db table as well.
-
Same question I would have asked. The file to create the tables is included in the download package.
-
It depends on how your site is built, basically you need to wrap the ts script in it.
-
Manual PIREPS do not have a landing rate included to put in the database, generally that is only going to come from an ACARS system PIREP. Check your database to see if there is actually any data in the landing rate column. If there is no data at all in the column you will get the error as there is nothing to make the foreach command work.