本文整理汇总了PHP中OperationsData类的典型用法代码示例。如果您正苦于以下问题:PHP OperationsData类的具体用法?PHP OperationsData怎么用?PHP OperationsData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OperationsData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jumpseat
public function jumpseat()
{
$icao = DB::escape($_GET['depicao']);
$this->set('airport', OperationsData::getAirportInfo($icao));
$this->set('cost', DB::escape($_GET['cost']));
$this->show('RSL/realschedulelite_jumpseatconfirm.tpl');
}
示例2: overview
public function overview()
{
$this->set('acstats', StatsData::AircraftUsage());
$this->set('toproutes', StatsData::TopRoutes());
$this->set('allairlines', OperationsData::GetAllAirlines());
$this->render('reports_main.php');
}
示例3: index
/**
* Pilots::index()
*
* @return
*/
public function index()
{
// Get all of our hubs, and list pilots by hub
$allhubs = OperationsData::GetAllHubs();
if (!$allhubs) {
$allhubs = array();
}
foreach ($allhubs as $hub) {
$this->set('title', $hub->name);
$this->set('icao', $hub->icao);
$pilot_list = PilotData::findPilots(array('p.hub' => $hub->icao));
$this->set('allpilots', $pilot_list);
# deprecated
$this->set('pilot_list', $pilot_list);
$this->render('pilots_list.tpl');
}
$nohub = PilotData::findPilots(array('p.hub' => ''));
if (!$nohub) {
return;
}
$this->set('title', 'No Hub');
$this->set('icao', '');
$this->set('allpilots', $nohub);
# deprecated
$this->set('pilot_list', $nohub);
$this->render('pilots_list.tpl');
}
示例4: ShowForm
protected function ShowForm()
{
$this->set('extrafields', RegistrationData::GetCustomFields());
$this->set('allairlines', OperationsData::GetAllAirlines(true));
$this->set('allhubs', OperationsData::GetAllHubs());
$this->set('countries', Countries::getAllCountries());
$this->render('registration_mainform.tpl');
}
示例5: jumpseat
public function jumpseat()
{
if (!Auth::LoggedIn()) {
$this->set('message', 'You must be logged in to access this feature!');
$this->render('core_error.tpl');
return;
} else {
$icao = DB::escape($this->post->depicao);
$this->set('airport', OperationsData::getAirportInfo($icao));
$this->set('cost', DB::escape($this->post->cost));
$this->show('Fltbook/jumpseatticket');
}
}
示例6: index
public function index()
{
if (isset($this->post->action)) {
if ($this->post->action == 'findflight') {
$this->findflight();
}
} else {
$this->set('airports', OperationsData::GetAllAirports());
$this->set('airlines', OperationsData::getAllAirlines());
$this->set('aircrafts', FrontSchedulesData::findaircrafttypes());
$this->set('countries', FrontSchedulesData::findcountries());
$this->show('RSL/airport_search.tpl');
}
}
示例7: testRetrieveAirport
public function testRetrieveAirport()
{
echo '<h3>Core API Tests</h3>';
echo "<strong>Checking geonames server</strong><br />";
Config::Set('AIRPORT_LOOKUP_SERVER', 'geonames');
OperationsData::RemoveAirport('PANC');
$return = OperationsData::RetrieveAirportInfo('PANC');
$this->assertNotEqual($return, false);
echo "<strong>Checking phpVMS API server</strong><br />";
Config::Set('AIRPORT_LOOKUP_SERVER', 'phpvms');
Config::Set('PHPVMS_API_SERVER', 'http://apidev.phpvms.net');
OperationsData::RemoveAirport('PANC');
$return = OperationsData::RetrieveAirportInfo('PANC');
$this->assertNotEqual($return, false);
}
示例8: ShowForm
protected function ShowForm()
{
$field_list = RegistrationData::GetCustomFields();
$this->set('extrafields', $field_list);
$this->set('field_list', $field_list);
$airline_list = OperationsData::getAllAirlines(true);
$this->set('allairlines', $airline_list);
$this->set('airline_list', $airline_list);
$hub_list = OperationsData::getAllHubs();
$this->set('allhubs', $hub_list);
$this->set('hub_list', $hub_list);
$country_list = Countries::getAllCountries();
$this->set('countries', $country_list);
$this->set('country_list', $country_list);
$this->render('registration_mainform.tpl');
}
示例9: testPaxCount
/**
* StatsTest::testPaxCount()
*
* @return void
*/
public function testPaxCount()
{
$total = DB::get_row('SELECT SUM(`load`) AS `total`
FROM phpvms_pireps WHERE `flighttype`=\'P\' AND `accepted`=' . PIREP_ACCEPTED);
$this->assertEquals($total->total, StatsData::TotalPaxCarried(), 'StatsData::TotalPaxCarried(NO CODE)');
$airlines = OperationsData::getAllAirlines(true);
foreach ($airlines as $airline) {
$pilotCount = StatsData::TotalPaxCarried($airline->code);
$total = DB::get_row('SELECT SUM(`load`) AS `total`
FROM phpvms_pireps
WHERE accepted =' . PIREP_ACCEPTED . '
AND flighttype = \'P\'
AND code = \'' . $airline->code . '\'');
$this->assertEquals($total->total, $pilotCount, 'StatsData::TotalPaxCarried(' . $airline->code . ')');
}
}
示例10: ShowForm
protected function ShowForm()
{
//Google reCaptcha
//updated to Google noCaptcha 1/15
$this->set('sitekey', RECAPTCHA_PUBLIC_KEY);
$this->set('lang', 'en');
$field_list = RegistrationData::GetCustomFields();
$this->set('extrafields', $field_list);
$this->set('field_list', $field_list);
$airline_list = OperationsData::getAllAirlines(true);
$this->set('allairlines', $airline_list);
$this->set('airline_list', $airline_list);
$hub_list = OperationsData::getAllHubs();
$this->set('allhubs', $hub_list);
$this->set('hub_list', $hub_list);
$country_list = Countries::getAllCountries();
$this->set('countries', $country_list);
$this->set('country_list', $country_list);
$this->render('registration_mainform.tpl');
}
示例11: index
public function index()
{
if ($this->get->maptype == 'hubmap') {
// Show hubmap
$params = array('s.depicao' => $this->get->hub, 's.enabled' => 1);
// Show only 20 routes
$allschedules = SchedulesData::findSchedules($params, Config::Get('ROUTE_MAP_SHOW_NUMBER'));
if (count($allschedules) == 0) {
echo 'There are no departures from this airport!';
return;
}
$airportinfo = OperationsData::GetAirportInfo($this->get->hub);
echo '<h3>Departures from ' . $airportinfo->name . '</h3>';
} else {
# Get all of the schedule
$allschedules = SchedulesData::findSchedules(array('s.enabled' => 1), Config::Get('ROUTE_MAP_SHOW_NUMBER'));
}
$this->set('allschedules', $allschedules);
$this->render('flown_routes_map.tpl');
}
示例12: getFuelPrice
/**
* Get the current fuel price for an airport, returns it in the
* unit specified in the config file
*
* @param string $apt_icao ICAO of the airport
* @return float Fuel price
*
* @version 709 rewritten
*/
public static function getFuelPrice($apt_icao)
{
$price = false;
$aptinfo = OperationsData::GetAirportInfo($apt_icao);
// Live pricing enabled, and the airport is set to '0' for a live price
if (Config::Get('FUEL_GET_LIVE_PRICE') == true && ($aptinfo->fuelprice == '0' || $aptinfo->fuelprice == '')) {
$price = self::get_cached_price($apt_icao);
if (!$price) {
$price = self::get_from_server($apt_icao);
if (!is_bool($price)) {
return $price;
// Returns the JetA price
}
} else {
return $price->jeta;
}
}
/* Live price stuff above failed or was "off" */
if ($aptinfo->fuelprice == '' || $aptinfo->fuelprice == 0) {
return Config::Get('FUEL_DEFAULT_PRICE');
} else {
return $aptinfo->fuelprice;
}
}
示例13: updateFlightData
/**
* This updates the ACARS live data for a pilot
*
* @param mixed $data This is the data structure with flight properties
* @return mixed Nothing
*
*/
public static function updateFlightData($pilotid, $data)
{
if (!is_array($data)) {
self::$lasterror = 'Data not array';
return false;
}
if (isset($data['code']) && isset($data['flightnum'])) {
$data['flightnum'] = $data['code'] . $data['flightnum'];
}
// Add pilot info
$pilotinfo = PilotData::getPilotData($pilotid);
$data['pilotid'] = $pilotid;
$data['pilotname'] = $pilotinfo->firstname . ' ' . $pilotinfo->lastname;
// Store for later
if (isset($data['registration'])) {
$ac_registration = $data['registration'];
unset($data['registration']);
}
if (isset($data['depicao'])) {
$dep_apt = OperationsData::GetAirportInfo($data['depicao']);
$data['depapt'] = DB::escape($dep_apt->name);
}
if (isset($data['arricao'])) {
$arr_apt = OperationsData::GetAirportInfo($data['arricao']);
$data['arrapt'] = DB::escape($arr_apt->name);
}
if (isset($data['route']) && empty($data['route'])) {
$flight_info = SchedulesData::getProperFlightNum($data['flightnum']);
$params = array('s.code' => $flight_info['code'], 's.flightnum' => $flight_info['flightnum']);
$schedule = SchedulesData::findSchedules($params);
$schedule = $schedule[0];
$data['route'] = $schedule->route;
//$data['route_details'] = serialize(SchedulesData::getRouteDetails($schedule->id));
} elseif (isset($data['route']) && !empty($data['route'])) {
/*$tmp = new stdClass();
$tmp->deplat = $dep_apt->lat;
$tmp->deplng = $dep_apt->lng;
$tmp->route = $data['route'];
$data['route_details'] = NavData::parseRoute($tmp);
$data['route_details'] = serialize($data['route_details']);
unset($tmp);*/
}
if (!empty($data['route_details'])) {
$data['route_details'] = DB::escape($data['route_details']);
}
if (isset($dep_apt)) {
unset($dep_apt);
}
if (isset($arr_apt)) {
unset($arr_apt);
}
// Clean up times
if (isset($data['deptime']) && !is_numeric($data['deptime'])) {
$data['deptime'] = strtotime($data['deptime']);
}
if (isset($data['arrtime']) && !is_numeric($data['arrtime'])) {
$data['arrtime'] = strtotime($data['arrtime']);
}
/* Check the heading for the flight
If none is specified, then point it straight to the arrival airport */
if ($data['heading'] == '' || !isset($data['heading']) && isset($data['lat']) && isset($data['lng'])) {
/* Calculate an angle based on current coords and the
destination coordinates */
$data['heading'] = intval(atan2($data['lat'] - $arr_apt->lat, $data['lng'] - $arr_apt->lng) * 180 / 3.14);
if ($data['lat'] - $data['lng'] < 0) {
$data['heading'] += 180;
}
if ($data['heading'] < 0) {
$data['heading'] += 360;
}
}
// Manually add the last set
$data['lastupdate'] = 'NOW()';
// first see if we exist:
$sql = 'SELECT `id`
FROM ' . TABLE_PREFIX . "acarsdata \n\t\t\t\tWHERE `pilotid`={$pilotid}";
$exist = DB::get_row($sql);
$flight_id = '';
if ($exist) {
// update
$upd = array();
$flight_id = $exist->id;
foreach ($data as $field => $value) {
$value = DB::escape(trim($value));
// Append the message log
if ($field === 'messagelog') {
$upd[] = "`messagelog`=CONCAT(`messagelog`, '{$value}')";
} elseif ($field === 'lastupdate') {
$upd[] = "`lastupdate`=NOW()";
} elseif ($field === 'deptime' || $field === 'arrtime') {
/* If undefined, set a default time to now (penalty for malformed data?)
Won't be quite accurate.... */
//.........这里部分代码省略.........
示例14: parsePilotID
/**
* Parse a pilot ID from a passed ID
*
* @param int $pilotid Pass the ID string
* @return int Returns the integer database ID
*
*/
public static function parsePilotID($pilotid)
{
if (!is_numeric($pilotid)) {
$airlines = OperationsData::getAllAirlines();
foreach ($airlines as $a) {
$a->code = strtoupper($a->code);
if (strpos($pilotid, $a->code) === false) {
continue;
}
$pilotid = intval(str_ireplace($a->code, '', $pilotid));
$pilotid = $pilotid - Config::Get('PILOTID_OFFSET');
}
}
return $pilotid;
}
示例15: editpirep
public function editpirep()
{
$this->set('pirep', PIREPData::GetReportDetails($this->get->pirepid));
$this->set('allairlines', OperationsData::GetAllAirlines());
$this->set('allairports', OperationsData::GetAllAirports());
$this->set('allaircraft', OperationsData::GetAllAircraft());
$this->set('fielddata', PIREPData::GetFieldData($this->get->pirepid));
$this->set('pirepfields', PIREPData::GetAllFields());
$this->set('comments', PIREPData::GetComments($this->get->pirepid));
$this->render('pirep_edit.tpl');
}