From e95b208af90cc386a7d8d1bcab426727cf4f0121 Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 21 Sep 2022 22:42:33 +0200 Subject: Update time --- includes/planner.php | 614 +++++++++++++-------------------------------------- 1 file changed, 158 insertions(+), 456 deletions(-) (limited to 'includes/planner.php') diff --git a/includes/planner.php b/includes/planner.php index 64d87e4..8644b25 100644 --- a/includes/planner.php +++ b/includes/planner.php @@ -12,90 +12,18 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; $cloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-planner.json"), true); $raindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-planner.json"), true); -?> - -

Front planner

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +function day($display, $diff): void { global $cloudburst; global $raindrops; ?> + - + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

Front planner

+
Today
Cloudburst SystemRaindrops System
- - - -
- 0 && count($dayRaindrops) > 0): ?> - will sleep with - - Unable to calculate who will sleep with who - -
Tomorrow
0 && count($dayRaindrops) > 0): ?> - will sleep with + will sleep with Unable to calculate who will sleep with who
Cloudburst SystemRaindrops System
- - - -
- 0 && count($dayRaindrops) > 0): ?> - will sleep with - - Unable to calculate who will sleep with who - -
Cloudburst SystemRaindrops System
- - - -
- 0 && count($dayRaindrops) > 0): ?> - will sleep with - - Unable to calculate who will sleep with who - -
Cloudburst SystemRaindrops System
- - - -
- 0 && count($dayRaindrops) > 0): ?> - will sleep with - - Unable to calculate who will sleep with who - -
Cloudburst SystemRaindrops System
- - - -
- 0 && count($dayRaindrops) > 0): ?> - will sleep with - - Unable to calculate who will sleep with who - -
Cloudburst SystemRaindrops System
- - - -
- 0 && count($dayRaindrops) > 0): ?> - will sleep with - - Unable to calculate who will sleep with who - -
+ + + + + + + +
@@ -637,6 +232,20 @@ $raindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/include cursor: pointer !important; } + .merge-mobile { + display: none; + } + + @media (max-width: 768px) { + .merge-desktop { + display: none; + } + + .merge-mobile { + display: inline; + } + } + @@ -703,7 +312,12 @@ $raindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/include index: id } - document.getElementById("edit-fronter-name").innerText = names[fronting[system][date][id]] ?? fronting[system][date][id]; + if (fronting[system][date][id] === "lzlaq" || fronting[system][date][id] === "irxyh") { + document.getElementById("edit-fronter-name").innerText = "merged members"; + } else { + document.getElementById("edit-fronter-name").innerText = names[fronting[system][date][id]] ?? fronting[system][date][id]; + } + document.getElementById("edit-fronter-date").innerText = display; document.getElementById("edit-fronter-pos").innerText = ordinal(id + 1); document.getElementById("edit-fronter-system").innerText = system === "cloudburst" ? "Cloudburst System" : "Raindrops System"; @@ -756,11 +370,15 @@ $raindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/include window.currentWorkingDate = date; document.getElementById("new-fronter-date").innerText = display; document.getElementById("new-fronter-system").innerText = system === "cloudburst" ? "Cloudburst System" : "Raindrops System"; - document.getElementById("list-" + system).style.display = ""; - document.getElementById("list-" + (system === "cloudburst" ? "raindrops" : "cloudburst")).style.display = "none"; + window.addSystem = system === "raindrops" ? "gdapd" : "ynmuc"; + + document.getElementById("list").style.display = "block"; + document.getElementById("search-results").style.display = "none"; + document.getElementById("search").value = ""; let modal = new bootstrap.Modal(document.getElementById('new-fronter')); modal.show(); + document.getElementById("search").focus(); } function confirmFronterAdd(system, id) { @@ -799,6 +417,11 @@ $raindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/include }); } + function viewFronterPage() { + let id = fronting[window.selectedFronting["system"] === "ynmuc" ? "cloudburst" : "raindrops"][window.selectedFronting["date"]][window.selectedFronting["index"]]; + location.href = "/" + id; + } + function moveFronterUp() { Array.from(document.getElementsByClassName("edit-fronter-link")).forEach((i) => { i.classList.add("disabled"); @@ -812,7 +435,7 @@ $raindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/include } -