From 47a5f71d9bfa3d1ff197a8864080f937169d9c6d Mon Sep 17 00:00:00 2001 From: GamerClassN7 Date: Tue, 5 Jan 2021 21:35:12 +0100 Subject: [PATCH] Tweeks --- app/views/Device.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/views/Device.php b/app/views/Device.php index 9b790e8..6a3cd71 100644 --- a/app/views/Device.php +++ b/app/views/Device.php @@ -5,6 +5,21 @@ class Device extends Template { function __construct($sortBy = null, $sortType = null) { + // //Notification data setup + // $notificationMng = new NotificationManager; + // $notificationData = [ + // 'title' => 'Info', + // 'body' => 'New device Detected Found', + // 'icon' => BASEDIR . '/app/templates/images/icon-192x192.png', + // ]; + // //Notification for newly added Device + // if ($notificationData != []) { + // $subscribers = $notificationMng::getSubscription(); + // foreach ($subscribers as $key => $subscriber) { + // $notificationMng::sendSimpleNotification(SERVERKEY, $subscriber['token'], $notificationData); + // } + // } + $userManager = new UserManager(); $deviceManager = new DeviceManager(); $subDeviceManager = new SubDeviceManager(); @@ -54,8 +69,8 @@ class Device extends Template //Signal Stenght $subdevice = $subDeviceManager->getSubDeviceByMasterAndType($device['device_id'], "wifi"); $subdeviceLocal = $subDeviceManager->getSubDeviceByMaster($device['device_id']); - if (!empty ($subdeviceLocal)) { - $devices[$key]['history'] = (!empty ($subdeviceLocal['history']) ? $subdeviceLocal['history'] : 0); + if (!empty($subdeviceLocal)) { + $devices[$key]['history'] = (!empty($subdeviceLocal['history']) ? $subdeviceLocal['history'] : 0); } else { $devices[$key]['history'] = "null"; }