summaryrefslogtreecommitdiff
path: root/includes/system/history.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/system/history.inc')
-rw-r--r--includes/system/history.inc11
1 files changed, 8 insertions, 3 deletions
diff --git a/includes/system/history.inc b/includes/system/history.inc
index ee7f762..5905276 100644
--- a/includes/system/history.inc
+++ b/includes/system/history.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $lang; global $pages; global $systemCommonName; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:history"]["name"][$lang["_name"]] . " · " . $systemCommonName; global $systemID; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+<?php global $system; global $lang; global $pages; global $systemCommonName; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:history"]["name"][$lang["_name"]] . " · " . $systemCommonName; global $systemID; global $app; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
function getMember(string $id) {
global $systemID;
@@ -109,7 +109,7 @@ function getMember(string $id) {
}
?>
- <h2><?= $lang["history"]["title"] ?> <?= $systemCommonName ?></h2>
+ <h2><?= $systemID === $app["other"]["id"] ? "Front history in " . $app["other"]["name"] : $lang["history"]["title"] . " " . $systemCommonName ?></h2>
<div class="alert alert-warning" id="timezone" style="display: none;">
<?= str_replace("%1", '<span id="timezone-name">-</span>', str_replace("%2", '<span id="day-start">-</span>', $lang["history"]["timezone"])) ?>
<script>
@@ -130,9 +130,14 @@ function getMember(string $id) {
[ date('D j M', time() - (86400 * 9)), 9 ],
] as $day):
$switchesDay = getSwitchesForDay($day[1]);
- $switchesDay[] = getSwitchBefore($switchesDay[count($switchesDay) - 1]["id"]);
+ if (isset($switchesDay[count($switchesDay) - 1])) {
+ $switchesDay[] = getSwitchBefore($switchesDay[count($switchesDay) - 1]["id"]);
+ }
?>
<h4 style="margin-top:15px;"><?= frenchIfRequired($day[0]) ?></h4>
+ <?php if (count($switchesDay) === 0): ?>
+ <p class="text-muted">No switches happened on that day</p>
+ <?php endif; ?>
<?php foreach ($switchesDay as $switch): $switch["timestamp"] = strtotime($switch["timestamp"]); ?>
<?php if (isset($switch["members"][0])): $member = getMemberWithoutSystem($switch["members"][0]); ?>
<div class="fronter">