From 108525534c28013cfe1897c30e4565f9893f3766 Mon Sep 17 00:00:00 2001 From: Minteck Date: Mon, 10 Oct 2022 20:51:39 +0200 Subject: Update --- pages/dashboard.inc | 231 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 pages/dashboard.inc (limited to 'pages/dashboard.inc') diff --git a/pages/dashboard.inc b/pages/dashboard.inc new file mode 100644 index 0000000..59396e5 --- /dev/null +++ b/pages/dashboard.inc @@ -0,0 +1,231 @@ + + +
+
+
+

Date

+ + +
+

Next fronters (edit)

+ + +
Fronters today
+
    + $id): $member = getMemberWithoutSystem($id[0]); ?> +
  • + + Merged members + + " style="width:24px; height: 24px; vertical-align: middle;"> + + + and " style="width:24px; height: 24px; vertical-align: middle;"> + + with " style="width:24px; height: 24px; vertical-align: middle;"> + and " style="width:24px; height: 24px; vertical-align: middle;"> + +
  • + +
+ +
Fronters tomorrow
+
    + $id): $member = getSystemMember($_PROFILE["login"] === "raindrops" ? "gdapd" : "ynmuc", $id[0]); ?> +
  • + + Merged members + + " style="width:24px; height: 24px; vertical-align: middle;"> + + + and " style="width:24px; height: 24px; vertical-align: middle;"> + + with " style="width:24px; height: 24px; vertical-align: middle;"> + and " style="width:24px; height: 24px; vertical-align: middle;"> + +
  • + +
+ +
Fronters on
+
    + $id): $member = getSystemMember($_PROFILE["login"] === "raindrops" ? "gdapd" : "ynmuc", $id[0]); ?> +
  • + + Merged members + + " style="width:24px; height: 24px; vertical-align: middle;"> + + + and " style="width:24px; height: 24px; vertical-align: middle;"> + + with " style="width:24px; height: 24px; vertical-align: middle;"> + and " style="width:24px; height: 24px; vertical-align: middle;"> + +
  • + +
+ +
+

Next events

+ parseFile($_SERVER['DOCUMENT_ROOT'] . "/includes/data/calendar/calendar.ics"); + $events = []; + + foreach ($cal->getEvents()->sorted() as $event) { + $events[] = [ + "id" => $event['UID'], + "date" => [ + "created" => $event['CREATED']->format('c'), + "modified" => $event['LAST-MODIFIED']->format('c'), + "start" => $event['DTSTART']->format('c'), + "end" => $event['DTEND']->format('c'), + "duration" => strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c')), + "full_day" => strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c')) >= 86400, + "days" => ( + strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c')) >= 86400 ? + round((strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c'))) / 86400) : + null + ) + ], + "name" => $event['SUMMARY'], + "description" => $event['DESCRIPTION'] ?? "", + ]; + } + + $events = array_values(array_filter($events, function ($i) { + return ( + strtotime($i["date"]["end"]) > time() && + strtotime($i["date"]["start"]) < time() + 2629800 + ); + })); + + ?> +
    + +
  • + + + + Started , ends + + + + · + + + + + · + + + for + · + +
  • + +
+
+
+ + -- cgit