forked from tmanternach/WebSysLog
-
Notifications
You must be signed in to change notification settings - Fork 2
/
function.php
32 lines (27 loc) · 1009 Bytes
/
function.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
<?php
//Include
require_once("config.php");
//Function for no results found
function noResFound() {
echo "<span class=\"warning\">No results found! ¯\_(ツ)_/¯</span><br>";
}
//Function for SELECT in search.php, 4 Days Archive
function selectFromArchive4DaysDBM($db, $date, $query, $limit) {
$sql="SELECT * FROM (
SELECT * FROM ".$db." WHERE timestamp LIKE '".$date."%' AND (timestamp LIKE '%".$query."%' OR host LIKE '%".$query."%' OR msg LIKE '%".$query."%')
ORDER BY id DESC
)
sub
ORDER BY timestamp DESC LIMIT 500";
$result = mysql_query($sql);
return $result;
}
//Function for SELECT in search.php
function selectFromArchiveDBM($db, $date, $query, $limit) {
$sql="SELECT id,timestamp,host,facility,level,tag,msg FROM ".$db." WHERE timestamp LIKE '".$date."%' AND (timestamp LIKE '%".$query."%' OR host LIKE '%".$query."%'
OR msg LIKE '%".$query."%')
ORDER BY timestamp DESC LIMIT 500";
$result = mysql_query($sql);
return $result;
}
?>