From 45486dece3efa0af8d0d426898b6b191672f02fb Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Wed, 7 Jun 2023 19:11:33 +0200 Subject: Updated includes/components/planner.inc (automated) --- includes/components/planner.inc | 1746 ++++++++++++++++++++------------------- 1 file changed, 876 insertions(+), 870 deletions(-) (limited to 'includes') diff --git a/includes/components/planner.inc b/includes/components/planner.inc index 37687a3..f005f52 100644 --- a/includes/components/planner.inc +++ b/includes/components/planner.inc @@ -1,157 +1,158 @@ - + "; + } - if (isset($metadata["pacifier"]) && $metadata["pacifier"] && !$isLowerLoggedIn) { - return ""; - } + if (isset($metadata["sleep_plush"]) && $metadata["sleep_plush"] && !$isLowerLoggedIn) { + return ""; + } - if (isset($metadata["sleep_plush"]) && $metadata["sleep_plush"] && !$isLowerLoggedIn) { - return ""; + return ""; } - return ""; -} - -foreach ($cloudburst as $id => $day) { - foreach ($day as $index => $fronter) { - if (is_string($fronter)) { - $cloudburst[$id][$index] = [$fronter]; - } else if (is_array($fronter)) { - if (count($fronter) < 2) { - if (!isset($cloudburst[$id][$index][0])) $cloudburst[$id][$index][0] = null; - $cloudburst[$id][$index][1] = null; - } else if (count($fronter) > 2) { - $array = []; - - if (isset($cloudburst[$id][$index][0])) { - $array[0] = $cloudburst[$id][$index][0]; - } else { - $array[0] = null; - } + foreach ($cloudburst as $id => $day) { + foreach ($day as $index => $fronter) { + if (is_string($fronter)) { + $cloudburst[$id][$index] = [$fronter]; + } else if (is_array($fronter)) { + if (count($fronter) < 2) { + if (!isset($cloudburst[$id][$index][0])) $cloudburst[$id][$index][0] = null; + $cloudburst[$id][$index][1] = null; + } else if (count($fronter) > 2) { + $array = []; - if (isset($cloudburst[$id][$index][1])) { - $array[1] = $cloudburst[$id][$index][1]; - } else { - $array[1] = null; - } + if (isset($cloudburst[$id][$index][0])) { + $array[0] = $cloudburst[$id][$index][0]; + } else { + $array[0] = null; + } + + if (isset($cloudburst[$id][$index][1])) { + $array[1] = $cloudburst[$id][$index][1]; + } else { + $array[1] = null; + } - $cloudburst[$id][$index] = $array; + $cloudburst[$id][$index] = $array; + } } } } -} - -foreach ($raindrops as $id => $day) { - foreach ($day as $index => $fronter) { - if (is_string($fronter)) { - $raindrops[$id][$index] = [$fronter]; - } else if (is_array($fronter)) { - if (count($fronter) < 2) { - if (!isset($raindrops[$id][$index][0])) $raindrops[$id][$index][0] = null; - $raindrops[$id][$index][1] = null; - } else if (count($fronter) > 2) { - $array = []; - - if (isset($raindrops[$id][$index][0])) { - $array[0] = $raindrops[$id][$index][0]; - } else { - $array[0] = null; - } - if (isset($raindrops[$id][$index][1])) { - $array[1] = $raindrops[$id][$index][1]; - } else { - $array[1] = null; - } + foreach ($raindrops as $id => $day) { + foreach ($day as $index => $fronter) { + if (is_string($fronter)) { + $raindrops[$id][$index] = [$fronter]; + } else if (is_array($fronter)) { + if (count($fronter) < 2) { + if (!isset($raindrops[$id][$index][0])) $raindrops[$id][$index][0] = null; + $raindrops[$id][$index][1] = null; + } else if (count($fronter) > 2) { + $array = []; + + if (isset($raindrops[$id][$index][0])) { + $array[0] = $raindrops[$id][$index][0]; + } else { + $array[0] = null; + } + + if (isset($raindrops[$id][$index][1])) { + $array[1] = $raindrops[$id][$index][1]; + } else { + $array[1] = null; + } - $raindrops[$id][$index] = $array; + $raindrops[$id][$index] = $array; + } } } } -} -$school = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/school.json"), true); + $school = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/school.json"), true); -function formatTime($time) { - if ($time === "0:00") return "midnight"; - if ($time === "12:00") return "noon"; + function formatTime($time) { + if ($time === "0:00") return "midnight"; + if ($time === "12:00") return "noon"; - $parts = explode(":", $time); - $hours = (int)$parts[0]; - $ampm = ""; + $parts = explode(":", $time); + $hours = (int)$parts[0]; + $ampm = ""; - if ($hours === 0 || $hours === 12) { - $ampm = ($hours === 0 ? "am" : "pm"); - $hours = 12; - } else { - if ($hours > 12) { - $ampm = "pm"; - $hours = $hours - 12; + if ($hours === 0 || $hours === 12) { + $ampm = ($hours === 0 ? "am" : "pm"); + $hours = 12; } else { - $ampm = "am"; + if ($hours > 12) { + $ampm = "pm"; + $hours = $hours - 12; + } else { + $ampm = "am"; + } } - } - if ((int)$parts[1] > 0) { - return $hours . ":" . $parts[1] . $ampm; - } else { - return $hours . $ampm; + if ((int)$parts[1] > 0) { + return $hours . ":" . $parts[1] . $ampm; + } else { + return $hours . $ampm; + } } -} -function school($time, $first = false) { - global $school; - global $_PROFILE; - global $isLowerLoggedIn; + function school($time, $first = false) { + global $school; + global $_PROFILE; + global $isLowerLoggedIn; - $day = date('Y-m-d', $time); - $parts = []; + $day = date('Y-m-d', $time); + $parts = []; - if (isset($school[$day])) { - if (isset($school[$day]["wakeUp"]["timestamp"])) { - $parts[] = "waking up at " . formatTime($school[$day]["wakeUp"][$_PROFILE["login"]]); - } + if (isset($school[$day])) { + if (isset($school[$day]["wakeUp"]["timestamp"])) { + $parts[] = "waking up at " . formatTime($school[$day]["wakeUp"][$_PROFILE["login"]]); + } - if (isset($school[$day]["sleep"]["timestamp"])) { - $parts[] = "sleeping at " . formatTime($school[$day]["sleep"][$_PROFILE["login"]]); + if (isset($school[$day]["sleep"]["timestamp"])) { + $parts[] = "sleeping at " . formatTime($school[$day]["sleep"][$_PROFILE["login"]]); + } } - } - if ($isLowerLoggedIn) $parts = []; + if ($isLowerLoggedIn) $parts = []; - if (count($parts) > 0) { - if ($first) { - return ucfirst(implode(", ", $parts)); - } else { - return "
" . ucfirst(implode(", ", $parts)); - } - } else { - if ($first) { - return "-"; + if (count($parts) > 0) { + if ($first) { + return ucfirst(implode(", ", $parts)); + } else { + return "
" . ucfirst(implode(", ", $parts)); + } } else { - return ""; + if ($first) { + return "-"; + } else { + return ""; + } } } -} -function day($display, $diff): void { if ($diff < 0) $disabled = true; else $disabled = false; global $cloudburst; global $raindrops; global $isLowerLoggedIn; ?> + function day($display, $diff): void { if ($diff < 0) $disabled = true; else $disabled = false; global $cloudburst; global $raindrops; global $isLowerLoggedIn; ?> - style="opacity: .75; pointer-events: none;"> - -
- - - - style="opacity: .75; pointer-events: none;"> - Cloudburst System - Raindrops System - - - style="opacity: .75; pointer-events: none;"> - - - - - colspan="3" colspan="2"> - - - Multiple merged members - - Other/unknown/fallback pony - - " style="width:24px;"> - - - - - - - - - - - + style="opacity: .75; pointer-events: none;"> + +
+ + + + style="opacity: .75; pointer-events: none;"> + Cloudburst System + Raindrops System + + + style="opacity: .75; pointer-events: none;"> + + + + + colspan="3" colspan="2"> + - Multiple merged members + Multiple merged members - Other/unknown/fallback pony + Other/unknown/fallback pony - " style="width:24px;"> + " style="width:24px;"> - - - - - - - - - - - - - - - - colspan="3" colspan="2"> - - Multiple merged members - - Other/unknown/fallback pony + + + + + + - " style="width:24px;"> + + + + Multiple merged members + + Other/unknown/fallback pony + + " style="width:24px;"> + + - - - - - - - - - - + + + + + + + + + + + + + + + colspan="3" colspan="2"> - Multiple merged members + Multiple merged members - Other/unknown/fallback pony + Other/unknown/fallback pony - " style="width:24px;"> + " style="width:24px;"> + + + + + + + + + + + Multiple merged members + + Other/unknown/fallback pony + + " style="width:24px;"> + + + + + + + + + + + - - - - - - - - - + + + style="opacity: .75; pointer-events: none;"> + +
+ 0 && count($dayRaindrops) > 0): ?> + will sleep with + + + +
+ - - style="opacity: .75; pointer-events: none;"> - -
- 0 && count($dayRaindrops) > 0): ?> - will sleep with - - - -
- - - - - - + .planner-add-link-cofronter-inner { + border-radius: 100%; + width: max-content; + margin-left: auto; + margin-right: auto; + } -

Front planner

- - - + +

Front planner

+
+ + - -
- - - - window.fetch("/api/fronter?t=top&d=" + window.selectedFronting["date"] + "&i=" + window.selectedFronting["index"] + "&s=" + window.selectedFronting["system"]).then(() => { - location.reload(); - }); - } - +