Fix presence, time selector, improve ntfy

This commit is contained in:
Joshua
2022-07-26 17:05:27 +10:00
parent 95f12b0a72
commit a25b653753
4 changed files with 19 additions and 56 deletions

View File

@@ -1387,7 +1387,7 @@ function getSessionsPresenceEvents () {
// Define Presence datasource and query data
$('#calendar').fullCalendar('removeEventSources');
$('#calendar').fullCalendar('addEventSource',
{ url: 'php/server/events.php?action=getDevicePresence&mac=' + mac +'&period='+ period });
{ url: 'php/server/events.php?action=getDevicePresence&mac=' + mac});
// Query events
getDeviceEvents();

View File

@@ -51,6 +51,7 @@ function OpenDB () {
}
$db = SQLite3_connect(true);
$db->exec('PRAGMA journal_mode = wal;');
if(!$db)
{
die ('Error connecting to database');

View File

@@ -225,7 +225,7 @@ function getDeviceSessions() {
}
// Duration
if ($row['ses_EventTypeConnection'] == '<missing event>' || $row['ses_EventTypeDisconnection'] == '<missing event>') {
if ($row['ses_EventTypeConnection'] == '<missing event>' || $row['ses_EventTypeConnection'] == NULL || $row['ses_EventTypeDisconnection'] == '<missing event>' || $row['ses_EventTypeDisconnection'] == NULL) {
$dur = '...';
} elseif ($row['ses_StillConnected'] == true) {
$dur = formatDateDiff ($row['ses_DateTimeConnection'], ''); //***********
@@ -261,7 +261,6 @@ function getDevicePresence() {
// Request Parameters
$mac = $_REQUEST['mac'];
$periodDate = getDateFromPeriod();
$startDate = '"'. formatDateISO ($_REQUEST ['start']) .'"';
$endDate = '"'. formatDateISO ($_REQUEST ['end']) .'"';