# Auto Accept/Reject Pirep

**URL:** <https://forum.phpvms.net/t/auto-accept-reject-pirep/8912>\
**Category:** Releases\
**Created:** [January 23, 2014, 9:11pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912 "2014-01-23T21:11:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vangelis](https://forum.phpvms.net/user_avatar/forum.phpvms.net/vangelis/32/38_2.png) [@Vangelis](https://forum.phpvms.net/u/Vangelis)\
**Post date:** [January 23, 2014, 9:11pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/1 "2014-01-23T21:11:46Z")

</div>

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"

1. Function that send an e-mail to admin and or to pilot when pirep rejected

2. It is compartible with Simpilot’s Plugin Manager

You can see a demo of the admin page at [www.baggelis.com/phpvms](http://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&nbsp;[http://baggelis.com/autopirep0.zip](http://baggelis.com/autopirep0.zip)

Screenshots Below

![post-271-0-05610000-1390511470.png](https://phpvms-forum.nyc3.digitaloceanspaces.com/original/2X/8/8862991cc06c24fab379fab4cb8e5b6d24dc14eb.jpeg)

![post-271-0-59071600-1390511486.png](https://phpvms-forum.nyc3.digitaloceanspaces.com/original/2X/8/8cd4dae666f15f23b061eedda2efadaf85c78d1b.jpeg)

---

<div class="post-metadata">

**Author:** ![MC1028](https://forum.phpvms.net/user_avatar/forum.phpvms.net/mc1028/32/319_2.png) [@MC1028](https://forum.phpvms.net/u/MC1028)\
**Post date:** [January 23, 2014, 11:28pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/2 "2014-01-23T23:28:33Z")

</div>

This looks great, and ill test it tomorrow!

---

<div class="post-metadata">

**Author:** ![gio1961](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@gio1961](https://forum.phpvms.net/u/gio1961)\
**Post date:** [January 24, 2014, 8:50am UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/3 "2014-01-24T08:50:43Z")

</div>

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](http://www.baggelis.com/phpvms/index.php/pireps/viewreport/231)

Sincerely

---

<div class="post-metadata">

**Author:** ![Vangelis](https://forum.phpvms.net/user_avatar/forum.phpvms.net/vangelis/32/38_2.png) [@Vangelis](https://forum.phpvms.net/u/Vangelis)\
**Post date:** [January 24, 2014, 10:48am UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/4 "2014-01-24T10:48:18Z")

</div>

That is a leftover from when i was trying the module

I shall delete this pirep

---

<div class="post-metadata">

**Author:** ![gio1961](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@gio1961](https://forum.phpvms.net/u/gio1961)\
**Post date:** [January 24, 2014, 11:38am UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/5 "2014-01-24T11:38:02Z")

</div>

lying problem

[http://www.baggelis.com/phpvms/index.php/pireps/viewreport/247](http://www.baggelis.com/phpvms/index.php/pireps/viewreport/247)

---

<div class="post-metadata">

**Author:** ![Vangelis](https://forum.phpvms.net/user_avatar/forum.phpvms.net/vangelis/32/38_2.png) [@Vangelis](https://forum.phpvms.net/u/Vangelis)\
**Post date:** [January 24, 2014, 12:00pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/6 "2014-01-24T12:00:17Z")

</div>

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](\< _ **base\_url** _ \>/applications/core/interface/file/attachment.php?id=1266) and replacing the one that is in core/common

I also deleted the mistaken pireps from my beta site

Sorry for the trouble

---

<div class="post-metadata">

**Author:** ![gio1961](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/g/ea666f/32.png) [@gio1961](https://forum.phpvms.net/u/gio1961)\
**Post date:** [January 24, 2014, 12:33pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/7 "2014-01-24T12:33:55Z")

</div>

No trouble at all, thanks to you … Yours sincerely

---

<div class="post-metadata">

**Author:** ![Ashj24uk](https://forum.phpvms.net/user_avatar/forum.phpvms.net/ashj24uk/32/290_2.png) [@Ashj24uk](https://forum.phpvms.net/u/Ashj24uk)\
**Post date:** [January 24, 2014, 7:40pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/8 "2014-01-24T19:40:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Vangelis](https://forum.phpvms.net/user_avatar/forum.phpvms.net/vangelis/32/38_2.png) [@Vangelis](https://forum.phpvms.net/u/Vangelis)\
**Post date:** [January 24, 2014, 7:48pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/9 "2014-01-24T19:48:23Z")

</div>

Hi can you try with this sql ? also are you installing manualy or with simpilots plugin manager ?

[AutoPirep.zip](\< _ **base\_url** _ \>/applications/core/interface/file/attachment.php?id=1268)

---

<div class="post-metadata">

**Author:** ![Ashj24uk](https://forum.phpvms.net/user_avatar/forum.phpvms.net/ashj24uk/32/290_2.png) [@Ashj24uk](https://forum.phpvms.net/u/Ashj24uk)\
**Post date:** [January 24, 2014, 7:53pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/10 "2014-01-24T19:53:13Z")

</div>

im installing it manualy

---

<div class="post-metadata">

**Author:** ![Ashj24uk](https://forum.phpvms.net/user_avatar/forum.phpvms.net/ashj24uk/32/290_2.png) [@Ashj24uk](https://forum.phpvms.net/u/Ashj24uk)\
**Post date:** [January 24, 2014, 7:55pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/11 "2014-01-24T19:55:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Vangelis](https://forum.phpvms.net/user_avatar/forum.phpvms.net/vangelis/32/38_2.png) [@Vangelis](https://forum.phpvms.net/u/Vangelis)\
**Post date:** [January 24, 2014, 8:03pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/12 "2014-01-24T20:03:26Z")

</div>

This one should work i changed the mysql version

[AutoPirep.zip](\< _ **base\_url** _ \>/applications/core/interface/file/attachment.php?id=1269)

---

<div class="post-metadata">

**Author:** ![Ashj24uk](https://forum.phpvms.net/user_avatar/forum.phpvms.net/ashj24uk/32/290_2.png) [@Ashj24uk](https://forum.phpvms.net/u/Ashj24uk)\
**Post date:** [January 24, 2014, 8:06pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/13 "2014-01-24T20:06:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Vangelis](https://forum.phpvms.net/user_avatar/forum.phpvms.net/vangelis/32/38_2.png) [@Vangelis](https://forum.phpvms.net/u/Vangelis)\
**Post date:** [January 24, 2014, 8:11pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/14 "2014-01-24T20:11:13Z")

</div>

Here we go again 1 more to try

[AutoPirep.zip](\< _ **base\_url** _ \>/applications/core/interface/file/attachment.php?id=1270)

---

<div class="post-metadata">

**Author:** ![Ashj24uk](https://forum.phpvms.net/user_avatar/forum.phpvms.net/ashj24uk/32/290_2.png) [@Ashj24uk](https://forum.phpvms.net/u/Ashj24uk)\
**Post date:** [January 24, 2014, 8:13pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/15 "2014-01-24T20:13:57Z")

</div>

That worked perfectly thank you for your help

---

<div class="post-metadata">

**Author:** ![Vangelis](https://forum.phpvms.net/user_avatar/forum.phpvms.net/vangelis/32/38_2.png) [@Vangelis](https://forum.phpvms.net/u/Vangelis)\
**Post date:** [January 24, 2014, 8:14pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/16 "2014-01-24T20:14:59Z")

</div>

No problem i will update the installation ass well as it seems it isn’t working in all mysql versions

---

<div class="post-metadata">

**Author:** ![TB1](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tb1/32/366_2.png) [@TB1](https://forum.phpvms.net/u/TB1)\
**Post date:** [January 25, 2014, 10:07am UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/17 "2014-01-25T10:07:00Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Vangelis](https://forum.phpvms.net/user_avatar/forum.phpvms.net/vangelis/32/38_2.png) [@Vangelis](https://forum.phpvms.net/u/Vangelis)\
**Post date:** [January 25, 2014, 11:29am UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/18 "2014-01-25T11:29:09Z")

</div>

Make sure you have added a valid pilot id in format VBA004

and replace your PirepAcData.class.php with this one [PirepAcData.class.php](\< _ **base\_url** _ \>/applications/core/interface/file/attachment.php?id=1271)

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

---

<div class="post-metadata">

**Author:** ![TB1](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tb1/32/366_2.png) [@TB1](https://forum.phpvms.net/u/TB1)\
**Post date:** [January 25, 2014, 6:47pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/19 "2014-01-25T18:47:54Z")

</div>

What if my pilot ID’s are HAxxx?

---

<div class="post-metadata">

**Author:** ![Txmmy83](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/t/f14d63/32.png) [@Txmmy83](https://forum.phpvms.net/u/Txmmy83)\
**Post date:** [January 25, 2014, 7:26pm UTC](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912/20 "2014-01-25T19:26:54Z")

</div>

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...

```

[Next page](https://forum.phpvms.net/t/auto-accept-reject-pirep/8912.md?page=2)
