From 88beea3acf8f654c42621a6208481238c7a006ec Mon Sep 17 00:00:00 2001 From: Sven Steudte Date: Sun, 15 Apr 2018 02:29:25 +0200 Subject: [PATCH] Added database destructor, fixed data range bug --- decoder/html/Database.class.php | 15 +++++---------- decoder/html/header.inc.php | 3 --- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/decoder/html/Database.class.php b/decoder/html/Database.class.php index e726930f..b0ad3924 100644 --- a/decoder/html/Database.class.php +++ b/decoder/html/Database.class.php @@ -5,12 +5,15 @@ class Database extends SQLite3 { private static $instance = null; function __construct() { - $this->open("/src/pecanpico10/decoder/decoder.sqlite"); - + $this->open("/var/www/dl7ad/pecanpico10/decoder/decoder.sqlite"); if($this->lastErrorCode()) echo $this->lastErrorMsg(); } + function __destruct() { + parent::close(); + } + static function getInstance() { if(self::$instance == null) self::$instance = new Database(); @@ -41,11 +44,3 @@ class Database extends SQLite3 { } } ?> - - - - - - - - diff --git a/decoder/html/header.inc.php b/decoder/html/header.inc.php index dee760e6..22019d39 100644 --- a/decoder/html/header.inc.php +++ b/decoder/html/header.inc.php @@ -17,9 +17,6 @@ if(array_key_exists('call', $_GET)) { } $range = isset($_GET['range']) && is_numeric($_GET['range']) ? $_GET['range'] : 86400; - -if($tel->rxtime < time() - $range) - $range = time() - $tel->rxtime; ?>