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


PHP Statistics::getQuantitativeDetailsPerTimeSlot方法代码示例

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


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

示例1: _exportQuantitativeStatement

 /**
  * 
  * @param $from
  * @param $to
  */
 protected function _exportQuantitativeStatement($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::getQuantitativeStatementValuesByAct($from, $to);
     /*Print all the acts at the top:*/
     $this->_exportQuantitativeStatementHeader($statement);
     $columns = Statistics::getQuantitativeStatementColumns($from, $to);
     $total = Statistics::getTotalQuantitativeStatementValues($from, $to);
     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::getQuantitativeDetailsPerCategory($from, $to);
     $this->_exportDetailsPerCategory($columns, $detailsPerCategory, $total);
     $this->nextLine(3);
     //Details per time slot:
     $detailsPerTimeSlot = Statistics::getQuantitativeDetailsPerTimeSlot($from, $to);
     $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,代码行数:50,代码来源:ExportDocument.class.php

示例2: executeQuantitativeStatement

 public function executeQuantitativeStatement(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::getQuantitativeStatementValuesByAct($from, $to);
     $this->detailsPerCategory = Statistics::getQuantitativeDetailsPerCategory($from, $to);
     $this->detailsPerTimeSlot = Statistics::getQuantitativeDetailsPerTimeSlot($from, $to);
     $this->total = Statistics::getTotalQuantitativeStatementValues($from, $to);
     $this->columns = Statistics::getQuantitativeStatementColumns($from, $to);
     $this->from = $from;
     $this->to = $to;
     $this->setLayout('emptyLayout');
 }
开发者ID:xmasclaux,项目名称:OpenGenepi,代码行数:32,代码来源:actions.class.php


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