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


PHP PilotData::changePilotID方法代码示例

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


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

示例1: changepilotid

 /**
  * Maintenance::changepilotid()
  * 
  * @return
  */
 public function changepilotid()
 {
     CodonModule::checkPermission(MAINTENANCE);
     CodonModule::checkPermission(EDIT_PILOTS);
     echo '<h3>Change Pilot ID</h3>';
     if (isset($this->post->submit)) {
         $error = false;
         if (!is_numeric($this->post->new_pilotid)) {
             $error = true;
             $this->set('message', 'The pilot ID isn\'t numeric!');
             $this->render('core_error.php');
             return;
         }
         if ($this->post->new_pilotid < 1) {
             $error = true;
             $this->set('message', 'You cannot have an ID less than 1');
             $this->render('core_error.php');
             return;
         }
         if (empty($this->post->new_pilotid)) {
             $error = true;
             $this->set('message', 'The pilot ID is blank!');
             $this->render('core_error.php');
             return;
         }
         if (empty($this->post->old_pilotid) || $this->post->old_pilotid == 0) {
             $error = true;
             $this->set('message', 'No pilot selected');
             $this->render('core_error.php');
             return;
         }
         $pilot = PilotData::getPilotData($this->post->new_pilotid);
         if (is_object($pilot)) {
             $error = true;
             $this->set('message', 'This ID is already used!');
             $this->render('core_error.php');
             return;
         }
         if ($error === false) {
             PilotData::changePilotID($this->post->old_pilotid, $this->post->new_pilotid);
             $this->set('message', "Pilot ID changed from {$this->post->old_pilotid} to {$this->post->new_pilotid}");
             $this->render('core_success.php');
         }
     }
     $this->set('allpilots', PilotData::findPilots(array()));
     $this->render('maintenance_changepilotid.php');
 }
开发者ID:phpmods,项目名称:phpvms_5.5.x,代码行数:52,代码来源:Maintenance.php

示例2: changepilotid

 public function changepilotid()
 {
     echo '<h3>Change Pilot ID</h3>';
     if (isset($this->post->submit)) {
         $error = false;
         if (!is_numeric($this->post->new_pilotid)) {
             $error = true;
             $this->set('message', 'The pilot ID isn\'t numeric!');
             $this->render('core_error.tpl');
             return;
         }
         if ($this->post->new_pilotid < 1) {
             $error = true;
             $this->set('message', 'You cannot have an ID less than 1');
             $this->render('core_error.tpl');
             return;
         }
         if (empty($this->post->new_pilotid)) {
             $error = true;
             $this->set('message', 'The pilot ID is blank!');
             $this->render('core_error.tpl');
             return;
         }
         if (empty($this->post->old_pilotid) || $this->post->old_pilotid == 0) {
             $error = true;
             $this->set('message', 'No pilot selected');
             $this->render('core_error.tpl');
             return;
         }
         $pilot = PilotData::getPilotData($this->post->new_pilotid);
         if (is_object($pilot)) {
             $error = true;
             $this->set('message', 'This ID is already used!');
             $this->render('core_error.tpl');
             return;
         }
         if ($error === false) {
             PilotData::changePilotID($this->post->old_pilotid, $this->post->new_pilotid);
             CodonEvent::Dispatch('pilotid_changed', 'Maintenance', array('old_pilotid' => $this->post->old_pilotid, 'new_pilotid' => $this->post->new_pilotid));
             $this->set('message', "Pilot ID changed from {$this->post->old_pilotid} to {$this->post->new_pilotid}");
             $this->render('core_success.tpl');
         }
     }
     $this->set('allpilots', PilotData::findPilots(array()));
     $this->render('maintenance_changepilotid.tpl');
 }
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:46,代码来源:Maintenance.php


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