本文整理汇总了PHP中Statistics::getPositiveAccounts方法的典型用法代码示例。如果您正苦于以下问题:PHP Statistics::getPositiveAccounts方法的具体用法?PHP Statistics::getPositiveAccounts怎么用?PHP Statistics::getPositiveAccounts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statistics
的用法示例。
在下文中一共展示了Statistics::getPositiveAccounts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _exportBalanceAccountStatus
/**
*
* @param unknown_type $from
* @param unknown_type $to
*/
private function _exportBalanceAccountStatus($from, $to)
{
$begin_row = $this->_row;
$active_sheet = $this->getDocument()->getActiveSheet();
/* ------------------- EXPORTATION OF THE ACCOUNTS STATUS --------------------------*/
$positive_accounts = Statistics::getPositiveAccounts();
$negative_accounts = Statistics::getNegativeAccounts();
$total_accounts['value'] = $positive_accounts['value'] + $negative_accounts['value'];
$total_accounts['number'] = $positive_accounts['number'] + $negative_accounts['number'];
/*------------------------------ TITLE -----------------------------*/
$active_sheet->setCellValueByColumnAndRow(0, $this->_row, $this->_translate('Accounts status'));
$active_sheet->mergeCells('A' . $this->_row . ':C' . $this->_row);
$active_sheet->getStyle('A' . $this->_row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$active_sheet->getStyle('A' . $this->_row)->getFont()->setBold(true);
$active_sheet->getStyle('A' . $this->_row)->getFill()->applyFromArray(array('type' => PHPExcel_Style_Fill::FILL_SOLID, 'startcolor' => array('rgb' => '808080'), 'endcolor' => array('rgb' => '808080')));
/*----------------------------- END TITLE ---------------------------*/
$this->nextLine();
/*------------------------------ HEADER -----------------------------*/
$active_sheet->setCellValueByColumnAndRow(0, $this->_row, $this->_translate('Monetary accounts'));
$active_sheet->setCellValueByColumnAndRow(1, $this->_row, $this->_translate('Value'));
$active_sheet->setCellValueByColumnAndRow(2, $this->_row, $this->_translate('Number of accounts'));
$active_sheet->getStyle('A' . $this->_row . ':C' . $this->_row)->getFont()->setBold(true);
$active_sheet->getStyle('B' . $this->_row . ':C' . $this->_row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
/*----------------------------- END HEADER ---------------------------*/
$this->nextLine();
/*------------------------------ BODY -----------------------------*/
$active_sheet->setCellValueByColumnAndRow(0, $this->_row, $this->_translate('Positives'));
$active_sheet->setCellValueByColumnAndRow(1, $this->_row, $positive_accounts['value']);
$active_sheet->setCellValueByColumnAndRow(2, $this->_row, $positive_accounts['number']);
$active_sheet->getStyle('B' . $this->_row . ':C' . $this->_row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$this->nextLine();
$active_sheet->setCellValueByColumnAndRow(0, $this->_row, $this->_translate('Negatives'));
$active_sheet->setCellValueByColumnAndRow(1, $this->_row, $negative_accounts['value']);
$active_sheet->setCellValueByColumnAndRow(2, $this->_row, $negative_accounts['number']);
$active_sheet->getStyle('B' . $this->_row . ':C' . $this->_row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
/*----------------------------- END BODY ---------------------------*/
$this->nextLine();
/*------------------------------ FOOTER -----------------------------*/
$active_sheet->setCellValueByColumnAndRow(0, $this->_row, $this->_translate('Total'));
$active_sheet->setCellValueByColumnAndRow(1, $this->_row, $total_accounts['value']);
$active_sheet->setCellValueByColumnAndRow(2, $this->_row, $total_accounts['number']);
$active_sheet->getStyle('A' . $this->_row . ':C' . $this->_row)->getFont()->setBold(true);
$active_sheet->getStyle('B' . $this->_row . ':C' . $this->_row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$active_sheet->getStyle('A' . $this->_row . ':C' . $this->_row)->getFill()->applyFromArray(array('type' => PHPExcel_Style_Fill::FILL_SOLID, 'startcolor' => array('rgb' => 'C0C0C0'), 'endcolor' => array('rgb' => 'C0C0C0')));
/*----------------------------- END FOOTER ---------------------------*/
$active_sheet->getStyle('A' . ($begin_row + 1) . ':C' . $this->_row)->applyFromArray(array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('argb' => PHPExcel_Style_Color::COLOR_BLACK)))));
}
示例2: executeBalance
/**
*
* @param sfWebRequest $request
*/
public function executeBalance(sfWebRequest $request, $xhr = true)
{
$this->userCulture = $this->getUser()->getCulture();
$from = $request->getParameter('from');
$to = $request->getParameter('to');
$this->from = $from;
$this->to = $to;
$this->xhr = $xhr;
$this->currency_symbol = ImputationDefaultValues::getDefaultCurrencySymbol();
$this->positive_accounts = Statistics::getPositiveAccounts();
$this->negative_accounts = Statistics::getNegativeAccounts();
$total_accounts['value'] = $this->positive_accounts['value'] + $this->negative_accounts['value'];
$total_accounts['number'] = $this->positive_accounts['number'] + $this->negative_accounts['number'];
$this->total_accounts = $total_accounts;
$this->methods_of_payments_values = Statistics::getTotalValuesByMethodOfPayment($from, $to);
$this->acts_values = Statistics::getValuesByAct($from, $to);
}