aboutsummaryrefslogtreecommitdiff
path: root/app/views/course/dates/export.php
blob: d95a68b2f8aa9807afeabc8ff63053183ea9f35f (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
70
71
72
73
74
75
76
77
78
79
<?php
/**
 * @var array<int, array{date: string, description: string, type: string, start: int, groups: Statusgruppen[], related_persons: User[]}> $dates
 * @var int $lecturer_count
 * @var int $group_count
 */
?>
<html>
<head>
    <title><?= htmlReady(PageLayout::getTitle())?></title>
</head>
<body>

<? if (count($dates) > 0) : ?>
    <table cellspacing="0" cellpadding="0" border="1" width="100%">

        <tr>
            <th colspan="5">
                <h2><?= htmlReady(PageLayout::getTitle())?></h2>
            </th>
        </tr>

        <?
        $all_semester = Semester::findAllVisible(false);

        $grenze = 0;
        foreach ($dates as $date) :
            if ( ($grenze == 0) || ($grenze < $date['start']) ) {
                foreach ($all_semester as $zwsem) {
                    if (!empty($zwsem['beginn'])) {
                        if ( ($zwsem['beginn'] < $date['start']) && ($zwsem['ende'] > $date['start']) ) {
                            $grenze = $zwsem['ende'] ?? null;
                            ?>
                            <tr>
                                <td colspan="5">
                                    <h3><?= htmlReady($zwsem['name']) ?></h3>
                                </td>
                            </tr>
                        <?
                        }
                    }
                }
            }
            ?>
            <tr>
                <td width="20%">
                    <?= htmlReady($date['date']) ?> (<?= htmlReady($date['type']) ?>)
                </td>
                <td width="20%"><?= htmlReady($date['title']) ?></td>
                <td width="20%">
                    <? if (count($date['related_persons']) != $lecturer_count) : ?>
                        <? foreach ($date['related_persons'] as $key => $user) {
                            echo ($key > 0 ? ", " : "").htmlReady($user->getFullName());
                        } ?>
                    <? endif ?>
                </td>
                <td width="20%">
                    <? if (count($date['groups']) && count($date['groups']) < $group_count) : ?>
                        <? foreach ($date['groups'] as $key => $statusgruppe) {
                            echo ($key > 0 ? ", " : "").htmlReady($statusgruppe->name);
                        } ?>
                    <? else : ?>
                        <?= _('alle') ?>
                    <? endif ?>
                </td>
                <td width="20%"><?= htmlReady($date['room']) ?></td>
            </tr>
            <? if ($date['description']) : ?>
            <tr>
                <td>&nbsp;</td>
                <td colspan="3"><?= formatReady($date['description'])?></td>
            </tr>
        <? endif ?>
        <? endforeach ?>

    </table>
<? endif ?>
</body>
</html>