Merge pull request #644 from f0o/issue-643

Fix searchbox on device's eventlog
This commit is contained in:
Neil Lathwood
2015-03-23 16:14:25 +00:00
+7 -2
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">