Jump to content

simpilot

Administrators
  • Posts

    2773
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by simpilot

  1. Sorry Tom - Just caught this.... More than happy to share. I am on the road for work right now and I have the module running on my loacl development server at home. Should be home by the weekend and I will post it. It still needs to be cleaned up a little but I got it to work. The biggest hurdle was getting the password over to teamspeak. Also it is only working on teamspeak version2, I have not got it to work on the new version 3 beta teamspeak.
  2. Always willing to help those in the teaching community ;D You cam pm me or send email to my address here in the forum when you are ready to move along. Going on vacation for a week but sounds like I will be back before you are ready.
  3. Have you had any PIREPS filed manually lately, or have they all been filed through fsacars?
  4. Do any of the pireps awaiting approval have a fsacars log? Try putting a print_r($report); right after line 51 and see what is in the array. Please post the results here or pastebin them.
  5. This is basically what I am using at the start of each function to register it and look for the event... public function __construct() { CodonEvent::addListener('ForumRegistration', array('registration_complete)); } public function EventListener($eventinfo) { if($eventinfo[0] == 'registration_complete') { ForumRegistrationData::register_user(); } }
  6. Nabeel, I have four modules catching the same event - 'registration_complete' 1 - forum registration 2 - teamspeak registration 3 - automatic AIRMail welcome message 4 - automatic forum post announcing the new hire They all work individually if I remove the other three from the modules folder, but when I have all four in the folder only one will catch the event. Do i need to create an event at the end of each module to call the next, or should they all be able to catch the same event?
  7. The message showing up in the sent messages box is the same message as you are seeing in the inbox, it is not two seperate lines in the database. The app uses some of the qualifiers in the row in order to show it as both an incoming and outgoing message.
  8. What version are you guys using? Seems to work fine as long as the data is in the db to display. I have tested through beta 778 but have not tried anything past that. Is there any data at all in the landing_stat column?
  9. I will include an option for this in the next version as I believe that it is a good option for the admin, but some may want to have this return confirmation when a NOTAM is sent. If you would like to change it now to permenatly not send the copy to the admin sending the NOTAM you can -> 1 - Open Mail.php in the Mail module folder 2 - Find lines 89 through 95 foreach ($everyone as $allpilots) { $sql="INSERT INTO airmail (who_to, who_from, subject, message, date, time, notam) VALUES ('$allpilots->pilotid', '$who_from', '$subject', '$newmessage', NOW(), NOW(), '$notam')"; $notam = $notam+1; DB::query($sql); } And change that section to foreach ($everyone as $allpilots) { if ($allpilots->pilotid == $who_from) { } else { $sql="INSERT INTO airmail (who_to, who_from, subject, message, date, time, notam) VALUES ('$allpilots->pilotid', '$who_from', '$subject', '$newmessage', NOW(), NOW(), '$notam')"; $notam = $notam+1; DB::query($sql); } } That should make it so there is no NOTAM sent back to the person sending it, you should still be able to see it in your sent items list. I will also build in a qualifier to not send any mail to an inactive pilot in the next version as well.
  10. Sounds like the module is not seeing the event of a pirep filed in order to run the calculations and insert the data into the sql table. What version are you using? Have you made any mods to the PIREPS.php file in the main install?
  11. try reuploading all the files again, other than the sql.... it is not filling the variable for some reason, maybe a corrupted file
  12. what does the db fileds look like now? just like the first time?
  13. A 0 in the stat_calculated field means that the module has not looked at that pirep. it should not be skipping over any. The landing rate field should have a landing rate if there is a log availabloe in that row or a 0 if there is no log. I would try deleteing those two columns and rerun the sql file to clear the fields and have 0 in everything, then manually file a pirep and see if it runs through all of them. Maybe something was running at the same time...
  14. are there any values in the database for the last two? look me up on msn - i am on
  15. the module knows the difference between a manual and acars pirep... Check your db in the stat_calculated colom and tell me what is in it, and make sure both the stat_calculated and landing_rate coloum are there
  16. you have to file one for it to start - the listener is looking for "New PIREP Filed" just file a pirep manually and then delete it from pending. That should populate the db, it ma y take a few seconds to go through that many pireps the first time but should not be an issue
  17. You filed 1582 pireps since you installed the module?
  18. Have you filed a pirep since you installed the module? If not, the module has never had the chance to populate the new db fileds and will return the error you are seeing. Try filing a pirep, it does not matter if it is manual or acars, and then trying it. You can delete the priep after you file it.
  19. I think this will work better for you - corrected some phpsyntax. I am not sure where exactly you are using this but if the variables are not present you are going to get some errors. I am not sure if the template you are using this in will actually provide you with the 'B747' etc in the $schedule->aircraft variable, most places it just returns the aircraft id number from the database and you have to call the icao code for it by the id number.... <?php //you will probably want to make some checks here //if (!$flighttime) // { // echo'no flighttime'; // return; // } //if (!$schedule->aircraft) // { // echo'no aircraft'; // return; // } if($flighttime <= 1.0) { if($schedule->aircraft=='MD11') { $result = (4000 / $flighttime) + 3000; } elseif($schedule->aircraft=='B737') { $result = (2000 / $flighttime) + 1500; } elseif($schedule->aircraft=='B747') { $result = (4500 / $flighttime) + 5000; } } elseif($flighttime >=1.01) { if($schedule->aircraft=='MD11') { $result = (4000 * $flighttime) + 3000; } elseif($schedule->aircraft=='B737') { $result = (2000 * $flighttime) + 1500; } elseif($schedule->aircraft=='B747') { $result = (4500 * $flighttime) + 5000; } else { //do something here in case a variable is missing ie - echo'invalid information provided'; } } echo $result; ?>
  20. Do you have any PIreps filed via fsacars? If there are none, then there are no logs for the mod to look for and create a landing rate figure to put in the database which then will return an error as you are seeing as the variable is empty coming back from the database.
  21. try this for your lstats.tpl <center> <table> <tr> <td>Pilot</td> <td>Arrival Field</td> <td>Aircraft</td> <td>Touchdown Rate</td> </tr> <?php foreach ($lstats as $row) { echo '<tr><td><b>'; $pilot = PilotData::GetPilotData($row->pilotid); echo $pilot->firstname.' '.$pilot->lastname; echo '</b></td>'; echo '<td><b>'; echo $row->arricao; echo '</b></td><td>'; echo '<b>'; $aircraft2 = OperationsData::GetAircraftInfo($row->aircraft); echo $aircraft2->name; echo '</b></td><td>'; echo '<b>'; echo $row->landing_stat; echo ' ft/min'; echo '</b></td></tr>'; } ?> </table> </center>
  22. The pilots first name is not in the pireps table, only the pilot id out of the db - ie pilot id "1". You have to use the PilotsData class to retrieve the specific pilots information. Something like this-> $pilot = PilotData::GetPilotData($row->pilotid); echo $pilot->firstname.' '.$pilot->lastname;
  23. To get more information back from the stats you can -> In LandingStatsData.Class.php in core/common, find line 8 $query = "SELECT pirepid, pilotid, code, arricao, landing_stat and change it to $query = "SELECT * This will return all the pirep fields in the db back to the template in the $lstats variable. Then in the template after your for each command you can display whichever information you would like. For example, <center> <table> <tr> <td>Pilot</td> <td>Arrival Field</td> <td>Aircraft</td> <td>Touchdown Rate</td> </tr> <?php foreach ($lstats as $row) { echo '<tr><td><b>'; $pilot = PilotData::GetPilotData($row->pilotid); echo $pilot->firstname.' '.$pilot->lastname; echo '</b></td>'; echo '<td><b>'; echo $row->arricao; echo '</b></td><td>'; echo '<b>'; $aircraft2 = OperationsData::GetAircraftInfo($row->aircraft); echo $aircraft2->name; echo '</b></td><td>'; echo '<b>'; echo $row->landing_stat; echo ' ft/min'; echo '</b></td></tr>'; } ?> </table> </center> would display something like this -> You can just replace the field after -> with the db field in the pireps table for the information you want to display. I will change it for the next version.
  24. M-Queiroz, Built a module to do this - Try it out and see what you think - http://forum.phpvms.net/index.php?topic=1344.0
  25. I have created a module to extract and display the touchdown rate for landings for pilots submitting a pirep via fsacars and looking for some active airlines to test it and give feedback. To install; 1 - Download attached folder and unzip 2 - Place the Landingstats module folder in core/modules/ 3 - Place the LandingstatsData.class.php file in core/common/ 4 - Place the lstats.tpl file in core/templates or your skin folder 5 - Use phpmyadmin (or similar) to run the landing_stats.sql file in your airline database. It will add two fields to the pireps table, stat_calculated and landing_stat 6 - In admin/templates find and open pireps_list.tpl Find Line 51: Flight Time: <?php echo $report->flighttime; ?><br /> Add a new blank line after line 51 and insert: Landing Rate: <?php echo $report->landing_stat; ?> ft/min<br /> Save file **You will have to have at least one pirep filed (of any type) after installing the module for the module to go back and calculate the landing stat for all the old pireps. From then on it will calculate the landing rate for each pirep filed and insert it into the database. You will be able to see the landing rate (for pireps filed using fsacars) in the admin panel when reviewing new pireps for approval. If you want a chart showing the best landing rates on your site you can use the other function built into Landingstats to call a table -> <?php MainController::Run('Landingstats', 'display_landingstats', '8'); ?> It will output -> The '8' in the call for the table tells it how many rows you want returned. It is set to return the best rate first and then decending through the rest so if you only call for one row, you will get only the best landing rate currently filed. *The lstats.tpl file is very basic and will need to be skinned into your template *tested with beta778 in it's current form with no issues Please let me know of any issues in your installation that you have with the module.
×
×
  • Create New...