summaryrefslogtreecommitdiff
path: root/school/index.php
blob: 77f6f9bf4c87303922f0ef7564359df589faafd7 (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
<?php

$title = "Établissement et compte";

require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";

$data = data_params()["data"]["params"];
$user = data_user()["data"]["user"];

global $_userID;
global $_name;

?>

<div class="container"><br><h2><?= $title ?></h2></div>

<div class="container">
    <p><i>Année scolaire <?= $data["schoolYear"] ?></i></p>

    <?php foreach ($user["establishmentsInfo"] as $establishment): ?>
    <b>
        <?= $establishment["name"] ?><br>
    </b>
    <p>
        <?= $establishment["address"][0] ?>
        <?= trim($establishment["address"][1]) !== "" ? "<br>" . $establishment["address"][1] : "" ?><br>
        <?= $establishment["postalCode"] ?> <?= $establishment["postalLabel"] ?> <?= $establishment["city"] ?><br>
        <?= trim($establishment["province"]) !== "" ? $establishment["province"] . ", " : "" ?><?= $establishment["country"] ?>
        <?= trim($establishment["website"]) !== "" ? "<br><a href='https://$establishment[website]'>" . $establishment["website"] . "</a>" : "" ?>
    </p>
    <?php endforeach; ?>

    <b>
        <?= $_name ?>
    </b>
    <p>
        Classes : <?= implode(", ", $user["studentClass"]) ?><br>
        Groupes : <?= implode(", ", array_map(function ($i) {
            return $i["name"];
        }, $user["groups"])) ?><br>
        Identifiant Nots : <code><?= $_userID ?></code>
    </p>
</div>

<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/footer.php"; ?>