Esempio n. 1
0
 public function sendpireps()
 {
     echo '<h3>Sending all PIREPS</h3>';
     $within_timelimit = CronData::check_hoursdiff('update_pireps', CentralData::$limits['update_pireps']);
     if ($within_timelimit == true) {
         echo '<p>You can only export PIREPs every ' . CentralData::$limits['update_pireps'] . ' hours</p>';
         return false;
     }
     $ret = CentralData::send_all_pireps();
     $this->parse_response($ret);
     LogData::addLog(Auth::$userinfo->pilotid, 'vaCentral - PIREPS sent');
 }
Esempio n. 2
0
    Config::Set('VACENTRAL_API_SERVER', 'http://apidev.phpvms.net');
    echo '<p style="color: red">Debug mode enabled!</p>';
}
CentralData::$debug = true;
switch ($_GET['a']) {
    case 'sendstats':
        $resp = CentralData::send_vastats();
        break;
    case 'sendschedules':
        $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;