From c2e3a22e3058040bc16980d805e509cca31fde55 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Mon, 5 Jan 2004 21:04:27 +0000 Subject: Minor changes. git-svn-id: svn://svn.zabbix.com/trunk@1139 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/classes.inc.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'frontends/php/include/classes.inc.php') diff --git a/frontends/php/include/classes.inc.php b/frontends/php/include/classes.inc.php index d056ccaf..73e37e18 100644 --- a/frontends/php/include/classes.inc.php +++ b/frontends/php/include/classes.inc.php @@ -23,6 +23,7 @@ { var $period; var $from; + var $stime; var $sizeX; var $sizeY; var $shiftX; @@ -148,6 +149,15 @@ $this->period=$period; } + function setSTime($stime) + { + if($stime>20000000 && $stime<22000000) + { + $this->stime=mktime(0,0,0,substr($stime,4,2),substr($stime,6,2),substr($stime,0,4)); + $this->period=24*3600; + } + } + function setFrom($from) { $this->from=$from; @@ -431,8 +441,16 @@ function selectData() { $now = time(NULL); - $this->to_time=$now-3600*$this->from; - $this->from_time=$this->to_time-$this->period; + if(isset($this->stime)) + { + $this->to_time=$this->stime+24*3600; + $this->from_time=$this->stime; + } + else + { + $this->to_time=$now-3600*$this->from; + $this->from_time=$this->to_time-$this->period; + } $p=$this->to_time-$this->from_time; $z=$p-$this->from_time%$p; -- cgit