aboutsummaryrefslogtreecommitdiff
path: root/app/views/room_management/planning/booking_comments.php
blob: 5f497f7df7db38cd68a82d8ef0e1325377f1b73a (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<? if ($data): ?>
    <table class="default" <?= $standalone ? 'style="border: 1px solid black; border-collapse: collapse;"' : '' ?>>
        <thead>
            <tr>
                <th <?= $standalone ? 'style="border: 1px solid black; width: 12.5%;"' : '' ?>>
                    <?= htmlReady(
                        sprintf(
                            _('%d. Kalenderwoche'),
                            $date->format('W')
                        )
                    ) ?>
                </th>
                <th <?= $standalone ? 'style="border: 1px solid black; width: 12.5%;"' : '' ?>>
                    <?= _('Montag') ?>
                    <div>
                        <?= date(
                            'd.m.Y',
                            strtotime('this week monday', $date->getTimestamp())
                        ) ?>
                    </div>
                </th>
                <th <?= $standalone ? 'style="border: 1px solid black; width: 12.5%;"' : '' ?>>
                    <?= _('Dienstag') ?>
                    <div>
                        <?= date(
                            'd.m.Y',
                            strtotime('this week tuesday', $date->getTimestamp())
                        ) ?>
                    </div>
                </th>
                <th <?= $standalone ? 'style="border: 1px solid black; width: 12.5%;"' : '' ?>>
                    <?= _('Mittwoch') ?>
                    <div>
                        <?= date(
                            'd.m.Y',
                            strtotime('this week wednesday', $date->getTimestamp())
                        ) ?>
                    </div>
                </th>
                <th <?= $standalone ? 'style="border: 1px solid black; width: 12.5%;"' : '' ?>>
                    <?= _('Donnerstag') ?>
                    <div>
                        <?= date(
                            'd.m.Y',
                            strtotime('this week thursday', $date->getTimestamp())
                        ) ?>
                    </div>
                </th>
                <th <?= $standalone ? 'style="border: 1px solid black; width: 12.5%;"' : '' ?>>
                    <?= _('Freitag') ?>
                    <div>
                        <?= date(
                            'd.m.Y',
                            strtotime('this week friday', $date->getTimestamp())
                        ) ?>
                    </div>
                </th>
                <th <?= $standalone ? 'style="border: 1px solid black; width: 12.5%;"' : '' ?>>
                    <?= _('Samstag') ?>
                    <div>
                        <?= date(
                            'd.m.Y',
                            strtotime('this week saturday', $date->getTimestamp())
                        ) ?>
                    </div>
                </th>
                <th <?= $standalone ? 'style="border: 1px solid black; width: 12.5%;"' : '' ?>>
                    <?= _('Sonntag') ?>
                    <div>
                        <?= date(
                            'd.m.Y',
                            strtotime('this week sunday', $date->getTimestamp())
                        ) ?>
                    </div>
                </th>
            </tr>
        </thead>
        <tbody>
            <? foreach ($data as $row): ?>
                <tr>
                    <? foreach ($row as $i => $cell): ?>
                        <? if ($i == 0): ?>
                            <td <?= $standalone
                                  ? 'style="border: 1px solid black; min-height: 60px; height: 60px;"'
                                  : '' ?>>
                                <?= htmlReady($cell) ?>
                            </td>
                        <? else: ?>
                            <td <?= $standalone
                                  ? 'style="border: 1px solid black; min-height: 60px; height: 60px;"'
                                  : '' ?>>
                                <? if ($cell): ?>
                                    <? foreach ($cell as $day_item): ?>
                                        <div <?= $standalone
                                               ? 'style="margin-bottom: 1em;"'
                                               : '' ?>>
                                            <div>
                                                <strong>
                                                    <?= htmlReady($day_item[0]) ?>
                                                </strong>
                                            </div>
                                            <?= htmlReady($day_item[1]) ?>
                                        </div>
                                    <? endforeach ?>
                                <? endif ?>
                            </td>
                        <? endif ?>
                    <? endforeach ?>
                </tr>
            <? endforeach ?>
        </tbody>
    </table>
<? else: ?>
    <? if ($standalone): ?>
        <p>
            <?= sprintf(
                _('In der %d. Kalenderwoche sind keine Buchungen vorhanden!'),
                $date->format('W')
            ) ?>
        </p>
    <? else: ?>
        <?= MessageBox::info(
            sprintf(
                _('In der %d. Kalenderwoche sind keine Buchungen vorhanden!'),
                $date->format('W')
            )
        ) ?>
    <? endif ?>
<? endif ?>