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


PHP PilotData::resetPilotPay方法代碼示例

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


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

示例1: reject_pirep_post

 /**
  * Reject the report, and then send them the comment
  * that was entered into the report
  */
 protected function reject_pirep_post()
 {
     $pirepid = $this->post->pirepid;
     $comment = $this->post->comment;
     if ($pirepid == '' || $comment == '') {
         return;
     }
     PIREPData::ChangePIREPStatus($pirepid, PIREP_REJECTED);
     // 2 is rejected
     $pirep_details = PIREPData::GetReportDetails($pirepid);
     // If it was previously accepted, subtract the flight data
     if (intval($pirep_details->accepted) == PIREP_ACCEPTED) {
         PilotData::UpdateFlightData($pirep_details->pilotid, -1 * floatval($pirep->flighttime), -1);
     }
     //PilotData::UpdatePilotStats($pirep_details->pilotid);
     RanksData::CalculateUpdatePilotRank($pirep_details->pilotid);
     PilotData::resetPilotPay($pirep_details->pilotid);
     StatsData::UpdateTotalHours();
     // Send comment for rejection
     if ($comment != '') {
         $commenter = Auth::$userinfo->pilotid;
         // The person logged in commented
         PIREPData::AddComment($pirepid, $commenter, $comment);
         // Send them an email
         $this->set('firstname', $pirep_details->firstname);
         $this->set('lastname', $pirep_details->lastname);
         $this->set('pirepid', $pirepid);
         $message = Template::GetTemplate('email_commentadded.tpl', true);
         Util::SendEmail($pirep_details->email, 'Comment Added', $message);
     }
     LogData::addLog(Auth::$userinfo->pilotid, 'Rejected PIREP #' . $pirepid);
     # Call the event
     CodonEvent::Dispatch('pirep_rejected', 'PIREPAdmin', $pirep_details);
 }
開發者ID:ryanunderwood,項目名稱:phpVMS,代碼行數:38,代碼來源:PIREPAdmin.php

示例2: calculatePIREPPayment

 /**
  * Add a payment for a PIREP.
  * 
  * @param int $pirepid PIREP ID
  * @return
  */
 public static function calculatePIREPPayment($pirepid)
 {
     $pirep = DB::get_row('SELECT `pirepid`, `pilotid`, 
                 `flighttime_stamp`, `pilotpay`, 
             `paytype`, `flighttype`, `accepted`
         FROM `' . TABLE_PREFIX . 'pireps`
         WHERE `pirepid`=' . $pirepid);
     if ($pirep->accepted == PIREP_REJECTED) {
         return false;
     }
     if ($pirep->paytype == PILOT_PAY_HOURLY) {
         # Price out per-hour?
         $peices = explode(':', $pirep->flighttime_stamp);
         $minutes = $peices[0] * 60 + $peices[1];
         $amount = $minutes * ($pirep->pilotpay / 60);
     } elseif ($pirep->paytype == PILOT_PAY_SCHEDULE) {
         $amount = $pirep->pilotpay;
     }
     $params = array('pirepid' => $pirepid, 'pilotid' => $pirep->pilotid, 'paysource' => PAYSOURCE_PIREP, 'paytype' => $pirep->paytype, 'amount' => $amount);
     $entry = LedgerData::getPaymentByPIREP($pirepid);
     if (!$entry) {
         LedgerData::addPayment($params);
     } else {
         LedgerData::editPayment($entry->id, $params);
     }
     PilotData::resetPilotPay($pirep->pilotid);
     return $amount;
 }
開發者ID:Galihom,項目名稱:phpVMS,代碼行數:34,代碼來源:PIREPData.class.php

示例3: resetpilotpay

 public function resetpilotpay()
 {
     echo '<h3>Resetting Pilot Pay</h3>';
     $allpilots = PilotData::GetAllPilots();
     foreach ($allpilots as $p) {
         $total = PilotData::resetPilotPay($p->pilotid);
         echo "{$p->firstname} {$p->lastname} - total \$ {$total}<br />";
     }
     echo 'Done';
     LogData::addLog(Auth::$userinfo->pilotid, 'Reset pilot pay');
 }
開發者ID:ryanunderwood,項目名稱:phpVMS,代碼行數:11,代碼來源:Maintenance.php

示例4: deletePaymentByPIREP

 /**
  * LedgerData::deletePayment()
  * 
  * @param mixed $pirep_id
  * @return void
  */
 public static function deletePaymentByPIREP($pirepid)
 {
     $payment = self::getPaymentByPIREP($pirepid);
     $ret = DB::query('DELETE FROM `' . TABLE_PREFIX . 'ledger`
          WHERE `pirepid`=' . $pirepid);
     PilotData::resetPilotPay($payment->pilotid);
     return $ret;
 }
開發者ID:phpmods,項目名稱:phpvms_5.5.x,代碼行數:14,代碼來源:LedgerData.class.php


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