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


PHP Statistics::getTemporalStatementValuesByAct方法代码示例

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


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

示例1: _exportTemporalStatement

 /**
  * 
  * @param $from
  * @param $to
  */
 protected function _exportTemporalStatement($from, $to)
 {
     $active_sheet = $this->getDocument()->getActiveSheet();
     $acts = Doctrine_Query::create()->select('a.designation')->from('Act a')->where('a.disabled = ?', 0)->orderBy('a.designation')->execute();
     $numberOfActs = Doctrine_Query::create()->select('COUNT(*) as total')->from('Act a')->where('a.disabled = ?', 0)->fetchOne();
     $statement = Statistics::getTemporalStatementValuesByAct($from, $to);
     //Format the statement data into times:
     $statement = self::formatStatement($statement);
     /*Print all the acts at the top:*/
     $this->_exportQuantitativeStatementHeader($statement);
     $columns = Statistics::getTemporalStatementColumns($from, $to);
     $total = Statistics::getTotalTemporalStatementValues($from, $to);
     //Format the total data into times:
     $total = self::formatTotal($total);
     foreach ($columns as $stat_type => $stat) {
         $this->_exportQuantitativeStatementRessourceByString($columns, $statement, $stat_type, $total);
     }
     foreach ($columns as $stat_type => $stat) {
         $this->_exportQuantitativeStatementRessourceById($columns, $statement, $stat_type, $total);
     }
     //Specific exportations:
     $this->_exportQuantitativeStatementByCountry($columns, $statement, $total, $from, $to);
     $this->nextLine(3);
     $this->_exportQuantitativeStatementByDay($columns, $statement, $total);
     $this->nextLine(3);
     $this->_exportQuantitativeStatementByBuilding($columns, $statement, $total);
     $this->nextLine(3);
     //Details per category:
     $detailsPerCategory = Statistics::getTemporalDetailsPerCategory($from, $to, $total);
     $detailsPerCategory = self::formatStatement($detailsPerCategory);
     $this->_exportDetailsPerCategory($columns, $detailsPerCategory, $total);
     $this->nextLine(3);
     //Details per time slot:
     $detailsPerTimeSlot = Statistics::getTemporalDetailsPerTimeSlot($from, $to, $total);
     $detailsPerTimeSlot = self::formatStatement($detailsPerTimeSlot);
     $this->_exportDetailsPerTimeSlot($columns, $detailsPerTimeSlot, $total);
     $this->nextLine(3);
     //Page setup:
     $page_setup = new PHPExcel_Worksheet_PageSetup();
     $page_setup->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);
     $page_setup->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
     $page_setup->setHorizontalCentered(true);
     $active_sheet->setPageSetup($page_setup);
     $active_sheet->setShowGridlines(true);
     $active_sheet->setPrintGridlines(true);
     //Margins:
     $active_sheet->getPageMargins()->setTop(0.4);
     $active_sheet->getPageMargins()->setRight(0.2);
     $active_sheet->getPageMargins()->setLeft(0.2);
     $active_sheet->getPageMargins()->setBottom(0.4);
 }
开发者ID:xmasclaux,项目名称:OpenGenepi,代码行数:56,代码来源:ExportDocument.class.php

示例2: executeTemporalStatement

 public function executeTemporalStatement(sfWebRequest $request)
 {
     $from = $request->getParameter('formattedFrom');
     $to = $request->getParameter('formattedTo');
     $countries = array();
     $citiesTable = array();
     $cities = array();
     $this->acts = Doctrine_Query::create()->select('a.designation')->from('Act a')->where('a.disabled = ?', 0)->orderBy('a.designation')->execute();
     $this->numberOfActs = Doctrine_Query::create()->select('COUNT(*) as total')->from('Act a')->where('a.disabled = ?', 0)->fetchOne();
     $imputations = Doctrine_Query::create()->select('i.*')->from('ImputationArchive i')->where('imputation_date BETWEEN ? AND ?', array($from, $to))->execute();
     foreach ($imputations as $imputation) {
         $country = $imputation->getUserArchive()->getCountry();
         $city = $imputation->getUserArchive()->getCityName();
         if (!in_array($country, $countries)) {
             $countries[] = $country;
         }
         if (!in_array($city, $citiesTable)) {
             $citiesTable[] = $city;
             $cities[$country][] = $city;
         }
     }
     $this->countries = $countries;
     $this->cities = $cities;
     $this->statement = Statistics::getTemporalStatementValuesByAct($from, $to);
     $this->detailsPerCategory = Statistics::getTemporalDetailsPerCategory($from, $to);
     $this->detailsPerTimeSlot = Statistics::getTemporalDetailsPerTimeSlot($from, $to);
     $this->total = Statistics::getTotalTemporalStatementValues($from, $to);
     $this->columns = Statistics::getTemporalStatementColumns($from, $to);
     $this->from = $from;
     $this->to = $to;
     $this->setLayout('emptyLayout');
 }
开发者ID:xmasclaux,项目名称:OpenGenepi,代码行数:32,代码来源:actions.class.php


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