From 3bcbd824202608c482702acf1c195df92a65f0b6 Mon Sep 17 00:00:00 2001 From: artem Date: Thu, 10 Jul 2008 13:19:35 +0000 Subject: - [DEV-137] fixes in history screen (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5824 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/chart6.php | 8 ++++---- frontends/php/history.php | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/frontends/php/chart6.php b/frontends/php/chart6.php index 569aabaa..fcf94a32 100644 --- a/frontends/php/chart6.php +++ b/frontends/php/chart6.php @@ -70,7 +70,6 @@ include_once "include/page_header.php"; $graph = new Pie($db_data["graphtype"]); if(isset($_REQUEST["period"])) $graph->SetPeriod($_REQUEST["period"]); - if(isset($_REQUEST["from"])) $graph->SetFrom($_REQUEST["from"]); if(isset($_REQUEST["stime"])) $graph->SetSTime($_REQUEST["stime"]); if(isset($_REQUEST["border"])) $graph->SetBorder(0); @@ -88,9 +87,10 @@ include_once "include/page_header.php"; if($db_data['show_3d'] == 1) $graph->SwitchPie3D(); $graph->SwitchLegend($db_data['show_legend']); - $result = DBselect("select gi.* from graphs_items gi ". - " where gi.graphid=".$db_data["graphid"]. - " order by gi.sortorder, gi.itemid desc"); + $result = DBselect('SELECT gi.* '. + ' FROM graphs_items gi '. + ' WHERE gi.graphid='.$db_data['graphid']. + ' ORDER BY gi.sortorder, gi.itemid DESC'); while($db_data=DBfetch($result)) { diff --git a/frontends/php/history.php b/frontends/php/history.php index 54561b6c..13a8d8aa 100644 --- a/frontends/php/history.php +++ b/frontends/php/history.php @@ -51,7 +51,7 @@ include_once "include/page_header.php"; "inc"=> array(T_ZBX_INT, O_OPT, null, null, null), "left"=> array(T_ZBX_INT, O_OPT, null, null, null), "right"=> array(T_ZBX_INT, O_OPT, null, null, null), - "stime"=> array(T_ZBX_INT, O_OPT, null, null, null), + "stime"=> array(T_ZBX_STR, O_OPT, null, null, null), "filter_task"=> array(T_ZBX_STR, O_OPT, null, IN(FILTER_TAST_SHOW.','.FILTER_TAST_HIDE.','.FILTER_TAST_MARK.','.FILTER_TAST_INVERT_MARK), null), @@ -263,9 +263,11 @@ include_once "include/page_header.php"; else if($_REQUEST["action"]=="showvalues" || $_REQUEST["action"]=="showlatest"){ if($_REQUEST["action"]=="showvalues"){ - - $time = time(null) - $effectiveperiod - $_REQUEST["from"] * 3600; - $till = time(null) - $_REQUEST["from"] * 3600; + + $bstime = isset($_REQUEST['stime'])?$_REQUEST['stime']:date('YmdHi',(time()-$_REQUEST['period'])); + $time = mktime(substr($bstime,8,2),substr($bstime,10,2),0,substr($bstime,4,2),substr($bstime,6,2),substr($bstime,0,4)); + $till = $time + $effectiveperiod; + $hours=$effectiveperiod / 3600; $l_header = array(S_SHOWING_HISTORY_OF.SPACE.$effectiveperiod.SPACE.S_SECONDS_SMALL.'('.$hours.' h)', -- cgit