From 337dec8ec33bd32de91692a6a33e6eb7be2b2abd Mon Sep 17 00:00:00 2001 From: leiweibau <105860611+leiweibau@users.noreply.github.com> Date: Sun, 24 Jul 2022 16:15:59 +0200 Subject: [PATCH] merge commit https://github.com/jokob-sk/Pi.Alert/commit/3df87f6f36645cfef4f427c782b5df573db45194 --- front/php/server/events.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/front/php/server/events.php b/front/php/server/events.php index 1d0fa228..60e79478 100644 --- a/front/php/server/events.php +++ b/front/php/server/events.php @@ -267,7 +267,7 @@ function getDevicePresence() { // SQL $SQL = 'SELECT ses_EventTypeConnection, ses_DateTimeConnection, - ses_EventTypeDisconnection, ses_DateTimeDisconnection, ses_IP, ses_AdditionalInfo, + ses_EventTypeDisconnection, ses_DateTimeDisconnection, ses_IP, ses_AdditionalInfo, ses_StillConnected, CASE WHEN ses_EventTypeConnection = "" THEN @@ -290,11 +290,13 @@ function getDevicePresence() { // arrays of rows while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { // Event color - if ($row['ses_EventTypeConnection'] == '' || $row['ses_EventTypeDisconnection'] == '') { - $color = '#f39c12'; - } else { - $color = '#0073b7'; - } + if ($row['ses_EventTypeConnection'] == '' || $row['ses_EventTypeDisconnection'] == '') { + $color = '#f39c12'; + } elseif ($row['ses_StillConnected'] == 1 ) { + $color = '#00a659'; + } else { + $color = '#0073b7'; + } // tooltip $tooltip = 'Connection: ' . formatEventDate ($row['ses_DateTimeConnection'], $row['ses_EventTypeConnection']) . chr(13) . @@ -333,7 +335,7 @@ function getEventsCalendar() { // SQL $SQL = 'SELECT ses_MAC, ses_EventTypeConnection, ses_DateTimeConnection, - ses_EventTypeDisconnection, ses_DateTimeDisconnection, ses_IP, ses_AdditionalInfo, + ses_EventTypeDisconnection, ses_DateTimeDisconnection, ses_IP, ses_AdditionalInfo, ses_StillConnected, CASE WHEN ses_EventTypeConnection = "" THEN @@ -356,10 +358,12 @@ function getEventsCalendar() { while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { // Event color if ($row['ses_EventTypeConnection'] == '' || $row['ses_EventTypeDisconnection'] == '') { - $color = '#f39c12'; - } else { - $color = '#0073b7'; - } + $color = '#f39c12'; + } elseif ($row['ses_StillConnected'] == 1 ) { + $color = '#00a659'; + } else { + $color = '#0073b7'; + } // tooltip $tooltip = 'Connection: ' . formatEventDate ($row['ses_DateTimeConnection'], $row['ses_EventTypeConnection']) . chr(13) .