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


PHP PilotData::setPilotRetired方法代码示例

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


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

示例1: FilePIREP

 /**
  * File a PIREP from an ACARS program
  *
  * @param mixed $pilotid The pilot ID of the pilot filing the PIREP
  * @param mixed $data This is the data structure with the PIREP info
  * @return bool true/false
  *
  */
 public static function FilePIREP($pilotid, $data)
 {
     if (!is_array($data)) {
         self::$lasterror = 'PIREP data must be array';
         return false;
     }
     # Call the pre-file event
     #
     if (CodonEvent::Dispatch('pirep_prefile', 'PIREPS', $_POST) == false) {
         return false;
     }
     # File the PIREP report
     #
     $ret = PIREPData::FileReport($data);
     # Set them as non-retired
     PilotData::setPilotRetired($pilotid, 0);
     if (!$ret) {
         return false;
     }
     self::$pirepid = DB::$insert_id;
     # Call the event
     #
     CodonEvent::Dispatch('pirep_filed', 'PIREPS', $_POST);
     # Close out a bid if it exists
     #
     $bidid = SchedulesData::GetBidWithRoute($pilotid, $data['code'], $data['flightnum']);
     if ($bidid) {
         SchedulesData::RemoveBid($bidid->bidid);
     }
     return true;
 }
开发者ID:deanstalker,项目名称:phpVMS,代码行数:39,代码来源:ACARSData.class.php

示例2: SubmitPIREP

 protected function SubmitPIREP()
 {
     $pilotid = Auth::$userinfo->pilotid;
     if ($pilotid == '' || Auth::LoggedIn() == false) {
         $this->set('message', 'You must be logged in to access this feature!!');
         //$this->render('core_error.tpl');
         return false;
     }
     if ($this->post->code == '' || $this->post->flightnum == '' || $this->post->depicao == '' || $this->post->arricao == '' || $this->post->aircraft == '' || $this->post->flighttime == '') {
         $this->set('message', 'You must fill out all of the required fields!');
         return false;
     }
     # Only allow for valid routes to be filed
     $sched_data = SchedulesData::GetScheduleByFlight($this->post->code, $this->post->flightnum);
     if (!$sched_data) {
         $this->set('message', 'The flight code and number you entered is not a valid route!');
         return false;
     }
     # See if they entered more than 59 in the minutes part of the flight time
     $this->post->flighttime = str_replace(':', '.', $this->post->flighttime);
     $parts = explode('.', $this->post->flighttime);
     if ($parts[1] > 59) {
         $this->set('message', 'You entered more than 60 minutes in the minutes');
         return false;
     }
     /* Check the schedule and see if it's been bidded on */
     if (Config::Get('DISABLE_SCHED_ON_BID') == true) {
         $biddata = SchedulesData::GetBid($sched_data->bidid);
         if ($biddata) {
             if ($biddata->pilotid != $pilotid) {
                 $this->set('message', 'You are not the bidding pilot');
                 //$this->render('core_error.tpl');
                 return false;
             }
         }
     }
     /* Removed this check since maybe it's a training flight or something, who knows
        if($this->post->depicao == $this->post->arricao)
        {
        $this->set('message', 'The departure airport is the same as the arrival airport!');
        $this->render('core_error.tpl');
        return false;
        }*/
     $this->post->flighttime = str_replace(':', '.', $this->post->flighttime);
     if (!is_numeric($this->post->flighttime)) {
         $this->set('message', 'The flight time has to be a number!');
         return false;
     }
     # form the fields to submit
     $this->pirepdata = array('pilotid' => $pilotid, 'code' => $this->post->code, 'flightnum' => $this->post->flightnum, 'depicao' => $this->post->depicao, 'arricao' => $this->post->arricao, 'aircraft' => $this->post->aircraft, 'flighttime' => $this->post->flighttime, 'route' => $this->post->route, 'submitdate' => 'NOW()', 'fuelused' => $this->post->fuelused, 'source' => 'manual', 'comment' => $this->post->comment);
     CodonEvent::Dispatch('pirep_prefile', 'PIREPS');
     if (CodonEvent::hasStop('pirepfile')) {
         return false;
     }
     if (!PIREPData::FileReport($this->pirepdata)) {
         $this->set('message', 'There was an error adding your PIREP : ' . PIREPData::$lasterror);
         return false;
     }
     $pirepid = DB::$insert_id;
     PIREPData::SaveFields($pirepid, $_POST);
     # Remove the bid
     $bidid = SchedulesData::GetBidWithRoute($pilotid, $this->post->code, $this->post->flightnum);
     if ($bidid) {
         SchedulesData::RemoveBid($bidid->bidid);
     }
     # Call the event
     CodonEvent::Dispatch('pirep_filed', 'PIREPS');
     # Set them as non-retired
     PilotData::setPilotRetired($pilotid, 0);
     # Delete the bid, if the value for it is set
     if ($this->post->bid != '') {
         SchedulesData::RemoveBid($this->post->bid);
     }
     return true;
 }
开发者ID:rallin,项目名称:phpVMS,代码行数:75,代码来源:PIREPS.php


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