예제 #1
0
     #
     # We have more coming to the log
     #
     $report = PIREPData::GetLastReports($pilotid, 1);
     /* Check for any other data which might be in the other
     			chunks sent by fsacars, because it's stupid and doesn't
     			just do POST */
     $log = explode('*', $_GET['log']);
     /* Find the landing rate */
     $pos = find_in_fsacars_log('TouchDown:Rate', $log);
     $landingrate = str_replace('TouchDown:Rate', '', $log[$pos]);
     $count = preg_match('/([0-9]*:[0-9]*).*([-+]\\d*).*/i', $landingrate, $matches);
     if ($count > 0) {
         PIREPData::editPIREPFields($report->pirepid, array('landingrate' => $matches[2]));
     }
     PIREPData::AppendToLog($report->pirepid, $_GET['log']);
     echo 'OK';
     return;
 }
 # Full PIREP, run with it
 preg_match('/^([A-Za-z]*)(\\d*)/', $_GET['pilot'], $matches);
 $code = $matches[1];
 $log = explode('*', $_GET['log']);
 # Find where flight IATA is
 # And extract the code and flight number
 $pos = find_in_fsacars_log('Flight IATA', $log);
 $flightnum = str_replace('Flight IATA:', '', $log[$pos]);
 //preg_match('/^([A-Za-z]*)(\d*)/', $flightnum, $matches);
 $flightinfo = SchedulesData::getProperFlightNum($flightnum);
 $code = $flightinfo['code'];
 $flightnum = $flightinfo['flightnum'];