本文整理汇总了PHP中OperationsData::GetAircraftInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP OperationsData::GetAircraftInfo方法的具体用法?PHP OperationsData::GetAircraftInfo怎么用?PHP OperationsData::GetAircraftInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OperationsData
的用法示例。
在下文中一共展示了OperationsData::GetAircraftInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editaircraft
public function editaircraft()
{
$id = $this->get->id;
$this->set('aircraft', OperationsData::GetAircraftInfo($id));
$this->set('title', 'Edit Aircraft');
$this->set('action', 'editaircraft');
$this->set('allranks', RanksData::getAllRanks());
$this->render('ops_aircraftform.tpl');
}
示例2: getLoadCount
/**
* Get the active load count based on the load factor
* based on the flight type: P(assenger), C(argo), H(Charter)
*/
public static function getLoadCount($aircraft_id, $flighttype = 'P')
{
$flighttype = strtoupper($flighttype);
# Calculate our load factor for this flight
# Charter flights always will have a 100% capacity
if ($flighttype == 'H') {
$load = 100;
} else {
# Not a charter
$loadfactor = intval(Config::Get('LOAD_FACTOR'));
$load = rand($loadfactor - LOAD_VARIATION, $loadfactor + LOAD_VARIATION);
# Don't allow a load of more than 95%
if ($load > 95) {
$load = 95;
} elseif ($load <= 0) {
$load = 92;
}
# Use ATA standard of 72%
}
/*
* Get the maximum allowed based on the aircraft flown
*/
$aircraft = OperationsData::GetAircraftInfo($aircraft_id);
if (!$aircraft) {
if ($flighttype == 'C') {
# Check cargo if cargo flight
$count = Config::Get('DEFAULT_MAX_CARGO_LOAD');
} else {
$count = Config::Get('DEFAULT_MAX_PAX_LOAD');
}
} else {
if ($flighttype == 'C') {
# Check cargo if cargo flight
$count = $aircraft->maxcargo;
} else {
$count = $aircraft->maxpax;
}
}
$load = $load / 100;
$currload = ceil($count * $load);
return $currload;
}
示例3: editaircraft
/**
* Operations::editaircraft()
*
* @return
*/
public function editaircraft()
{
$this->checkPermission(EDIT_FLEET);
$id = $this->get->id;
$this->set('aircraft', OperationsData::GetAircraftInfo($id));
$this->set('title', 'Edit Aircraft');
$this->set('action', 'editaircraft');
$this->set('allranks', RanksData::getAllRanks());
$this->render('ops_aircraftform.php');
}