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


PHP CRM_Contribute_BAO_Contribution::getTotalAmountAndCount方法代码示例

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


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

示例1: preProcess

 /** 
  * Heart of the viewing process. The runner gets all the meta data for 
  * the contact and calls the appropriate type of page to view. 
  * 
  * @return void 
  * @access public 
  * 
  */
 function preProcess()
 {
     CRM_Utils_System::setTitle(ts('CiviContribute'));
     $startToDate = array();
     $yearToDate = array();
     $monthToDate = array();
     $status = array('Valid', 'Cancelled');
     $startDate = null;
     $config =& CRM_Core_Config::singleton();
     $currentMonth = date('m');
     $currentDay = date('d');
     if ((int) $config->fiscalYearStart['M'] > $currentMonth || (int) $config->fiscalYearStart['M'] == $currentMonth && (int) $config->fiscalYearStart['d'] > $currentDay) {
         $year = date('Y') - 1;
     } else {
         $year = date('Y');
     }
     $year = array('Y' => $year);
     $yearDate = $config->fiscalYearStart;
     $yearDate = array_merge($year, $yearDate);
     $yearDate = CRM_Utils_Date::format($yearDate);
     $monthDate = date('Ym') . '01000000';
     $prefixes = array('start', 'month', 'year');
     $status = array('Valid', 'Cancelled');
     $yearNow = $yearDate + 10000;
     $yearNow .= '000000';
     $yearDate = $yearDate . '000000';
     // we are specific since we want all information till this second
     $now = date('YmdHis');
     require_once 'CRM/Contribute/BAO/Contribution.php';
     foreach ($prefixes as $prefix) {
         $aName = $prefix . 'ToDate';
         $dName = $prefix . 'Date';
         if ($prefix == 'year') {
             $now = $yearNow;
         }
         foreach ($status as $s) {
             ${$aName}[$s] = CRM_Contribute_BAO_Contribution::getTotalAmountAndCount($s, ${$dName}, $now);
             ${$aName}[$s]['url'] = CRM_Utils_System::url('civicrm/contribute/search', "reset=1&force=1&status=1&start={${$dName}}&end={$now}&test=0");
         }
         $this->assign($aName, ${$aName});
     }
     // Check for admin permission to see if we should include the Manage Contribution Pages action link
     $isAdmin = 0;
     require_once 'CRM/Core/Permission.php';
     if (CRM_Core_Permission::check('administer CiviCRM')) {
         $isAdmin = 1;
     }
     $this->assign('isAdmin', $isAdmin);
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:57,代码来源:DashBoard.php

示例2: preProcess

 /**
  * Heart of the viewing process. The runner gets all the meta data for
  * the contact and calls the appropriate type of page to view.
  *
  * @return void
  * @access public
  *
  */
 function preProcess()
 {
     CRM_Utils_System::setTitle(ts('CiviContribute'));
     $status = array('Valid', 'Cancelled');
     $prefixes = array('start', 'month', 'year');
     $startDate = NULL;
     $startToDate = $monthToDate = $yearToDate = array();
     //get contribution dates.
     $dates = CRM_Contribute_BAO_Contribution::getContributionDates();
     foreach (array('now', 'yearDate', 'monthDate') as $date) {
         ${$date} = $dates[$date];
     }
     // fiscal years end date
     $yearNow = date('Ymd', strtotime('+1 year -1 day', strtotime($yearDate)));
     foreach ($prefixes as $prefix) {
         $aName = $prefix . 'ToDate';
         $dName = $prefix . 'Date';
         if ($prefix == 'year') {
             $now = $yearNow;
         }
         // appending end date i.e $now with time
         // to also calculate records of end date till mid-night
         $nowWithTime = $now . '235959';
         foreach ($status as $s) {
             ${$aName}[$s] = CRM_Contribute_BAO_Contribution::getTotalAmountAndCount($s, ${$dName}, $nowWithTime);
             ${$aName}[$s]['url'] = CRM_Utils_System::url('civicrm/contribute/search', "reset=1&force=1&status=1&start={${$dName}}&end={$now}&test=0");
         }
         $this->assign($aName, ${$aName});
     }
     //for contribution tabular View
     $buildTabularView = CRM_Utils_Array::value('showtable', $_GET, FALSE);
     $this->assign('buildTabularView', $buildTabularView);
     if ($buildTabularView) {
         return;
     }
     // Check for admin permission to see if we should include the Manage Contribution Pages action link
     $isAdmin = 0;
     if (CRM_Core_Permission::check('administer CiviCRM')) {
         $isAdmin = 1;
     }
     $this->assign('isAdmin', $isAdmin);
 }
开发者ID:hguru,项目名称:224Civi,代码行数:50,代码来源:DashBoard.php

示例3: preProcess

 /** 
  * Heart of the viewing process. The runner gets all the meta data for 
  * the contact and calls the appropriate type of page to view. 
  * 
  * @return void 
  * @access public 
  * 
  */
 function preProcess()
 {
     $startToDate = array();
     $yearToDate = array();
     $monthToDate = array();
     $status = array('Valid', 'Cancelled');
     $startDate = null;
     $yearDate = date('Y') . '0101000000';
     $monthDate = date('Ym') . '01000000';
     // we are specific since we want all information till this second
     $now = date('YmdHis');
     $prefixes = array('start', 'year', 'month');
     $status = array('Valid', 'Cancelled');
     foreach ($prefixes as $prefix) {
         $aName = $prefix . 'ToDate';
         $dName = $prefix . 'Date';
         foreach ($status as $s) {
             ${$aName}[$s] = CRM_Contribute_BAO_Contribution::getTotalAmountAndCount($s, ${$dName}, $now);
             ${$aName}[$s]['url'] = CRM_Utils_System::url('civicrm/contribute/search', "reset=1&force=1&status={$s}&start={${$dName}}&end={$now}");
         }
         $this->assign($aName, ${$aName});
     }
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:31,代码来源:DashBoard.php


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