summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/inc/filter.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/statistics/inc/filter.inc.php')
-rw-r--r--modules-available/statistics/inc/filter.inc.php37
1 files changed, 1 insertions, 36 deletions
diff --git a/modules-available/statistics/inc/filter.inc.php b/modules-available/statistics/inc/filter.inc.php
index 8f61e44b..46de467b 100644
--- a/modules-available/statistics/inc/filter.inc.php
+++ b/modules-available/statistics/inc/filter.inc.php
@@ -106,14 +106,6 @@ class Filter
$filters[] = new LocationFilter($operator, $rhs);
} elseif ($lhs === 'subnet') {
$filters[] = new SubnetFilter($operator, $rhs);
- } elseif ($lhs === 'lastboot') {
- $filters[] = new ByDateFilter($operator, $rhs, $lhs);
- } elseif ($lhs === 'firstseen') {
- $filters[] = new ByDateFilter($operator, $rhs, $lhs);
- } elseif ($lhs === 'lastseen') {
- $filters[] = new ByDateFilter($operator, $rhs, $lhs);
- } elseif ($lhs === 'logintime') {
- $filters[] = new ByDateFilter($operator, $rhs, $lhs);
} else {
if (array_key_exists($lhs, Page_Statistics::$columns) && Page_Statistics::$columns[$lhs]['column']) {
$filters[] = new Filter($lhs, $operator, $rhs);
@@ -168,6 +160,7 @@ class RuntimeFilter extends Filter
public function whereClause(&$args, &$joins)
{
+ global $SIZE_RAM;
$upper = time() - (int)$this->argument * 3600;
$lower = $upper - 3600;
$common = "state IN ('OCCUPIED', 'IDLE', 'STANDBY') AND";
@@ -190,34 +183,6 @@ class RuntimeFilter extends Filter
}
}
-class ByDateFilter extends Filter
-{
- public function __construct($operator, $argument, $filter)
- {
- parent::__construct($filter, $operator, $argument);
- }
-
- public function whereClause(&$args, &$joins)
- {
- if ($this->operator == '=') {
- return " DATE(FROM_UNIXTIME($this->column)) = '$this->argument'";
- } elseif ($this->operator == '<') {
- return " DATE(FROM_UNIXTIME($this->column)) < '$this->argument'";
- } elseif ($this->operator == '<=') {
- return " DATE(FROM_UNIXTIME($this->column)) <= '$this->argument'";
- } elseif ($this->operator == '>') {
- return " DATE(FROM_UNIXTIME($this->column)) > '$this->argument'";
- } elseif ($this->operator == '>=') {
- return " DATE(FROM_UNIXTIME($this->column)) >= '$this->argument'";
- } elseif ($this->operator == '!=') {
- return " DATE(FROM_UNIXTIME($this->column)) != '$this->argument'";
- } else {
- error_log("unimplemented operator in ByDateFilter: $this->operator");
- return ' 1';
- }
- }
-}
-
class Id44Filter extends Filter
{
public function __construct($operator, $argument)