當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PilotData::changePilotRank方法代碼示例

本文整理匯總了PHP中PilotData::changePilotRank方法的典型用法代碼示例。如果您正苦於以下問題:PHP PilotData::changePilotRank方法的具體用法?PHP PilotData::changePilotRank怎麽用?PHP PilotData::changePilotRank使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PilotData的用法示例。


在下文中一共展示了PilotData::changePilotRank方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: savepro

 public function savepro()
 {
     if ($this->post->firstname == '' || $this->post->lastname == '') {
         $this->set('message', 'The first or lastname cannot be blank!');
         $this->render('core_error.tpl');
         return;
     }
     $params = array('firstname' => $this->post->firstname, 'lastname' => $this->post->lastname, 'email' => $this->post->email, 'hub' => $this->post->hub, 'retired' => $this->post->retired, 'totalflights' => $this->post->totalflights, 'totalpay' => floatval($this->post->totalpay), 'transferhours' => $this->post->transferhours);
     PilotData::updateProfile($this->post->pilotid, $params);
     PilotData::SaveFields($this->post->pilotid, $_POST);
     /* Don't calculate a pilot's rank if this is set */
     if (Config::Get('RANKS_AUTOCALCULATE') == false) {
         PilotData::changePilotRank($this->post->pilotid, $this->post->rank);
     } else {
         RanksData::calculateUpdatePilotRank($this->post->pilotid);
     }
     StatsData::UpdateTotalHours();
     $this->set('message', 'Profile updated successfully');
     $this->render('core_success.tpl');
     $this->set('pilots', PilotData::getAllPilots());
     $this->render('/pm/pilot_manager.php');
     if ($this->post->resend_email == 'true') {
         $this->post->id = $this->post->pilotid;
         $this->resendemail(false);
     }
     $pilot = PilotData::getPilotData($this->post->pilotid);
     LogData::addLog(Auth::$userinfo->pilotid, 'Updated profile for ' . PilotData::getPilotCode($pilot->code, $pilot->pilotid) . ' ' . $pilot->firstname . ' ' . $pilot->lastname);
     return;
     break;
 }
開發者ID:parkho,項目名稱:Pilot-Manager-V2.2,代碼行數:30,代碼來源:Pilotmanager.php

示例2: viewpilots

 public function viewpilots()
 {
     /* This function is called for *ANYTHING* in that popup box
        
        Preset all of the template items in this function and
        call them in the subsequent templates
        
        Confusing at first, but easier than loading each tab
        independently via AJAX. Though may be an option later
        on, but can certainly be done by a plugin (Add another
        tab through AJAX). The hook is available for whoever
        wants to use it
        */
     switch ($this->post->action) {
         case 'changepassword':
             $this->ChangePassword();
             return;
             break;
         case 'deletepilot':
             $pilotid = $this->post->pilotid;
             $pilotinfo = PilotData::getPilotData($pilotid);
             PilotData::DeletePilot($pilotid);
             CodonEvent::Dispatch('pilot_deleted', 'PilotAdmin', $pilot);
             $this->set('message', Lang::gs('pilot.deleted'));
             $this->render('core_success.tpl');
             LogData::addLog(Auth::$userinfo->pilotid, 'Deleted pilot ' . PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid) . ' ' . $pilotinfo->firstname . ' ' . $pilotinfo->lastname);
             break;
             /* These are reloaded into the #pilotgroups ID
                so the entire groups list is refreshed
                */
         /* These are reloaded into the #pilotgroups ID
            so the entire groups list is refreshed
            */
         case 'addgroup':
             $this->AddPilotToGroup();
             $this->SetGroupsData($this->post->pilotid);
             $this->render('pilots_groups.tpl');
             return;
             break;
         case 'removegroup':
             $this->RemovePilotGroup();
             $this->SetGroupsData($this->post->pilotid);
             $this->render('pilots_groups.tpl');
             return;
             break;
         case 'saveprofile':
             if ($this->post->firstname == '' || $this->post->lastname == '') {
                 $this->set('message', 'The first or lastname cannot be blank!');
                 $this->render('core_error.tpl');
                 return;
             }
             if (intval($this->post->retired) == 1) {
                 $retired = true;
             } else {
                 $retired = false;
             }
             $params = array('code' => $this->post->code, 'firstname' => $this->post->firstname, 'lastname' => $this->post->lastname, 'email' => $this->post->email, 'location' => $this->post->location, 'hub' => $this->post->hub, 'retired' => $retired, 'totalhours' => $this->post->totalhours, 'totalflights' => $this->post->totalflights, 'totalpay' => floatval($this->post->totalpay), 'payadjust' => floatval($this->post->payadjust), 'transferhours' => $this->post->transferhours, 'comment' => $this->post->comment);
             PilotData::updateProfile($this->post->pilotid, $params);
             PilotData::SaveFields($this->post->pilotid, $_POST);
             /* Don't calculate a pilot's rank if this is set */
             if (Config::Get('RANKS_AUTOCALCULATE') == false) {
                 PilotData::changePilotRank($this->post->pilotid, $this->post->rank);
             } else {
                 RanksData::calculateUpdatePilotRank($this->post->pilotid);
             }
             StatsData::UpdateTotalHours();
             $this->set('message', 'Profile updated successfully');
             $this->render('core_success.tpl');
             $pilot = PilotData::getPilotData($this->post->pilotid);
             LogData::addLog(Auth::$userinfo->pilotid, 'Updated profile for ' . PilotData::getPilotCode($pilot->code, $pilot->pilotid) . ' ' . $pilot->firstname . ' ' . $pilot->lastname);
             return;
             break;
     }
     if ($this->get->action == 'viewoptions') {
         $this->ViewPilotDetails();
         return;
     }
     $this->ShowPilotsList();
 }
開發者ID:rallin,項目名稱:phpVMS,代碼行數:79,代碼來源:PilotAdmin.php


注:本文中的PilotData::changePilotRank方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。