| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- @php
- $datiInfortunatiArray = $datiInfortunati->toArray();
- $hasValidInfortunati = false;
- foreach ($datiInfortunatiArray as $infortunatoRecord) {
- $record = is_array($infortunatoRecord[0] ?? null)
- ? $infortunatoRecord[0]
- : $infortunatoRecord;
- if (($record['infortunato'] ?? 0) > 0 && !empty($record['infortunato_value'])) {
- $hasValidInfortunati = true;
- break;
- }
- }
- @endphp
- @if ($hasValidInfortunati)
- <table class="table-content striped-table" width="100%">
- <tr>
- <td width="20%" align="center" style="font-size: 20px;">
- <table class="">
- <tr class="tr-sub-title">
- <td class="bold" style="border:none!important;">INFORTUNATI</td>
- </tr>
- </table>
- </td>
- <td width="80%">
- @foreach ($datiInfortunatiArray as $idx => $infortunatoRecord)
- @php
- $record = is_array($infortunatoRecord[0] ?? null)
- ? $infortunatoRecord[0]
- : $infortunatoRecord;
- if (($record['infortunato'] ?? 0) > 0 && !empty($record['infortunato_value'])) {
- $infortunato = \App\Models\Anagrafica::find($record['infortunato']);
- } else {
- $infortunato = null;
- }
- @endphp
- @if ($infortunato)
- <x-verbale.infortunati.dettaglio
- :infortunato="$infortunato"
- :infortunatoRecord="(object)$record"
- :idx="$idx + 1"
- />
- @endif
- @endforeach
- </td>
- </tr>
- </table>
- @endif
|