diff options
Diffstat (limited to 'pages/schedules.inc')
-rw-r--r-- | pages/schedules.inc | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/pages/schedules.inc b/pages/schedules.inc index 04081fe..55f7670 100644 --- a/pages/schedules.inc +++ b/pages/schedules.inc @@ -3,9 +3,6 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages; global $app; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $readOnly; global $isNormallyLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/composer/vendor/autoload.php'; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/composer/ical/ical.php"; - ?> <style> @@ -49,29 +46,6 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/composer/ical/ical.php"; <h3 id="live-time-other">--:--</h3> </div> - <!--<?php - - $weekDay = (int)date('N'); - - if ($weekDay < 6 && !in_array(date('Y-m-d'), $app["other"]["work"]["off"])) { - $start = ($app["other"]["work"]["start"][0] * 3600) + ($app["other"]["work"]["start"][1] * 60); - $end = ($app["other"]["work"]["end"][0] * 3600) + ($app["other"]["work"]["end"][1] * 60); - $parts = explode("|", (new DateTime("now", new DateTimeZone("America/Chicago")))->format("H|i")); - $now = ((int)$parts[0] * 3600) + ((int)$parts[1] * 60); - - if ($start < $now && $now < $end) { - echo('<div class="alert alert-warning"><p><b><span class="invert">🗄️</span> Currently at work</b></p>Started ' . timeAgo($now - $start, false, true, true) . '<br>Finishing ' . timeIn($end - $now, true) . '</div>'); - } elseif ($now > $end) { - echo('<div class="alert alert-success"><b><span class="invert">🎉</span> Finally off work!</b></div>'); - } elseif ($now < $start) { - echo('<div class="alert alert-warning"><p><b><span class="invert">🗄️</span> There\'s work today</b></p>Starting ' . timeIn($start - $now, true) . '<br>Working for ' . timeAgo($end - $start, false, true, true, false) . '</div>'); - } - } else { - echo('<div class="alert alert-success"><b><span class="invert">🎉</span> No work today!</b></div>'); - } - - ?>--> - <hr style="display: none;" class="schedules-separator"> </div> @@ -81,33 +55,6 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/composer/ical/ical.php"; <h3 id="live-time-cloudburst">--:--</h3> </div> - <!--<?php - - $calendar = new \om\IcalParser(); - $calendar->parseFile($_SERVER['DOCUMENT_ROOT'] . "/includes/data/calendar.ics"); - - $college = array_values(array_filter((array)$calendar->getEvents()->sorted(), function ($i) { - return strtotime(((array)$i["DTEND"])["date"]) > time() && date('Y-m-d', strtotime(((array)$i["DTEND"])["date"])) === date('Y-m-d') && trim(strtolower($i["SUMMARY"])) === "(cloudburst) college"; - })); - - if (count($college) > 0) { - $start = strtotime(((array)$college[0]["DTSTART"])["date"]); - $end = strtotime(((array)$college[0]["DTEND"])["date"]); - $now = time(); - - if ($start < $now && $now < $end) { - echo('<div class="alert alert-warning"><p><b><span class="invert">🏫️</span> Currently in college</b></p>Started ' . timeAgo($now - $start, false, true, true) . '<br>Finishing ' . timeIn($end - $now, true) . '</div>'); - } elseif ($now > $end) { - echo('<div class="alert alert-success"><b><span class="invert">🎉</span> Finally out of college!</b></div>'); - } elseif ($now < $start) { - echo('<div class="alert alert-warning"><p><b><span class="invert">🏫️</span> Getting ready for college</b></p>Starting ' . timeIn($start - $now, true) . '<br>In college for ' . timeAgo($end - $start, false, true, true, false) . '</div>'); - } - } else { - echo('<div class="alert alert-success"><b><span class="invert">🎉</span> No college today!</b></div>'); - } - - ?>--> - <hr style="display: none;" class="schedules-separator"> </div> @@ -116,32 +63,6 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/composer/ical/ical.php"; <b>Raindrops System</b><br> <h3 id="live-time-raindrops">--:--</h3> </div> - - <!--<?php - - $school = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/school.json"), true); - - if (isset($school[date('Y-m-d')])) { - $today = $school[date('Y-m-d')]; - - if (count($college) > 0) { - $start = $today["firstClass"]["timestamp"] / 1000; - $end = strtotime($today["end"]); - $now = time(); - - if ($start < $now && $now < $end) { - echo('<div class="alert alert-warning"><p><b><span class="invert">🎓️</span> Currently in school</b></p>Started ' . timeAgo($now - $start, false, true, true) . '<br>Finishing ' . timeIn($end - $now, true) . '</div>'); - } elseif ($now > $end) { - echo('<div class="alert alert-success"><b><span class="invert">🎉</span> Finally out of school!</b></div>'); - } elseif ($now < $start) { - echo('<div class="alert alert-warning"><p><b><span class="invert">🎓️</span> Getting ready for school</b></p>Starting ' . timeIn($start - $now, true) . '<br>In school for ' . timeAgo($end - $start, false, true, true, false) . '</div>'); - } - } else { - echo('<div class="alert alert-success"><b><span class="invert">🎉</span> No school today!</b></div>'); - } - } - - ?>--> </div> </div> </div> |