From a2df9a69dcc14cb70118cda2ded499055e7ee358 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 21 Aug 2022 17:31:56 +0200 Subject: m. update --- includes/system/history.php | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) (limited to 'includes/system/history.php') diff --git a/includes/system/history.php b/includes/system/history.php index ad4e30e..8483e3a 100644 --- a/includes/system/history.php +++ b/includes/system/history.php @@ -21,7 +21,11 @@ function getMember(string $id) { $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-switches.json"), true); uksort($switches, function ($a, $b) { - return strtotime($b["timestamp"]) - strtotime($a["timestamp"]); + if (isset($b["timestamp"]) && isset($a["timestamp"])) { + return strtotime($b["timestamp"]) - strtotime($a["timestamp"]); + } else { + return null; + } }); function getSwitchesForDay(int $day) { @@ -33,7 +37,11 @@ function getMember(string $id) { })); uksort($filtered, function ($a, $b) { - return strtotime($b["timestamp"]) - strtotime($a["timestamp"]); + if (isset($b["timestamp"]) && isset($a["timestamp"])) { + return strtotime($b["timestamp"]) - strtotime($a["timestamp"]); + } else { + return null; + } }); return $filtered; @@ -80,6 +88,13 @@ function getMember(string $id) { ?>

Front history in the

+

Today

- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -130,7 +145,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -160,7 +175,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -190,7 +205,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -220,7 +235,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -250,7 +265,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -280,7 +295,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -310,7 +325,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -340,7 +355,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -365,7 +380,7 @@ function getMember(string $id) { foreach ($fronters as $fronter): $member = getMember($fronter["member"]); ?>
- + " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -376,5 +391,9 @@ function getMember(string $id) {
+ \ No newline at end of file -- cgit