Members Vangelis Posted January 23, 2014 Members Report Share Posted January 23, 2014 (edited) Hello finaly i finished it and sharing witht he comunity Are tired of accepting or even rejecting pireps ? Then do not worry Auto Accept/Reject Pirep is here to help you It has a admin interface so you will be able to add 1. The VA's admin pilot admin that declines the PIREP 2. Function that searches the pirep log for custom criteria and decline the pirep 3. Functionality that adds the reason why it was declined in the PIREP's Comments. 4. Custom Reason why the pirep was decliened For Example Your Pirep has been rejected because you " Custom Text" 5. Function that send an e-mail to admin and or to pilot when pirep rejected 6. It is compartible with Simpilot's Plugin Manager You can see a demo of the admin page at www.baggelis.com/phpvms Login with the demo admin account and find the settings page under Pilot Reports (PIREPS) -> Auto Pirep You can download it from here http://baggelis.com/autopirep0.zip Screenshots Below Edited August 26, 2018 by Vangelis 3 Quote Link to comment Share on other sites More sharing options...
MC1028 Posted January 23, 2014 Report Share Posted January 23, 2014 This looks great, and ill test it tomorrow! Quote Link to comment Share on other sites More sharing options...
gio1961 Posted January 24, 2014 Report Share Posted January 24, 2014 Hello I do not know if it is a mistake or not ... It says here that the Pireps has been accepted but the comment says it was rejected? ... http://www.baggelis.com/phpvms/index.php/pireps/viewreport/231 Sincerely Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted January 24, 2014 Author Members Report Share Posted January 24, 2014 That is a leftover from when i was trying the module I shall delete this pirep Quote Link to comment Share on other sites More sharing options...
gio1961 Posted January 24, 2014 Report Share Posted January 24, 2014 lying problem http://www.baggelis.com/phpvms/index.php/pireps/viewreport/247 Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted January 24, 2014 Author Members Report Share Posted January 24, 2014 Indeed there was a problem by accepting the pireps with a bigger rate of landing you will find an updated version in the link that i provided you before or you can update the function by downloading PirepAcData.class.php and replacing the one that is in core/common I also deleted the mistaken pireps from my beta site Sorry for the trouble Quote Link to comment Share on other sites More sharing options...
gio1961 Posted January 24, 2014 Report Share Posted January 24, 2014 No trouble at all, thanks to you ... Yours sincerely Quote Link to comment Share on other sites More sharing options...
Ashj24uk Posted January 24, 2014 Report Share Posted January 24, 2014 when i try to add the sql i get this error 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM AUTO_INCREMENT=38' at line 9 any ideas what could be wrong? Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted January 24, 2014 Author Members Report Share Posted January 24, 2014 Hi can you try with this sql ? also are you installing manualy or with simpilots plugin manager ? AutoPirep.zip Quote Link to comment Share on other sites More sharing options...
Ashj24uk Posted January 24, 2014 Report Share Posted January 24, 2014 im installing it manualy Quote Link to comment Share on other sites More sharing options...
Ashj24uk Posted January 24, 2014 Report Share Posted January 24, 2014 i just tried the new one and got #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `phpvms_autopirep` (`id`, `criteria_description`, `created_by`, `ena' at line 12 Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted January 24, 2014 Author Members Report Share Posted January 24, 2014 This one should work i changed the mysql version AutoPirep.zip Quote Link to comment Share on other sites More sharing options...
Ashj24uk Posted January 24, 2014 Report Share Posted January 24, 2014 sorry still getting the first error its strange 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 9 Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted January 24, 2014 Author Members Report Share Posted January 24, 2014 Here we go again 1 more to try AutoPirep.zip Quote Link to comment Share on other sites More sharing options...
Ashj24uk Posted January 24, 2014 Report Share Posted January 24, 2014 That worked perfectly thank you for your help Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted January 24, 2014 Author Members Report Share Posted January 24, 2014 No problem i will update the installation ass well as it seems it isn't working in all mysql versions Quote Link to comment Share on other sites More sharing options...
TB1 Posted January 25, 2014 Report Share Posted January 25, 2014 Hi. Cool module! I have got rid of the default criteria because we don't need them however it will not auto-accept any of the PIREPS. Should it accept the PIREPS automatically or is there something I have to do in the settings to get them to auto-accept. Thanks! Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted January 25, 2014 Author Members Report Share Posted January 25, 2014 Make sure you have added a valid pilot id in format VBA004 and replace your PirepAcData.class.php with this one PirepAcData.class.php i didnt thought of using it without a criteria so didnt saw that there was a problem when there was none with this one you should be ok if not tell me I have also updated the donwload Best regards and sorry for the trouble Quote Link to comment Share on other sites More sharing options...
TB1 Posted January 25, 2014 Report Share Posted January 25, 2014 What if my pilot ID's are HAxxx? Quote Link to comment Share on other sites More sharing options...
Txmmy83 Posted January 25, 2014 Report Share Posted January 25, 2014 my Pilot ID is in format VLIxxxx it doesnt approve pireps using kACARS and CAVACARS maybe I have it at the false line PirepData Class? public static function updateFlightReport($pirepid, $pirepdata, $recalc_finances = true) { if (!is_array($pirepdata)) { return false; } if ($pirepdata['depicao'] == '' || $pirepdata['arricao'] == '') { return false; PirepAcData::search($pirepid); } $pirepinfo = self::getReportDetails($pirepid); if(isset($pirepdata['fuelused']) && isset($pirepdata['fuelunitcost'])) { $pirepdata['fuelprice'] = $pirepdata['fuelused'] * $pirepdata['fuelunitcost']; } if(isset($pirepdata['flighttime'])) { $flighttime_stamp = str_replace('.', ':', $pirepdata['flighttime']) . ':00'; $pirepdata['flighttime'] = str_replace(':', ',', $pirepdata['flighttime']); } # Recalculate finances if these fields are set... Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted January 25, 2014 Author Members Report Share Posted January 25, 2014 You placed it in the wrong function it should in PirepData.class (That is correct) under filereport function at some point in this function put it between # Update any pilot's information $pilotinfo = PilotData::getPilotData($pirepdata['pilotid']); $pilotcode = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); PilotData::UpdateLastPIREPDate($pilotinfo->pilotid); and # Send an email to the admin that a PIREP was submitted $sub = "A PIREP has been submitted by {$pilotcode} ({$pirepdata['depicao']} - {$pirepdata['arricao']})"; $message="A PIREP has been submitted by {$pilotcode} ({$pilotinfo->firstname} {$pilotinfo->lastname})\n\n" ."{$pirepdata['code']}{$pirepdata['flightnum']}: {$pirepdata['depicao']} to {$pirepdata['arricao']}\n" ."Aircraft: {$pirepdata['aircraft']}\n" ."Flight Time: {$pirepdata['flighttime']}\n" ."Filed using: {$pirepdata['source']}\n\n" ."Comment: {$pirepdata['comment']}"; $email = Config::Get('EMAIL_NEW_PIREP'); if(empty($email)) { $email = ADMIN_EMAIL; } Util::SendEmail($email, $sub, $message); CentralData::send_pirep($pirepid); // Reset this ID back DB::$insert_id = $pirepid; self::$pirepid = $pirepid; return true; } so it should be something like this # Update any pilot's information $pilotinfo = PilotData::getPilotData($pirepdata['pilotid']); $pilotcode = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); PilotData::UpdateLastPIREPDate($pilotinfo->pilotid); FacebookPost::FacebookPostFlight($pirepid); PirepAcData::search($pirepid); # Send an email to the admin that a PIREP was submitted $sub = "A PIREP has been submitted by {$pilotcode} ({$pirepdata['depicao']} - {$pirepdata['arricao']})"; $message="A PIREP has been submitted by {$pilotcode} ({$pilotinfo->firstname} {$pilotinfo->lastname})\n\n" ."{$pirepdata['code']}{$pirepdata['flightnum']}: {$pirepdata['depicao']} to {$pirepdata['arricao']}\n" ."Aircraft: {$pirepdata['aircraft']}\n" ."Flight Time: {$pirepdata['flighttime']}\n" ."Filed using: {$pirepdata['source']}\n\n" ."Comment: {$pirepdata['comment']}"; $email = Config::Get('EMAIL_NEW_PIREP'); if(empty($email)) { $email = ADMIN_EMAIL; } Util::SendEmail($email, $sub, $message); CentralData::send_pirep($pirepid); // Reset this ID back DB::$insert_id = $pirepid; self::$pirepid = $pirepid; return true; } That is why it doesnt work Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted January 25, 2014 Author Members Report Share Posted January 25, 2014 What if my pilot ID's are HAxxx? Doesn't matter the only requirement for the auto comment to work is that you inserted your full username beware that this is the name that will be shown in the comments Quote Link to comment Share on other sites More sharing options...
Txmmy83 Posted January 26, 2014 Report Share Posted January 26, 2014 still have problems Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted January 26, 2014 Author Members Report Share Posted January 26, 2014 as the screen shot says you have altered the PilotData and not The PirepData look at the preview post that i made and make sure that you have put PilotData::UpdateLastPIREPDate($pilotinfo->pilotid); in the corect place if you are unable to do that send me your PIREPData.class.php Quote Link to comment Share on other sites More sharing options...
Txmmy83 Posted January 26, 2014 Report Share Posted January 26, 2014 I dont know if it is Important but I am on phpVMS beta version because of Nighthawks Aircraft Purchase mod PIREPData.class.php Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted January 26, 2014 Author Members Report Share Posted January 26, 2014 Could be as in yours it is in total different line try with this one PIREPData.class.php This file is ONLY for Txmmy83 or members that are using the beta build for the rest it wont work or it might destroy your setup 1 Quote Link to comment Share on other sites More sharing options...
Txmmy83 Posted January 26, 2014 Report Share Posted January 26, 2014 perfect works Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted January 26, 2014 Author Members Report Share Posted January 26, 2014 I am glad to hear that Quote Link to comment Share on other sites More sharing options...
Txmmy83 Posted January 26, 2014 Report Share Posted January 26, 2014 I am glad to hear that it woked at the first try but not at second time I get same error message I have posted before Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted January 26, 2014 Author Members Report Share Posted January 26, 2014 can you attach and the pilotdata.class and the pirepacdata.class that you have ? 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.