コード例 #1
0
 public function getPublisherImpressionsPerTimeExcelAction()
 {
     $initialized = $this->initialize();
     if ($initialized !== true) {
         return $initialized;
     }
     $extra_params = array();
     if ($this->PublisherInfoID != null) {
         $user_role = 2;
         $extra_params = array('PublisherInfoID' => $this->PublisherInfoID);
     } elseif (!$this->is_admin) {
         die("bad request");
     }
     $impression = \_factory\PublisherImpressionsAndSpendHourly::get_instance($this->config_handle);
     $stats = json_decode($this->getPerTime($impression, $extra_params), TRUE);
     $impression_headers = $impression->getPerTimeHeader($this->is_admin);
     $dates = $this->getDatesForExcelReport();
     $title = "Publisher Impressions";
     \util\ReportHelper::download_excel_file($stats['data'], $impression_headers, $stats['totals'], $title, $dates);
 }
コード例 #2
0
ファイル: ReportController.php プロジェクト: cloudseo/nginad
 public function getPublisherImpressionsPerTimeExcelAction()
 {
     $initialized = $this->initialize();
     if ($initialized !== true) {
         return $initialized;
     }
     $extra_params = array();
     if ($this->PublisherInfoID != null) {
         $user_role = 2;
         $extra_params = array('PublisherInfoID' => $this->PublisherInfoID);
     } elseif ($this->DemandCustomerInfoID != null && $this->is_domain_admin) {
         $user_role = 3;
         // admin is logged in as a user, get the stats for just that user
         if ($this->ImpersonateID != 0 && !empty($this->PublisherInfoID)) {
             $extra_params = array('PublisherInfoID' => $this->PublisherInfoID);
         }
     } elseif (!$this->is_super_admin) {
         die("bad request");
     }
     $impression = \_factory\PublisherImpressionsAndSpendHourly::get_instance($this->config_handle);
     $stats = json_decode($this->getPerTime($impression, $extra_params, $this->is_domain_admin), TRUE);
     if ($this->is_domain_admin) {
         $impression_headers = $impression->getPerTimeHeaderPrivateExchange();
     } else {
         $impression_headers = $impression->getPerTimeHeader($this->is_super_admin);
     }
     $dates = $this->getDatesForExcelReport();
     $title = "Publisher Impressions";
     \util\ReportHelper::download_excel_file($stats['data'], $impression_headers, $stats['totals'], $title, $dates);
 }