if($_GET['del']) {
$id = $_GET['del'];
$query = "DELETE FROM `alerts` WHERE `id` = '$id'";
mysql_query($query);
}
$sql = "select *,DATE_FORMAT(time_logged, '%D %M %Y %T') as time, A.id as id, D.id as device_id from alerts AS A, devices as D WHERE A.device_id = D.id ORDER BY time_logged DESC LIMIT 100";
echo("
");
$query = mysql_query($sql);
while($event = mysql_fetch_array($query))
{
if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; }
$type = $event[importance];
switch ($type) {
case "9":
$type = "
";
break;
case "7":
$type = "
";
break;
case "2":
$type = "
";
break;
case "0":
$type = "
";
break;
}
if(!$argh) {
echo ("
|
$event[time]
|
$event[hostname]
|
$type
|
$event[message]
|
|
|
");
}
}
?>