diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-07-08 18:26:11 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-07-08 18:26:11 +0000 |
| commit | 61bb117922840b02bb077fd1fa73d82c3987432b (patch) | |
| tree | 6bfb4d2c18452f7fbeaf8f3de1ec61d41f95e090 /frontends/php | |
| parent | dcd0418c71bfc6c4716ca27e5a69a6ef16b23062 (diff) | |
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@427 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
| -rw-r--r-- | frontends/php/chart.php | 2 | ||||
| -rw-r--r-- | frontends/php/history.php | 17 | ||||
| -rw-r--r-- | frontends/php/include/config.inc.php | 20 |
3 files changed, 27 insertions, 12 deletions
diff --git a/frontends/php/chart.php b/frontends/php/chart.php index 3d59dfd7..5590f835 100644 --- a/frontends/php/chart.php +++ b/frontends/php/chart.php @@ -9,7 +9,7 @@ if(!isset($period)) { - $period=0; + $period=3600; } if(!isset($from)) diff --git a/frontends/php/history.php b/frontends/php/history.php index a3f61251..600037aa 100644 --- a/frontends/php/history.php +++ b/frontends/php/history.php @@ -17,7 +17,14 @@ if($action=="showhistory") { - show_header("$host:$description",$beforenextcheck,0); + if(isset($year)) + { + show_header("$host:$description",0,0); + } + else + { + show_header("$host:$description",$beforenextcheck,0); + } } if($action=="showhistory2") { @@ -193,13 +200,17 @@ if($action=="showhistory") { + if(!isset($period)) + { + $period=3600; + } if(!isset($from)) { $from=0; } - if(!isset($period)) + if(isset($year)) { - $period=3600; + $from=($now-mktime($hour, 0, 0, $month, $day,$year))/3600; } @show_history($itemid,$from,$period,0); show_footer(); diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 3d02b110..c0d76df6 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -2383,6 +2383,8 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; function insert_time_navigator($itemid,$period,$from) { + $descr=array("January","February","March","April","May","June", + "July","August","September","October","November","December"); $sql="select min(clock),max(clock) from history where itemid=$itemid"; $result=DBselect($sql); @@ -2397,7 +2399,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; $max=DBget_field($result,0,1); } - $now=time()-12*$from; + $now=time()-3600*$from-$period; $year_min=date("Y",$min); $year_max=date("Y",$max); @@ -2407,9 +2409,11 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; $day_now=date("d",$now); $hour_now=date("H",$now); - echo "<form method=\"post\" action=\"history.php?itemid=$itemid&action=showhistory\">"; + echo "<form method=\"put\" action=\"history.php\">"; + echo "<input name=\"itemid\" type=\"hidden\" value=$itemid size=8>"; + echo "<input name=\"action\" type=\"hidden\" value=\"showhistory\" size=8>"; - echo "Year:"; + echo "Year"; echo "<select name=\"year\">"; for($i=$year_min;$i<=$year_max;$i++) { @@ -2424,22 +2428,22 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; } echo "</select>"; - echo "Month:"; + echo "Month"; echo "<select name=\"month\">"; for($i=1;$i<=12;$i++) { if($i==$month_now) { - echo "<option value=\"$i\" selected>$i"; + echo "<option value=\"$i\" selected>".$descr[$i-1]; } else { - echo "<option value=\"$i\">$i"; + echo "<option value=\"$i\">".$descr[$i-1]; } } echo "</select>"; - echo "Day:"; + echo "Day"; echo "<select name=\"day\">"; for($i=1;$i<=31;$i++) { @@ -2454,7 +2458,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; } echo "</select>"; - echo "Hour:"; + echo "Hour"; echo "<select name=\"hour\">"; for($i=0;$i<=23;$i++) { |
