mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
presence rework #1119, plugin history filter
This commit is contained in:
@@ -29,7 +29,6 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
|
||||
case 'getEvents': getEvents(); break;
|
||||
case 'getDeviceSessions': getDeviceSessions(); break;
|
||||
case 'getDevicePresence': getDevicePresence(); break;
|
||||
case 'getDeviceEvents': getDeviceEvents(); break;
|
||||
case 'getEventsCalendar': getEventsCalendar(); break;
|
||||
default: logServerConsole ('Action: '. $action); break;
|
||||
}
|
||||
@@ -410,41 +409,4 @@ function getEventsCalendar() {
|
||||
echo (json_encode($tableData));
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Query Device events
|
||||
//------------------------------------------------------------------------------
|
||||
function getDeviceEvents() {
|
||||
global $db;
|
||||
|
||||
// Request Parameters
|
||||
$mac = $_REQUEST['mac'];
|
||||
$periodDate = getDateFromPeriod();
|
||||
$hideConnections = $_REQUEST ['hideConnections'];
|
||||
|
||||
// SQL
|
||||
$SQL = 'SELECT eve_DateTime, eve_EventType, eve_IP, eve_AdditionalInfo
|
||||
FROM Events
|
||||
WHERE eve_MAC="'. $mac .'" AND eve_DateTime >= '. $periodDate .'
|
||||
AND ( (eve_EventType <> "Connected" AND eve_EventType <> "Disconnected" AND
|
||||
eve_EventType <> "VOIDED - Connected" AND eve_EventType <> "VOIDED - Disconnected")
|
||||
OR "'. $hideConnections .'" = "false" ) ';
|
||||
$result = $db->query($SQL);
|
||||
|
||||
// arrays of rows
|
||||
$tableData = array();
|
||||
while ($row = $result -> fetchArray (SQLITE3_NUM)) {
|
||||
$row[0] = formatDate ($row[0]);
|
||||
$tableData['data'][] = $row;
|
||||
}
|
||||
|
||||
// Control no rows
|
||||
if (empty($tableData['data'])) {
|
||||
$tableData['data'] = '';
|
||||
}
|
||||
|
||||
// Return json
|
||||
echo (json_encode ($tableData));
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user