(86400 * ($day - 1));
}));
uksort($filtered, function ($a, $b) {
if (isset($b["timestamp"]) && isset($a["timestamp"])) {
return strtotime($b["timestamp"]) - strtotime($a["timestamp"]);
} else {
return null;
}
});
return $filtered;
}
function getSwitchBefore(string $id) {
global $switches;
$currentPassed = false;
$before = null;
foreach ($switches as $switch) {
if ($currentPassed) {
$before = $switch;
break;
} else {
if ($switch["id"] === $id) {
$currentPassed = true;
}
}
}
return $before;
}
function isNotToday(int $timestamp, int $offset) {
if (date('Y-m-d', $timestamp) !== date('Y-m-d', time() - (86400 * $offset))) {
return true;
} else {
return false;
}
}
if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/history.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/history.json", "{}");
$cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/history.json"), true);
function page() { global $lang; global $systemCommonName; global $systemID; global $app; global $switches; global $isLoggedIn; global $isLowerLoggedIn; ?>
No switches happened on that day