diff --git a/functions.php b/functions.php index 9a36de2..02c79be 100644 --- a/functions.php +++ b/functions.php @@ -136,6 +136,14 @@ class LightStatus { } } + public function setClientLastSeen() { + $this->times['clientLastSeen'] = time(); + $this->saveTimes(); + } + public function getClientLastSeen() { + return $this->times['clientLastSeen']; + } + private function readTimes() { diff --git a/index.php b/index.php index a86ff43..31401e6 100644 --- a/index.php +++ b/index.php @@ -12,6 +12,9 @@ $light->update(); $error_string = ""; +$lastSeenTimeStr = date("H:i:s, Y-m-d",($light->getClientLastSeen())); +$lastSeenTimeDiff = (time()-$light->getClientLastSeen()); + // route actions if (isset($_GET['action'])) { if ($_GET['action'] == 'enlighten') { @@ -66,7 +69,7 @@ if (isset($_GET['action'])) { - +
@@ -103,6 +106,10 @@ if (isset($_GET['action'])) {