summaryrefslogtreecommitdiff
path: root/app/planner/index.php
blob: b2070daeab2d48955a45d74fe70f4e3561bf5e95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); ?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Planner</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <style>
        body {
            background-color: black !important;
            color: white;
        }

        .alert, .alert .btn, .alert code {
            filter: hue-rotate(180deg);
        }

        .alert {
            filter: invert(1) hue-rotate(180deg);
        }

        .member-link {
            color: white !important;
            text-decoration: none !important;
        }
    </style>
</head>
<body>
    <div class="container">
        <br>
        <?php

        require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.php";
        require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.php";

        function getMiniName(string $name) {
            $parts = explode(" ", $name);

            if (strlen($parts[0]) > 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly") {
                if (str_contains($parts[0], "/")) {
                    return explode("/", $parts[0])[0];
                } else {
                    return $parts[0];
                }
            } else {
                return $name;
            }
        }

        function getSystemMember(string $system, string $id) {
            $systemID = $system;

            $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true);
            $member = null;

            foreach ($members as $m) {
                if ($m["id"] === $id) $member = $m;
            }

            return $member;
        }

        require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/planner.php"; ?>
    </div>
</body>
</html>