Esempio n. 1
0
 public static function send_all_acars()
 {
     if (!self::central_enabled()) {
         return false;
     }
     $acars_flights = ACARSData::GetAllFlights();
     if (!$acars_flights) {
         return false;
     }
     self::set_xml('update_acars');
     foreach ($acars_flights as $flight) {
         self::create_acars_flight($flight);
     }
     CronData::set_lastupdate('update_acars');
     return self::send_xml();
 }
Esempio n. 2
0
        $resp = CentralData::send_schedules();
        break;
    case 'sendpilots':
        $resp = CentralData::send_pilots();
        break;
    case 'sendallpireps':
        $resp = CentralData::send_all_pireps();
        break;
    case 'sendpirep':
        $pirep = PIREPData::findPIREPS(array(), 20);
        $num = rand(0, count($pirep) - 1);
        $resp = CentralData::send_pirep($pirep[$num]->pirepid);
        break;
    case 'sendacars':
        # Send a random flight
        $flights = ACARSData::GetAllFlights();
        $total = count($flights);
        $resp = CentralData::send_acars_data($flights[rand(0, $total - 1)]);
        break;
    case 'sendallacars':
        $resp = CentralData::send_all_acars();
        break;
}
?>
<h3>Response:</h3>
<pre><?php 
$response = CentralData::$xml_response;
echo htmlentities(formatXmlString($response));
?>
</pre>