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


PHP Period::getPrevPeriod方法代码示例

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


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

示例1: getCurrentPeriod

 /**
  * Returns current period instance
  *
  * @return <Doctrine_Object> instance of Period
  */
 public static function getCurrentPeriod()
 {
     $date = Period::getCurPeriodDate();
     $oPeriod = PeriodTable::getInstance()->findOneByDate($date);
     if (!$oPeriod instanceof Period) {
         // выставить новые тарифы на новый период
         UserTable::setNewTariffs();
         $oPeriod = new Period();
         // вычислить стоимость 1к знаков
         if (($prev = Period::getPrevPeriod()) === false) {
             $price1k = SettingTable::getOptionByName('price1k')->getValue();
         } else {
             // рассчитать веса пользователей
             UserTable::countWeights($prev);
             if (($price1k = VoteTable::getVoted1k($prev)) === false) {
                 $price1k = $prev->get1k();
             }
         }
         $oPeriod->set1k(number_format((double) $price1k, 2));
         // выставить процент
         $oPeriod->setR2rShare(number_format(Setting::getValueByName('percent_r2r'), 2, '.', ''));
         // --
         $oPeriod->setDate($date);
         $oPeriod->save();
         //throw new sfException('Cannot get current period. Error in DB data');
     }
     return $oPeriod;
 }
开发者ID:rollmax,项目名称:read2read,代码行数:33,代码来源:Period.class.php

示例2: slot

<?php

slot('currentPage', 'profile_p_invoice');
slot('title_page', 'Personal room - Личный кабинет');
include_partial('profilep/profMenu');
?>
<table id=count_data cellpadding="0" cellspacing="0">
    <tr class=yg>
        <td class=left>
            <p>Расчетный период</p>
        </td>
        <td class=center>
            <p><?php 
echo Period::periodMonthString(Period::getPrevPeriod());
?>
</p>
        </td>
        <td class=right>
            <p>&nbsp;</p>
        </td>
    </tr>
    <tr class=g>
        <td class=left>
            <p>К выплате</p>
        </td>
        <td class=center>
            <p class=pay_out>
                <?php 
if (!is_null($earnedPrev)) {
    ?>
                    <?php 
开发者ID:rollmax,项目名称:read2read,代码行数:31,代码来源:invoiceSuccess.php

示例3: executeInvoice

 /**
  * Executes invoice action
  *
  * @param sfWebRequest $request
  */
 public function executeInvoice(sfWebRequest $request)
 {
     $this->period = Period::getCurrentPeriod();
     $this->user = $this->getUser()->getGuardUser();
     $this->form = null;
     $this->form_type = '';
     $this->earned = $this->user->getUserBalanceByPeriodId(Period::getCurrentPeriod()->getId())->getPayable();
     $this->earnedPrev = $this->user->getUserBalanceByPeriodId(Period::getPrevPeriod()->getId());
     if ($request->getMethod() == 'POST') {
         $this->form = new UserPasswordImgForm($this->user);
         if ($this->processPswChangeForm($request, $this->form)) {
             // Input purchase ID
             $this->form_type = 'account_number';
             $this->form = new AccountNumberForm($this->user);
             $this->fieldName = 'account_number';
             $this->titleName = 'Номер кошелька';
             $this->cssId = 'account_number';
         } else {
             $this->error_img = true;
             $this->form_type = 'secure_img';
             $this->fieldName = 'account_number';
             $this->titleName = 'Изменение номера кошелька';
             $this->cssId = 'account_number';
         }
     }
 }
开发者ID:rollmax,项目名称:read2read,代码行数:31,代码来源:actions.class.php


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