當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。