當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。