7 minutes ago, servetas said:
What’s on line 337 on your PIREPData.class.php file? Share with us line 337 plus a few lines before and after to understand what it is trying to parse.
Hi here from line
here from line 308 to 362
337 start with $row->rawdata = unserialize($row->rawdata);
/\*\* \* Get the number of reports for the last x number of days \* Returns 1 row for every day, with the total number of \* reports per day \*/ public static function getCountsForDays($days = 7) { $sql = 'SELECT DISTINCT(DATE(submitdate)) AS submitdate, (SELECT COUNT(\*) FROM '.TABLE\_PREFIX.'pireps WHERE DATE(submitdate)=DATE(p.submitdate)) AS count FROM '.TABLE\_PREFIX.'pireps p WHERE DATE\_SUB(CURDATE(), INTERVAL 7 DAY) \<= p.submitdate'; return DB::get\_results($sql); } /\*\* \* Get all of the details for a PIREP, including lat/long of the airports \*/ 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, dep.name as depname, dep.lat AS deplat, dep.lng AS deplng, arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng, p.code, p.flightnum, p.depicao, p.arricao, p.price AS price, a.id as aircraftid, a.name as aircraft, a.registration, p.flighttime, p.distance, UNIX\_TIMESTAMP(p.submitdate) as submitdate, p.accepted, p.log FROM '.TABLE\_PREFIX.'pilots u, '.TABLE\_PREFIX.'pireps p LEFT JOIN '.TABLE\_PREFIX.'airports AS dep ON dep.icao = p.depicao LEFT JOIN '.TABLE\_PREFIX.'airports AS arr ON arr.icao = p.arricao LEFT JOIN '.TABLE\_PREFIX.'aircraft a ON a.id = p.aircraft LEFT JOIN '.TABLE\_PREFIX.'schedules s ON s.code = p.code AND s.flightnum = p.flightnum WHERE p.pilotid=u.pilotid AND p.pirepid='.$pirepid; $row = DB::get\_row($sql); $row-\>rawdata = unserialize($row-\>rawdata); /\* Do any specific replacements here \*/ if($row) { /\* If it's FSFlightKeeper, process the `rawdata` column, which contains array()'d copied of extra data that was sent by the ACARS. Run that through some templates which we've got. This can probably be generic-ized but it's fine now for FSFK. This can probably move through an outside function, but seems OK to stay in getReportDetails() for now, since this is semi-intensive code here (the most expensive is populating the templates, and I wouldn't want to run it for EVERY PIREP which is called by the system. \*/ if($row-\>source == 'fsfk') { /\* Do data stuff in the logs \*/ $data = $row-\>rawdata; /\* Process flight data \*/ if(isset($data['FLIGHTDATA'])) { Template::Set('data', $data['FLIGHTDATA']); $flightdata = Template::Get('fsfk\_log\_flightdata.tpl', true, true, true); $row-\>log.=$flightdata; unset($flightdata); }