forked from tmanternach/WebSysLog
-
Notifications
You must be signed in to change notification settings - Fork 2
/
update.php
43 lines (36 loc) · 1.29 KB
/
update.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
//Set Var
$query = $_GET['q'];
$query = trim($query);
$date = $_GET['d'];
$date = trim($date);
$curDate = date("Y-m-d");
$lastId = $_GET['lastId'];
require_once("config.php");
if ($_GET['firstId'] != NULL){
echo "<li class=\"live\">D'oh...!</li>";
}
if ($query == NULL && $date == NULL) {
}
$id_col = $tbl->long_columnName('id');
$sql="SELECT * FROM " . $tbl->tableName() . " WHERE $id_col > $lastId ORDER BY $id_col DESC;";
$result = mysql_query($sql, $database->getDBcon());
while($row = mysql_fetch_array($result)) {
$id = $row[$tbl->columnName('id')];
$receivedAt = substr($row[$tbl->columnName('ReceivedAt')], 0);
$fromtHost = $row[$tbl->ColumnName('FromHost')];
$syslogTag = $row[$tbl->ColumnName('SysLogTag')];
$syslogLevel = $row[$tbl->ColumnName('Priority')];
$message = $row[$tbl->ColumnName('Message')];
$syslogTagPos = strpos($syslogTag, "[");
if($syslogTagPos == "0") {
$syslogTagPos = strpos($syslogTag, ":");
}
echo "<li class=\"live\" id=\"$id\">";
echo "<span id=\"$id\" class=\"receivedAt\">$receivedAt</span>";
echo "<span id=\"$id\" class=\"fromHost\">$fromtHost</span>";
echo "<span id=\"$id\" class=\"Tag\">".$syslogLevel."</span>";
echo "<span id=\"$id\" class=\"Message\">$message</span>";
echo "</li>";
}
?>