diff options
Diffstat (limited to 'includes/subsysbanner.php')
-rw-r--r-- | includes/subsysbanner.php | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/includes/subsysbanner.php b/includes/subsysbanner.php new file mode 100644 index 0000000..be06b06 --- /dev/null +++ b/includes/subsysbanner.php @@ -0,0 +1,68 @@ +<?php + +global $memberData; +global $memberCommonName; +global $memberID; +global $systemCommonName; +global $systemID; +global $system; +global $subsystemData; +global $subsystemID; +global $subsystem; + +$fronters = array_map(function ($item) { + return $item["id"]; +}, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-fronters.json"), true)["members"]); + +?> + +<div id="system-info" style="background:rgba(255, 255, 255, .1);border-radius:10px;display:grid;grid-template-columns: 128px 1fr;"> + <img src="/assets/uploads/ss-<?= $subsystemID ?>.png" alt="" style="height:128px;border-top-left-radius:10px;border-bottom-left-radius:10px;"> + <div style="padding:10px 10px 10px 20px;text-align:center;"> + <div style="display: grid; grid-template-columns: 1fr;height:100%;grid-template-rows: max-content max-content 1fr;"> + <h3 style="height:max-content;"><?= $subsystemData["name"] ?></h3> + <div style="height:max-content;display:grid;grid-template-columns: repeat(4, 1fr);" id="member-card"> + <span> + <b>Current Fronter:</b> + <?php if (in_array($fronters[0], getSubsystemByID($subsystemID)["members"])): $member = getMember($fronters[0]); ?> + <a class="member-link" href="/<?= $system ?>/<?= $member["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member['name'] . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a> + <?php else: ?> + <span class="text-muted">N/A</span> + <?php endif; ?> + </span> + <span> + <?php + + $arr = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-switches.json"), true), function ($i) use ($subsystemID) { + return in_array($i["members"][0], getSubsystemByID($subsystemID)["members"]); + }); + sort($arr); + $previousID = $arr[in_array($fronters[0], getSubsystemByID($subsystemID)["members"]) ? 1 : 0]["members"][0]; + $member = null; + + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true) as $members) { + if ($members["id"] === $previousID) { + $member = $members; + break; + } + } + + ?> + <b>Previous Fronter: </b><a class="member-link" href="/<?= $system ?>/<?= $member["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member['name'] . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a> + </span> + <span> + <b>Members:</b> <?= count(getSubsystemByID($subsystemID)["members"]) ?> + </span> + <span> + <b>Parent System:</b> <a class="member-link" href="/<?= $system ?>"><img style="width:24px;border-radius:5px;" src="/assets/uploads/<?= $system ?>.png"> <?= getMiniName($systemCommonName) ?></a> + </span> + </div> + </div> + </div> +</div> + +<div id="system-actions" style="margin-top:10px;padding:5px 10px;background:rgba(255, 255, 255, .1);border-radius:10px;"> + <div style="padding: 5px 10px;text-align: center;"> + You are viewing the page of a subsystem of the <b><a style="color:white;text-decoration: none;" href="/<?= $system ?>"><?= $systemCommonName ?></a></b>. + </div> +</div>
\ No newline at end of file |