本文整理汇总了PHP中OperationsData::EditAirline方法的典型用法代码示例。如果您正苦于以下问题:PHP OperationsData::EditAirline方法的具体用法?PHP OperationsData::EditAirline怎么用?PHP OperationsData::EditAirline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OperationsData
的用法示例。
在下文中一共展示了OperationsData::EditAirline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit_airline_post
protected function edit_airline_post()
{
$this->post->code = strtoupper($this->post->code);
if ($this->post->code == '' || $this->post->name == '') {
$this->set('message', 'Code and name cannot be blank');
$this->render('core_error.tpl');
}
$prevairline = OperationsData::GetAirlineByCode($this->post->code);
if ($prevairline && $prevairline->id != $this->post->id) {
$this->set('message', 'This airline with this code already exists!');
$this->render('core_error.tpl');
return;
}
if (isset($this->post->enabled)) {
$enabled = true;
} else {
$enabled = false;
}
OperationsData::EditAirline($this->post->id, $this->post->code, $this->post->name, $enabled);
if (DB::errno() != 0) {
$this->set('message', 'There was an error editing the airline');
$this->render('core_error.tpl');
return false;
}
$this->set('message', 'Edited the airline "' . $this->post->code . ' - ' . $this->post->name . '"');
$this->render('core_success.tpl');
LogData::addLog(Auth::$userinfo->pilotid, 'Edited the airline "' . $this->post->code . ' - ' . $this->post->name . '"');
}