当前位置: 首页>>代码示例>>PHP>>正文


PHP OperationsData::AddAirline方法代码示例

本文整理汇总了PHP中OperationsData::AddAirline方法的典型用法代码示例。如果您正苦于以下问题:PHP OperationsData::AddAirline方法的具体用法?PHP OperationsData::AddAirline怎么用?PHP OperationsData::AddAirline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OperationsData的用法示例。


在下文中一共展示了OperationsData::AddAirline方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add_airline_post

 protected function add_airline_post()
 {
     $this->post->code = strtoupper($this->post->code);
     if ($this->post->code == '' || $this->post->name == '') {
         $this->set('message', 'You must fill out all of the fields');
         $this->render('core_error.tpl');
         return;
     }
     if (OperationsData::GetAirlineByCode($this->post->code)) {
         $this->set('message', 'An airline with this code already exists!');
         $this->render('core_error.tpl');
         return;
     }
     OperationsData::AddAirline($this->post->code, $this->post->name);
     if (DB::errno() != 0) {
         if (DB::errno() == 1062) {
             // Duplicate entry
             $this->set('message', 'This airline has already been added');
         } else {
             $this->set('message', 'There was an error adding the airline');
         }
         $this->render('core_error.tpl');
         return;
     }
     $this->set('message', 'Added the airline "' . $this->post->code . ' - ' . $this->post->name . '"');
     $this->render('core_success.tpl');
     LogData::addLog(Auth::$userinfo->pilotid, 'Added the airline "' . $this->post->code . ' - ' . $this->post->name . '"');
 }
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:28,代码来源:Operations.php

示例2: SiteSetup

 public static function SiteSetup()
 {
     /*$_POST['SITE_NAME'] == '' || $_POST['firstname'] == '' || $_POST['lastname'] == ''
     		|| $_POST['email'] == '' ||  $_POST['password'] == '' || $_POST['vaname'] == ''
     		|| $_POST['vacode'] == ''*/
     // first add the airline
     $_POST['vacode'] = strtoupper($_POST['vacode']);
     if (!OperationsData::AddAirline($_POST['vacode'], $_POST['vaname'])) {
         self::$error = DB::$error;
         return false;
     }
     // Add an initial airport/hub, because I love KJFK so much
     $data = array('icao' => 'KJFK', 'name' => 'Kennedy International', 'country' => 'USA', 'lat' => '40.6398', 'lng' => '-73.7787', 'hub' => false, 'fuelprice' => 0);
     $ret = OperationsData::AddAirport($data);
     // Add the user
     $data = array('firstname' => $_POST['firstname'], 'lastname' => $_POST['lastname'], 'email' => $_POST['email'], l, 'password' => $_POST['password'], 'code' => $_POST['vacode'], 'location' => 'US', 'hub' => 'KJFK', 'confirm' => true);
     if (!RegistrationData::AddUser($data)) {
         self::$error = DB::$error;
         return false;
     }
     // Add a rank
     RanksData::updateRank(1, 'New Hire', 0, fileurl('/lib/images/ranks/newhire.jpg'), 18.0);
     # Add to admin group
     $pilotdata = PilotData::GetPilotByEmail($_POST['email']);
     if (!PilotGroups::AddUsertoGroup($pilotdata->pilotid, 'Administrators')) {
         self::$error = DB::$error;
         return false;
     }
     # Add the final settings in
     SettingsData::SaveSetting('SITE_NAME', $_POST['SITE_NAME']);
     SettingsData::SaveSetting('ADMIN_EMAIL', $_POST['email']);
     SettingsData::SaveSetting('GOOGLE_KEY', $_POST['googlekey']);
     return true;
 }
开发者ID:deanstalker,项目名称:phpVMS,代码行数:34,代码来源:Installer.class.php


注:本文中的OperationsData::AddAirline方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。