if($_POST['string']) {
$where = " AND S.msg LIKE '%".$_POST['string']."%'";
}
if($_POST['program']) {
$where .= " AND S.program = '".$_POST['program']."'";
}
if($_POST['device']) {
$where .= " AND D.device_id = '".$_POST['device']."'";
}
$sql = "SELECT *, DATE_FORMAT(datetime, '%D %b %T') AS date from syslog AS S, devices AS D WHERE S.device_id = D.device_id $where ORDER BY datetime DESC LIMIT 1000";
$query = mysql_query($sql);
echo("");
while($entry = mysql_fetch_array($query)) { include("includes/print-syslog.inc"); }
echo("
");
?>