diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-05-09 13:38:49 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-05-09 13:38:49 +0000 |
| commit | 600d1fa907d54c247ab2fdb38573c4503aeffc8a (patch) | |
| tree | 2a19f8ce66f3eb4874763a39e73b4fb6ee6bca3b /frontends/php/report4.php | |
| parent | aa379c6f18a008a13b3daef3770177da0198ae80 (diff) | |
| download | zabbix-600d1fa907d54c247ab2fdb38573c4503aeffc8a.tar.gz zabbix-600d1fa907d54c247ab2fdb38573c4503aeffc8a.tar.xz zabbix-600d1fa907d54c247ab2fdb38573c4503aeffc8a.zip | |
- increased maximal size of images (Eugene)
- improoved validation
- more
git-svn-id: svn://svn.zabbix.com/trunk@4109 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/report4.php')
| -rw-r--r-- | frontends/php/report4.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/frontends/php/report4.php b/frontends/php/report4.php index cbd63524..dc04f714 100644 --- a/frontends/php/report4.php +++ b/frontends/php/report4.php @@ -38,13 +38,21 @@ include_once "include/page_header.php"; check_fields($fields); ?> <?php - $year = get_request("year", 2006); + $year = get_request("year", intval(date("Y"))); $period = get_request("period", "weekly"); $media_type = get_request("media_type", 0); ?> <?php - define("YEAR_LEFT_SHIFT", 5); - + if( ($min_time = DBfetch(DBselect('select min(clock) as clock from alerts'))) && $min_time['clock']) + { + $MIN_YEAR = intval(date("Y", $min_time['clock'])); + } + + if( !isset($MIN_YEAR) ) + { + $MIN_YEAR = intval(date("Y")); + } + $form = new CForm(); $form->AddItem(SPACE.S_MEDIA_TYPE.SPACE); @@ -69,7 +77,7 @@ include_once "include/page_header.php"; { $form->AddItem(SPACE.S_YEAR.SPACE); $cmbYear = new CComboBox("year", $year, "submit();"); - for($y = date("Y")-YEAR_LEFT_SHIFT; $y <= date("Y"); $y++) + for($y = $MIN_YEAR; $y <= date("Y"); $y++) $cmbYear->AddItem($y, $y); $form->AddItem($cmbYear); } @@ -105,7 +113,7 @@ include_once "include/page_header.php"; switch($period) { case "yearly": - $from = (date("Y") - YEAR_LEFT_SHIFT); + $from = $MIN_YEAR; $to = date("Y"); array_unshift($header, new CCol(S_YEAR,"center")); function get_time($y) { return mktime(0,0,0,1,1,$y); } |
