more code cleanup (last commit for now)

git-svn-id: http://www.observium.org/svn/observer/trunk@2520 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-09-20 14:37:54 +00:00
parent f87ed09e1b
commit 9a1bee1458
71 changed files with 296 additions and 293 deletions

View File

@@ -17,7 +17,7 @@
foreach (dbFetchRows("SELECT `program` FROM `syslog` GROUP BY `program` ORDER BY `program`") as $data)
{
echo("<option value='".$data['program']."'");
if ($data['program'] == $_POST['program']) { echo("selected"); }
if ($data['program'] == $_POST['program']) { echo("selected"); }
echo(">".$data['program']."</option>");
}
?>
@@ -32,7 +32,7 @@
{
echo("<option value='".$data['device_id']."'");
if ($data['device_id'] == $_POST['device']) { echo("selected"); }
if ($data['device_id'] == $_POST['device']) { echo("selected"); }
echo(">".$data['hostname']."</option>");
}
@@ -69,7 +69,7 @@ if (is_numeric($_POST['device']))
if ($_SESSION['userlevel'] >= '5')
{
$sql = "SELECT *, DATE_FORMAT(timestamp, '%Y-%m-%d %T') AS date from syslog AS S";
if(count($array))
if (count($array))
{
$sql .= " WHERE 1 ".$where;
}
@@ -77,7 +77,7 @@ if ($_SESSION['userlevel'] >= '5')
} else {
$sql = "SELECT *, DATE_FORMAT(timestamp, '%Y-%m-%d %T') AS date from syslog AS S, devices_perms AS P";
$sql .= "WHERE S.device_id = P.device_id AND P.user_id = ?";
if(count($array))
if (count($array))
{
$sql .= " WHERE 1 ".$where;
}