Esempio n. 1
0
 /**
  * print a single month
  *
  * @param $date
  */
 private function month($date = '')
 {
     if (!$date) {
         $date = date('Y-m');
     }
     $data = $this->log->logdata[$date];
     $this->R->table_open();
     $this->R->tablerow_open();
     $this->head(sprintf($this->getLang('t_statisticMonth'), $date), 3);
     $this->R->tablerow_close();
     $this->R->tablerow_open();
     $this->hcell($this->getLang('totalHits'));
     $this->cell($data['page']['all']['count'] + $data['media']['all']['count'], 2);
     $this->R->tablerow_close();
     $this->R->tablerow_open();
     $this->hcell($this->getLang('totalFiles'));
     $this->cell($data['media']['all']['count'], 2);
     $this->R->tablerow_close();
     $this->R->tablerow_open();
     $this->hcell($this->getLang('totalPages'));
     $this->cell($data['page']['all']['count'], 2);
     $this->R->tablerow_close();
     $this->R->tablerow_open();
     $this->hcell($this->getLang('totalVisitors'));
     $this->cell($data['page']['all']['visitor'], 2);
     $this->R->tablerow_close();
     $this->R->tablerow_open();
     $this->hcell($this->getLang('totalBytes'));
     $this->cell(filesize_h($data['page']['all']['bytes']), 2);
     $this->R->tablerow_close();
     $this->R->tablerow_open();
     $this->head('');
     $this->head($this->getLang('avg'));
     $this->head($this->getLang('max'));
     $this->R->tablerow_close();
     $this->R->tablerow_open();
     $this->hcell($this->getLang('hitsHour'));
     $this->cell($this->log->avg($data['hits']['hour'], 'count'));
     $this->cell($this->log->max($data['hits']['hour'], 'count'));
     $this->R->tablerow_close();
     $this->R->tablerow_open();
     $this->hcell($this->getLang('hitsDay'));
     $this->cell($this->log->avg($data['hits']['day'], 'count'));
     $this->cell($this->log->max($data['hits']['day'], 'count'));
     $this->R->tablerow_close();
     $this->R->tablerow_open();
     $this->hcell($this->getLang('filesDay'));
     $this->cell($this->log->avg($data['media']['day'], 'count'));
     $this->cell($this->log->max($data['media']['day'], 'count'));
     $this->R->tablerow_close();
     $this->R->tablerow_open();
     $this->hcell($this->getLang('pagesDay'));
     $this->cell($this->log->avg($data['page']['day'], 'count'));
     $this->cell($this->log->max($data['page']['day'], 'count'));
     $this->R->tablerow_close();
     $this->R->tablerow_open();
     $this->hcell($this->getLang('bytesDay'));
     $this->cell(filesize_h($this->log->avg($data['hits']['day'], 'bytes')));
     $this->cell(filesize_h($this->log->max($data['hits']['day'], 'bytes')));
     $this->R->tablerow_close();
     $this->R->tablerow_open();
     $this->head($this->getLang('hitsStatusCode'), 3);
     $this->R->tablerow_close();
     foreach ((array) $this->log->logdata[$date]['status']['all'] as $code => $count) {
         $this->R->tablerow_open();
         $this->hcell('Status ' . $code . ' - ' . $this->getLang('status_' . $code));
         $this->cell($count, 2);
         $this->R->tablerow_close();
     }
     $this->R->table_close();
 }