= '10') { mysql_query("TRUNCATE TABLE `eventlog`"); print_message("Event log truncated"); } $numresults = 250; print_optionbar_start(); if (is_numeric($vars['page'])) { $start = $vars['page'] * $numresults; } else { $start = 0; } $where = "1"; if (is_numeric($_POST['device'])) { $where .= ' AND E.host = ?'; $param[] = $_POST['device']; } if ($_POST['string']) { $where .= " AND E.message LIKE ?"; $param[] = "%".$_POST['string']."%"; } ?>
= '5') { $query = "SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` AS E WHERE $where ORDER BY `datetime` DESC LIMIT $start,$numresults"; } else { $query = "SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` AS E, devices_perms AS P WHERE $where AND E.host = P.device_id AND P.user_id = ? ORDER BY `datetime` DESC LIMIT $start,$numresults"; $param[] = $_SESSION['user_id']; } echo('