From fa170aa37b7803a73fee5218a938af59af084302 Mon Sep 17 00:00:00 2001 From: f0o Date: Wed, 27 May 2015 16:06:47 +0000 Subject: [PATCH] Fix bug with worded states in device-table --- html/includes/table/devices.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/html/includes/table/devices.inc.php b/html/includes/table/devices.inc.php index 66ed751126..02c2b925e0 100644 --- a/html/includes/table/devices.inc.php +++ b/html/includes/table/devices.inc.php @@ -30,8 +30,12 @@ if (!empty($_POST['type'])) { } } if (!empty($_POST['state'])) { - $sql .= " AND status= ?"; $param[] = $state; - $sql .= " AND disabled='0' AND `ignore`='0'"; $param[] = ''; + $sql .= " AND status= ?"; + if( is_numeric($_POST['state']) ) { + $param[] = $_POST['state']; + } else { + $param[] = str_replace(array('up','down'),array(1,0),$_POST['state']); + } } if (!empty($_POST['disabled'])) { $sql .= " AND disabled= ?"; $param[] = $_POST['disabled']; } if (!empty($_POST['ignore'])) { $sql .= " AND `ignore`= ?"; $param[] = $_POST['ignore']; }