From 61f8cb27c10eaab84754943026e72dc0850d7b63 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Sat, 6 Feb 2010 22:14:43 +0000 Subject: [PATCH] clean up devices php/html code and small bugfix git-svn-id: http://www.observium.org/svn/observer/trunk@774 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/pages/devices.php | 201 ++++++++++++++++++++--------------------- 1 file changed, 100 insertions(+), 101 deletions(-) diff --git a/html/pages/devices.php b/html/pages/devices.php index b931ba3ad0..df13748855 100644 --- a/html/pages/devices.php +++ b/html/pages/devices.php @@ -1,98 +1,97 @@ - - - - - - - - - - +
- - - -
- -
- -
- -
- - - -
+ + + + + + + + +
+ + + +
+ +
+ +
+ +
+ + +
@@ -101,18 +100,18 @@ print_optionbar_end(); if ($_POST['hostname']) { $where = " AND hostname LIKE '%".$_POST['hostname']."%'"; } -if ($_POST['os']) { $where = " AND os = '".$_POST['os']."'"; } -if ($_POST['version']) { $where .= " AND version = '".$_POST['version']."'"; } +if ($_POST['os']) { $where = " AND os = '".$_POST['os']."'"; } +if ($_POST['version']) { $where .= " AND version = '".$_POST['version']."'"; } if ($_POST['hardware']) { $where .= " AND hardware = '".$_POST['hardware']."'"; } if ($_POST['features']) { $where .= " AND features = '".$_POST['features']."'"; } if ($_POST['location']) { $where .= " AND location = '".$_POST['location']."'"; } -if ($_GET['location']) { $where = "AND location = '$_GET[location]'"; } -if ($_GET['location'] == "Unset") { $where = "AND location = ''"; } -if ($_GET['type']) { $where = "AND type = '$_GET[type]'"; } +if ($_GET['location']) { $where .= " AND location = '".$_GET['location']."'"; } +if ($_GET['type']) { $where = "AND type = '$_GET[type]'"; } +if ($_GET['location'] == "Unset") { $where .= " AND location = ''"; } -$sql = "select * from devices WHERE 1 $where ORDER BY `ignore`, `status`, `hostname`"; +$sql = "SELECT * FROM devices WHERE 1 $where ORDER BY `ignore`, `status`, `hostname`"; if ($_GET['status'] == "alerted") { - $sql = "select * from devices " . $device_alert_sql . " GROUP BY `device_id` ORDER BY `ignore`, `status`, `os`, `hostname`"; + $sql = "SELECT * FROM devices " . $device_alert_sql . " GROUP BY `device_id` ORDER BY `ignore`, `status`, `os`, `hostname`"; } echo('