Fix searchbox on device's eventlog

This commit is contained in:
f0o
2015-03-23 15:56:52 +00:00
parent d88be9b377
commit 07e1e7fbcc

View File

@@ -19,14 +19,19 @@
?>
</select>
</label>
<input class=submit type=submit value=Search>
<input class="submit" type="submit" value="Search">
</form>
<?php
print_optionbar_end();
$entries = dbFetchRows("SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` WHERE `host` = ? ORDER BY `datetime` DESC LIMIT 0,250", array($device['device_id']));
$sql = "";
if( !empty($_POST['string']) ) {
$sql .= " AND message LIKE '%".mres($_POST['string'])."%'";
}
$entries = dbFetchRows("SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` WHERE `host` = ? $sql ORDER BY `datetime` DESC LIMIT 0,250", array($device['device_id']));
echo(' <div class="panel panel-default panel-condensed">
<div class="panel-heading">