# phpVMS CentralDATA updates

**URL:** <https://forum.phpvms.net/t/phpvms-centraldata-updates/10521>\
**Category:** General Support\
**Created:** [September 26, 2015, 12:51am UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521 "2015-09-26T00:51:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [September 26, 2015, 12:51am UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/1 "2015-09-26T00:51:36Z")

</div>

The source field for all pireps sent to vaCentral has been missing in all versions of phpVMS.

If you are using version \<= 936 you will need to add the following line to CentralData.class.php

find (appx line 387)

```
$pirep_xml->addChild('revenue', $pirep->revenue);

```

and add

```
$pirep_xml->addChild('source', $pirep->source);

```

Final config should look like

```
$pirep_xml->addChild('revenue', $pirep->revenue);
$pirep_xml->addChild('source', $pirep->source);
}

```

If you are using one of my 5.x versions you will have to make a slightly different change which you can find here -\> [https://github.com/D…a1e0f72f10e517d](https://github.com/DavidJClark/phpvms_5.5.x/commit/f2fe6d7fb2b57321cdf045a06a1e0f72f10e517d)

This will allow vaCentral to track how the PIREP is being submitted. I am most likely going to reduce the value of manually submitted PIREPs.

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [September 29, 2015, 5:08pm UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/2 "2015-09-29T17:08:34Z")

</div>

I am looking for airlines running my version of phpVMS (5.x) to update their central data files to allow for updates to vaCentral and the scoring system.

NOTE: If you are running a different version you can try the new code but I do not guarantee compatibility.

---

<div class="post-metadata">

**Author:** ![ercio](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/e/ecb155/32.png) [@ercio](https://forum.phpvms.net/u/ercio)\
**Post date:** [October 29, 2015, 2:29pm UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/3 "2015-10-29T14:29:37Z")

</div>

well I did add the code but my VA still not sending updates ! I m using Smartcars 2

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [October 29, 2015, 5:49pm UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/4 "2015-10-29T17:49:12Z")

</div>

> well I did add the code but my VA still not sending updates ! I m using Smartcars 2

Do you have the config setup with the correct key and everything?

SmartCars does not report live map information if that is what you are looking for, only pirep’s. You can find more about it here -\> [http://www.vacentral.net/faq](http://www.vacentral.net/faq)

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [October 30, 2015, 12:30am UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/5 "2015-10-30T00:30:52Z")

</div>

The landingrate field for all pireps sent to vaCentral has been missing in all versions of phpVMS.

If you are using version \<= 936 you will need to add the following line to CentralData.class.php

find (appx line 387)

```
$pirep_xml->addChild('revenue', $pirep->revenue);
$pirep_xml->addChild('source', $pirep->source);

```

and add

```
$pirep_xml->addChild('landingrate', $pirep->landingrate);

```

Final config should look like

```
$pirep_xml->addChild('revenue', $pirep->revenue);
$pirep_xml->addChild('source', $pirep->source);
$pirep_xml->addChild('landingrate', $pirep->landingrate);
}

```

If you are using one of my 5.x versions you will have to make a slightly different change which you can find here -\> [https://github.com/D…a34aa0bee89bc97](https://github.com/DavidJClark/phpvms_5.5.x/commit/ac497a219ae118d9799efdedaa34aa0bee89bc97)

This will allow vaCentral to track landing rates. **This is going to be part of the new scoring system**.

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [November 1, 2015, 6:30pm UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/6 "2015-11-01T18:30:14Z")

</div>

The log, route, and rawdata field for all pireps sent to vaCentral has also been missing in all versions of phpVMS.

If you are using version \<= 936 you will need to add the following line to CentralData.class.php

find (appx line 387)

```
$pirep_xml->addChild('revenue', $pirep->revenue);
$pirep_xml->addChild('source', $pirep->source);
$pirep_xml->addChild('landingrate', $pirep->landingrate);

```

and add

```
$pirep_xml->addChild('log', $pirep->log);
$pirep_xml->addChild('route', $pirep->route);
$pirep_xml->addChild('rawdata', $pirep->rawdata);

```

Final config should look like

```
$pirep_xml->addChild('revenue', $pirep->revenue);
$pirep_xml->addChild('source', $pirep->source);
$pirep_xml->addChild('landingrate', $pirep->landingrate);
$pirep_xml->addChild('log', $pirep->log);
$pirep_xml->addChild('route', $pirep->route);
$pirep_xml->addChild('rawdata', $pirep->rawdata);

}

```

If you are using one of my 5.x versions you will have to make a slightly different change to the CentralData.class.php file which you can find here -\> [https://github.com/D…36627cd84661994](https://github.com/DavidJClark/phpvms_5.5.x/commit/4a43805fe4011df388ba313f236627cd84661994) and here -\> [https://github.com/D…1d30bf0c602d5a1](https://github.com/DavidJClark/phpvms_5.5.x/commit/c44e39ea2ed7218e81e4377dd1d30bf0c602d5a1)

EDIT: You must also make a change to PIREPData.class.php

Find this following around line 320 for versions \<= 936

```
public static function getReportDetails($pirepid)
{
 $sql = 'SELECT p.*, s.*, s.id AS scheduleid, p.route, p.route_details,
    u.pilotid, u.firstname, u.lastname, u.email, u.rank,

```

and change to

```
public static function getReportDetails($pirepid)
{
 $sql = 'SELECT p.*, s.*, s.id AS scheduleid, p.route, p.route_details, p.rawdata,
    u.pilotid, u.firstname, u.lastname, u.email, u.rank,

```

If you are running a 5.5.x version the change can be found here -\> [https://github.com/DavidJClark/phpvms\_5.5.x/commit/b746267be2988f7bfdc3017dabd215c2bc20e83d](https://github.com/DavidJClark/phpvms_5.5.x/commit/b746267be2988f7bfdc3017dabd215c2bc20e83d)

---

<div class="post-metadata">

**Author:** ![pikitanga](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@pikitanga](https://forum.phpvms.net/u/pikitanga)\
**Post date:** [November 2, 2015, 2:51am UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/7 "2015-11-02T02:51:04Z")

</div>

Hi simpilot,

As ZonExecutive uses ‘xacars’ we cannot return a landing rate.

Should we return blank/empty for the landing rate ?

Cheers,

Duncan

VP of Operations, ZonExecutive

---

<div class="post-metadata">

**Author:** ![pikitanga](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@pikitanga](https://forum.phpvms.net/u/pikitanga)\
**Post date:** [November 2, 2015, 3:01am UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/8 "2015-11-02T03:01:35Z")

</div>

Do you have the SQL in post #6 reversed ie shouldn’t you be adding ‘p.rawdata’ not removing ?

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [November 2, 2015, 11:43am UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/9 "2015-11-02T11:43:35Z")

</div>

> Do you have the SQL in post #6 reversed ie shouldn’t you be adding ‘p.rawdata’ not removing ?

Corrected

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [November 2, 2015, 11:45am UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/10 "2015-11-02T11:45:16Z")

</div>

> Hi simpilot,
> 
> As ZonExecutive uses ‘xacars’ we cannot return a landing rate.
> 
> Should we return blank/empty for the landing rate ?
> 
> Cheers,
> 
> Duncan
> 
> VP of Operations, ZonExecutive

vaCentral will automatically set the field to zero if it is not present in the data transmission.

---

<div class="post-metadata">

**Author:** ![ercio](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/e/ecb155/32.png) [@ercio](https://forum.phpvms.net/u/ercio)\
**Post date:** [November 2, 2015, 3:36pm UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/11 "2015-11-02T15:36:41Z")

</div>

awesome , it works VA Rank 124 !! [www.varigvirtual.com](http://www.varigvirtual.com)

---

<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:** [November 3, 2015, 2:26am UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/12 "2015-11-03T02:26:39Z")

</div>

David,

I did not find the line

```
$pirep_xml->addChild('revenue', $pirep->revenue);

```

in my CentralData.Class.php any ideas

my phpVMS version number reads v2.1.934-170-g5ca803a I have reviewed my file and it looks a bit like a 5x Version?

I have that in my

```
protected static function get_pirep_xml($pirep) {

 $pilotid = PilotData::getPilotCode($pirep->code, $pirep->pilotid);
 $pirep_xml = self::addElement(null, 'pirep', null, array(
	 'uniqueid' => $pirep->pirepid,
	 'pilotid' => $pilotid,
	 'pilotname' => $pirep->firstname . ' ' . $pirep->lastname,
	 'flightnum' => $pirep->code . $pirep->flightnum,
	 'depicao' => $pirep->depicao,
	 'arricao' => $pirep->arricao,
	 'aircraft' => $pirep->aircraft,
	 'registration' => $pirep->registration,
	 'flighttime' => $pirep->flighttime_stamp,
	 'submitdate' => $pirep->submitdate,
	 'modifieddate' => $pirep->modifieddate,
	 'flighttype' => $pirep->flighttype,
	 'load' => $pirep->load,
	 'fuelused' => $pirep->fuelused,
	 'fuelprice' => $pirep->fuelprice,
	 'pilotpay' => $pirep->pilotpay,
	 'price' => $pirep->price,
	 'source' => $pirep->source,
	 'revenue' => $pirep->revenue,
 ));
}

```

---

<div class="post-metadata">

**Author:** ![mattia](https://forum.phpvms.net/user_avatar/forum.phpvms.net/mattia/32/147_2.png) [@mattia](https://forum.phpvms.net/u/mattia)\
**Post date:** [November 3, 2015, 4:27pm UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/13 "2015-11-03T16:27:21Z")

</div>

Hi David,

I made your updates but when i try to send the pirep on vacentral i receive this error

**Warning: SimpleXMLElement::addChild() expects parameter 2 to be string, array given in**

when send the rawdata

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [November 4, 2015, 1:33am UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/14 "2015-11-04T01:33:58Z")

</div>

> Hi David,
> 
> I made your updates but when i try to send the pirep on vacentral i receive this error
> 
> **Warning: SimpleXMLElement::addChild() expects parameter 2 to be string, array given in**
> 
> when send the rawdata

If you are getting that error try changing that line to;

```
$pirep_xml->addChild('rawdata', serialize($pirep->rawdata));

```

---

<div class="post-metadata">

**Author:** ![HighFlyerPL185](https://forum.phpvms.net/user_avatar/forum.phpvms.net/highflyerpl185/32/145_2.png) [@HighFlyerPL185](https://forum.phpvms.net/u/HighFlyerPL185)\
**Post date:** [November 4, 2015, 9:37am UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/15 "2015-11-04T09:37:55Z")

</div>

Is the change effective immediately after changing the code? My airline still shows 165 PIREPs while in reality we have close to 5,000 reports.

---

<div class="post-metadata">

**Author:** ![mattia](https://forum.phpvms.net/user_avatar/forum.phpvms.net/mattia/32/147_2.png) [@mattia](https://forum.phpvms.net/u/mattia)\
**Post date:** [November 4, 2015, 11:36am UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/16 "2015-11-04T11:36:38Z")

</div>

> If you are getting that error try changing that line to;
> 
> $pirep\_xml-\>addChild(‘rawdata’, serialize($pirep-\>rawdata));

Now it seems to work, thank you very much David!

last question When your updates are finished ranking back to normal? for example the Phoenix Virtual Airways will return the first?

---

<div class="post-metadata">

**Author:** ![algaeholics](https://forum.phpvms.net/user_avatar/forum.phpvms.net/algaeholics/32/357_2.png) [@algaeholics](https://forum.phpvms.net/u/algaeholics)\
**Post date:** [November 4, 2015, 12:44pm UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/17 "2015-11-04T12:44:28Z")

</div>

Hi David

\_RE: "\__This will allow vaCentral to track how the PIREP is being submitted. I am most likely going to reduce the value of manually submitted PIREPs. "_

Having written my own tracking software - can I confirm that this reduced ‘value’ will be based upon ‘manual’ being recorded in the PIREP ‘source’ field, or do you have a database of ‘acceptable’ trackers?

Much appreciated.

Tim Walters

[MaldAir.com](http://MaldAir.com)

---

<div class="post-metadata">

**Author:** ![pikitanga](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@pikitanga](https://forum.phpvms.net/u/pikitanga)\
**Post date:** [November 5, 2015, 7:29pm UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/18 "2015-11-05T19:29:16Z")

</div>

Hi David,

With the new ranking system, do you know why some of the top airlines never seem to appear on the live map ?

Regards,

Duncan

---

<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:** [November 6, 2015, 4:49am UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/19 "2015-11-06T04:49:33Z")

</div>

Hi Duncan,

the answer is quite simple some of these VA’s using other Systems then phpVMS and other Pirep Clients and manually Upload their statistics when approved

Smartcars flights for example never show up on live map but that is written in vacentral FAQ page

So not being on live map does NOT necessarily mean they are not flying!

Best regards,

Thomas Schedl

---

<div class="post-metadata">

**Author:** ![vJet2](https://forum.phpvms.net/user_avatar/forum.phpvms.net/vjet2/32/137_2.png) [@vJet2](https://forum.phpvms.net/u/vJet2)\
**Post date:** [November 15, 2015, 1:07am UTC](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521/20 "2015-11-15T01:07:42Z")

</div>

> David,
> 
> I did not find the line
> 
> $pirep\_xml-\>addChild(‘revenue’, $pirep-\>revenue);
> 
> in my CentralData.Class.php any ideas
> 
> my phpVMS version number reads v2.1.934-170-g5ca803a I have reviewed my file and it looks a bit like a 5x Version?
> 
> I have that in my
> 
> protected static function get\_pirep\_xml($pirep) {
> 
> $pilotid = PilotData::getPilotCode($pirep-\>code, $pirep-\>pilotid);  
> $pirep\_xml = self::addElement(null, ‘pirep’, null, array(  
> ‘uniqueid’ =\> $pirep-\>pirepid,  
> ‘pilotid’ =\> $pilotid,  
> ‘pilotname’ =\> $pirep-\>firstname . ’ ’ . $pirep-\>lastname,  
> ‘flightnum’ =\> $pirep-\>code . $pirep-\>flightnum,  
> ‘depicao’ =\> $pirep-\>depicao,  
> ‘arricao’ =\> $pirep-\>arricao,  
> ‘aircraft’ =\> $pirep-\>aircraft,  
> ‘registration’ =\> $pirep-\>registration,  
> ‘flighttime’ =\> $pirep-\>flighttime\_stamp,  
> ‘submitdate’ =\> $pirep-\>submitdate,  
> ‘modifieddate’ =\> $pirep-\>modifieddate,  
> ‘flighttype’ =\> $pirep-\>flighttype,  
> ‘load’ =\> $pirep-\>load,  
> ‘fuelused’ =\> $pirep-\>fuelused,  
> ‘fuelprice’ =\> $pirep-\>fuelprice,  
> ‘pilotpay’ =\> $pirep-\>pilotpay,  
> ‘price’ =\> $pirep-\>price,  
> ‘source’ =\> $pirep-\>source,  
> ‘revenue’ =\> $pirep-\>revenue,  
> ));  
> }

I am exactly the same. Can you advise what I need to do. My VA Rank has dropped fro 72 to 101

Thanks in advance

[Next page](https://forum.phpvms.net/t/phpvms-centraldata-updates/10521.md?page=2)
