Commit ff6835f3 authored by Julien Ait azzouzene's avatar Julien Ait azzouzene
Browse files

🐛 fix: insert page break after 5 diving groups in security sheets

parent 1adc23c8
Loading
Loading
Loading
Loading
+37 −7
Original line number Diff line number Diff line
<page>
    <style>
        h1{
            text-align: center;
@@ -68,12 +69,12 @@
        </tr>
    </table>

@foreach ($divingGroups as $divingGroup)
    @php
    $groupNum = Str::substr($divingGroup['group']->DG_NUMBER, 2);
    $i = 0;
    @endphp

    <x-security-sheets.diving-group-table groupNum="{{$groupNum}}">
    @foreach ($divingGroups as $divingGroup)
        <x-security-sheets.diving-group-table groupNum="{{$divingGroup['group']->DG_NUMBER}}">
            <!-- Start and ending hours -->
            <tr>
                <td>Heure de départ</td>
@@ -85,17 +86,33 @@
            <!-- Expected time and depth -->
            <tr>
                <td>Temps prévu</td>
            <td>{{$divingGroup['group']->DG_MAX_DURATION}} min</td>
                <td>
                    @unless(is_null($divingGroup['group']->DG_MAX_DURATION))
                        {{$divingGroup['group']->DG_MAX_DURATION}} min
                    @endunless
                </td>
                <td>Profondeur prévue</td>
            <td>{{$divingGroup['group']->DG_MAX_DEPTH}} m</td>
                <td>
                    @unless(is_null($divingGroup['group']->DG_MAX_DEPTH))
                        {{$divingGroup['group']->DG_MAX_DEPTH}} m
                    @endunless
                </td>
            </tr>

            <!-- Actual time and depth -->
            <tr>
                <td>Temps réalisé</td>
            <td>{{$divingGroup['group']->DG_EFFECTIVE_DIVING_DURATION}} min</td>
                <td>
                    @unless(is_null($divingGroup['group']->DG_EFFECTIVE_DIVING_DURATION))
                        {{$divingGroup['group']->DG_EFFECTIVE_DIVING_DURATION}} min
                    @endunless
                </td>
                <td>Profondeur réalisée</td>
            <td>{{$divingGroup['group']->DG_MAX_EFFECTIVE_DEPTH}} m</td>
                <td>
                    @unless(is_null($divingGroup['group']->DG_MAX_EFFECTIVE_DEPTH))
                        {{$divingGroup['group']->DG_MAX_EFFECTIVE_DEPTH}} m
                    @endunless
                </td>
            </tr>

            <!-- Members table header -->
@@ -123,4 +140,17 @@
                </tr>
            @endforeach
        </x-security-sheets.diving-group-table>

        @php
            $i++;
        @endphp

        <!-- 
            Inserting a page break by closing the page tag and opening a new one 
            (there's a closing tag at the end of the file). 
        -->
        @if($i % 5 == 0)
            </page><page>
        @endif
    @endforeach
</page>
 No newline at end of file