2007-04-03 14:10:23 +00:00
< meta http - equiv = " refresh " content = " 60 " >
2009-08-07 16:10:52 +00:00
< div style = 'margin:auto; text-align: center; margin-top: 0px; margin-bottom: 0px;' >
< b class = 'rounded' >
< b class = 'rounded1' >< b ></ b ></ b >
< b class = 'rounded2' >< b ></ b ></ b >
< b class = 'rounded3' ></ b >
< b class = 'rounded4' ></ b >
< b class = 'rounded5' ></ b ></ b >
< div class = 'roundedfg' style = 'padding: 0px 5px;' >
< div style = 'margin: auto; text-align: left; padding: 5px 5px; padding-left: 11px; clear: both; display:block;' >
2008-12-09 13:55:41 +00:00
< form method = " post " action = " " >
2008-11-26 12:55:55 +00:00
< label >< strong > Search </ strong >
2008-12-09 13:55:41 +00:00
< input type = " text " name = " string " id = " string " value = " <?php echo( $_POST['string'] ); ?> " />
2008-11-26 12:55:55 +00:00
</ label >
< label >
< strong > Program </ strong >
< select name = " program " id = " program " >
< option value = " " > All Programs </ option >
< ? php
$query = mysql_query ( " SELECT `program` FROM `syslog` GROUP BY `program` ORDER BY `program` " );
while ( $data = mysql_fetch_array ( $query )) {
2008-12-09 13:55:41 +00:00
echo ( " <option value=' " . $data [ 'program' ] . " ' " );
if ( $data [ 'program' ] == $_POST [ 'program' ]) { echo ( " selected " ); }
echo ( " > " . $data [ 'program' ] . " </option> " );
2008-11-26 12:55:55 +00:00
}
?>
</ select >
</ label >
< label >
< strong > Device </ strong >
< select name = " device " id = " device " >
< option value = " " > All Devices </ option >
< ? php
$query = mysql_query ( " SELECT * FROM `devices` ORDER BY `hostname` " );
while ( $data = mysql_fetch_array ( $query )) {
echo ( " <option value=' " . $data [ 'device_id' ] . " ' " );
2008-12-09 13:55:41 +00:00
if ( $data [ 'device_id' ] == $_POST [ 'device' ]) { echo ( " selected " ); }
2008-11-26 12:55:55 +00:00
echo ( " > " . $data [ 'hostname' ] . " </option> " );
}
?>
</ select >
</ label >
< input type = submit value = Search >
</ form >
</ div >
2009-08-07 16:10:52 +00:00
</ div >
< b class = 'rounded' >
< b class = 'rounded5' ></ b >
< b class = 'rounded4' ></ b >
< b class = 'rounded3' ></ b >
< b class = 'rounded2' >< b ></ b ></ b >
< b class = 'rounded1' >< b ></ b ></ b ></ b >
</ div >
2008-11-26 12:55:55 +00:00
2007-04-03 14:10:23 +00:00
< ?
2008-12-09 13:55:41 +00:00
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 " ;
2007-04-03 14:10:23 +00:00
$query = mysql_query ( $sql );
2007-06-24 14:56:47 +00:00
echo ( " <table cellspacing=0 cellpadding=2 width=100%> " );
2008-03-23 15:40:58 +00:00
while ( $entry = mysql_fetch_array ( $query )) { include ( " includes/print-syslog.inc " ); }
2007-06-24 14:56:47 +00:00
echo ( " </table> " );
2007-04-03 14:10:23 +00:00
?>
</ table >