diff --git a/html/includes/print-graph-alerts.inc.php b/html/includes/print-graph-alerts.inc.php new file mode 100644 index 000000000..ac4a713f0 --- /dev/null +++ b/html/includes/print-graph-alerts.inc.php @@ -0,0 +1,100 @@ + +* This program is free software: you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation, either version 3 of the License, or (at your +* option) any later version. Please see LICENSE.txt at the top level of +* the source code distribution for details. +*/ +$pagetitle[] = "Alert Stats"; + +if (isset($device['device_id']) && $device['device_id'] > 0) { + $sql = " AND alert_log.device_id=?"; + $param = array( + $device['device_id'] + ); +} + +if ($_SESSION['userlevel'] >= '5') { + $query = "SELECT DATE(time_logged) Date, COUNT(alert_log.device_id) totalCount, alert_rules.severity Severity FROM alert_log,alert_rules WHERE alert_log.rule_id=alert_rules.id $sql GROUP BY DATE(time_logged),alert_rules.severity"; +} + +if ($_SESSION['userlevel'] < '5') { + $query = "SELECT DATE(time_logged) Date, COUNT(alert_log.device_id) totalCount, alert_rules.severity Severity FROM alert_log,alert_rules,devices_perms WHERE alert_log.rule_id=alert_rules.id $sql AND alert_log.device_id = devices_perms.device_id AND devices_perms.user_id = " . $_SESSION['user_id'] . " GROUP BY DATE(time_logged),alert_rules.severity"; +} + +?> + +
+ \ No newline at end of file diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index 37e085041..af4177417 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -56,6 +56,7 @@ if (isset($config['site_style']) && ($config['site_style'] == 'dark' || $config[