diff --git a/.idea/intellij-latte/xmlSources/Latte.dtd b/.idea/intellij-latte/xmlSources/Latte.dtd
index ab659787..0cf3a95a 100644
--- a/.idea/intellij-latte/xmlSources/Latte.dtd
+++ b/.idea/intellij-latte/xmlSources/Latte.dtd
@@ -8,7 +8,7 @@
-
+
diff --git a/.idea/intellij-latte/xmlSources/Latte.xml b/.idea/intellij-latte/xmlSources/Latte.xml
index 29502ee9..0bfceaf8 100644
--- a/.idea/intellij-latte/xmlSources/Latte.xml
+++ b/.idea/intellij-latte/xmlSources/Latte.xml
@@ -12,7 +12,7 @@
-
+
@@ -182,6 +182,11 @@
+
+
+
+
+
@@ -197,6 +202,7 @@
+
@@ -209,6 +215,7 @@
+
@@ -220,25 +227,25 @@
-
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
@@ -247,18 +254,37 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 87e2b003..04de3220 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,24 +2,12 @@
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -41,23 +29,34 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -145,7 +144,7 @@
-
+
@@ -193,6 +192,9 @@
+
+
+
1609201367814
@@ -374,6 +376,46 @@
282
+
+ file://$PROJECT_DIR$/app/CoreModule/Component/PletackaChartControl/PletackaChartControl.php
+ 276
+
+
+
+ file://$PROJECT_DIR$/app/CoreModule/Component/PletackaChartControl/PletackaChartControl.php
+ 40
+
+
+
+ file://$PROJECT_DIR$/app/CoreModule/Presenters/HomepagePresenter.php
+ 42
+
+
+
+ file://$PROJECT_DIR$/app/CoreModule/Component/ThisChartControl/ThisChartControl.php
+ 289
+
+
+
+ file://$PROJECT_DIR$/app/CoreModule/Component/ThisChartControl/ThisChartControl.php
+ 186
+
+
+
+ file://$PROJECT_DIR$/app/CoreModule/Model/ThisSensorManager.php
+ 88
+
+
+
+ file://$PROJECT_DIR$/app/CoreModule/Model/ThisSensorManager.php
+ 82
+
+
+
+ file://$PROJECT_DIR$/app/CoreModule/Model/ThisSensorManager.php
+ 97
+
+
diff --git a/app/CoreModule/Model/ThisSensorManager.php b/app/CoreModule/Model/ThisSensorManager.php
index d25deda2..5221482d 100755
--- a/app/CoreModule/Model/ThisSensorManager.php
+++ b/app/CoreModule/Model/ThisSensorManager.php
@@ -86,13 +86,16 @@ public function getAllEvents($sNumber, $from="2000-01-01 00:00:00" , $to="2100-0
public function sensorHasData($sNumber): bool
{
- return boolval($this->database->table("A".$sNumber)->fetch());
+ return boolval($this->database->table("A".$sNumber)->limit(1)->fetch());
}
public function getPreviousEvent($sNumber, $events)
{
- $previous = array_key_first($events)-1;
- return $this->database->table("A".$sNumber)->where("id =?",$previous)->fetch();
+ if(!$events) {
+ return false;
+ }
+ $previous = array_key_first($events)-1;
+ return $this->database->table("A".$sNumber)->where("id =?",$previous)->limit(1)->fetch();
}