Browse Source

refactoring e aggiunte parti mancanti passegero e inforunato

FabioFratini 1 year ago
parent
commit
9a5e7d5ca5

+ 31 - 0
app/Helpers/PasseggeroStatusHelper.php

@@ -0,0 +1,31 @@
+<?php
+
+namespace App\Helpers;
+
+class PasseggeroStatusHelper
+{
+    public static function getStatusText($value, $options)
+    {
+        return $options[$value] ?? '';
+    }
+
+    public static function getInjuryStatusMap()
+    {
+        return [
+            0 => 'INCOLUME',
+            1 => 'FERITO',
+            2 => 'DECEDUTO ENTRO 24 ORE',
+            3 => 'DECEDUTO ENTRO 30 GG.'
+        ];
+    }
+
+    public static function getDocumentTypeMap()
+    {
+        return [
+            1 => "Carta d'Identità",
+            2 => 'Patente',
+            3 => 'Passaporto',
+            4 => 'Altro'
+        ];
+    }
+}

+ 47 - 0
app/Helpers/StatusHelper.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace App\Helpers;
+
+class StatusHelper
+{
+    public static function getStatusText($value, $options)
+    {
+        return $options[$value] ?? '';
+    }
+
+    public static function getBinaryStatusMap()
+    {
+        return [
+            1 => 'PRESENTE',
+            2 => 'NON PRESENTE',
+            3 => 'NON RILEVATO'
+        ];
+    }
+
+    public static function getDeviceStatusMap()
+    {
+        return [
+            1 => 'FUNZIONANTE',
+            2 => 'NON FUNZIONANTE',
+            3 => 'NON RILEVATO'
+        ];
+    }
+
+    public static function getCrystalPositionMap()
+    {
+        return [
+            1 => "Incrinato all'interno",
+            2 => "Incrinato all'esterno",
+            3 => 'ALTRA POSIZIONE'
+        ];
+    }
+
+    public static function getAirbagStatusMap()
+    {
+        return [
+            1 => 'SI',
+            2 => 'NO',
+            3 => 'NON RILEVATO'
+        ];
+    }
+}

+ 21 - 0
app/Helpers/VerbaleHelper.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace App\Helpers;
+
+class VerbaleHelper{
+    public static function getStatusText($value, $options)
+    {
+        return $options[$value] ?? '';
+    }
+
+    public static function getWitnessStatusMap()
+    {
+        return [
+            1 => 'Teste presente al momento del rilievo',
+            2 => 'Teste non presente al momento del rilievo',
+            3 => "Teste che dichiara sul luogo dell'incidente",
+            4 => 'Teste che dichiara al Pronto Soccorso',
+            5 => 'Teste che dichiara in un proseguo di tempo'
+        ];
+    }
+}

+ 5 - 0
app/Models/ReportDataPasseggeri.php

@@ -22,6 +22,11 @@ class ReportDataPasseggeri extends Model
 
     ];
 
+    public function report()
+    {
+        return $this->belongsTo(\App\Models\Report::class, 'report_id');
+    }
+
     public function passeggero_value()
     {
         return $this->belongsTo(\App\Models\Anagrafica::class, 'passeggero');

+ 0 - 0
resources/views/components/accertamenti/conducente.blade.php → resources/views/components/verbale/accertamenti/conducente.blade.php


+ 0 - 0
resources/views/components/accertamenti/passeggeri.blade.php → resources/views/components/verbale/accertamenti/passeggeri.blade.php


+ 0 - 0
resources/views/components/accertamenti/provvedimenti.blade.php → resources/views/components/verbale/accertamenti/provvedimenti.blade.php


+ 0 - 0
resources/views/components/accertatori/index.blade.php → resources/views/components/verbale/accertatori/index.blade.php


+ 0 - 0
resources/views/components/allegati/file-display.blade.php → resources/views/components/verbale/allegati/file-display.blade.php


+ 1 - 1
resources/views/components/allegati/index.blade.php → resources/views/components/verbale/allegati/index.blade.php

@@ -12,7 +12,7 @@
 
     @foreach($allegati as $allegato)
         @if($allegato->is_visible && $allegato->files)
-            <x-allegati.file-display :files="explode('|', $allegato->files)" />
+            <x-verbale.allegati.file-display :files="explode('|', $allegato->files)" />
         @endif
     @endforeach
 @endif

+ 55 - 0
resources/views/components/verbale/infortunati/dettaglio.blade.php

@@ -0,0 +1,55 @@
+@php
+    use App\Helpers\DateHelper;
+
+    $documentTypes = [
+        1 => "Carta d'Identità",
+        2 => 'Patente',
+        3 => 'Passaporto',
+        4 => 'Altro'
+    ];
+
+    $documentType = $documentTypes[$infortunato->documento_tipo] ?? '';
+@endphp
+
+<table>
+    <tr>
+        <td width="5%" class="veicolo-title-cell"></td>
+        <td width="25%" class="veicolo-title-cell">COGNOME E NOME</td>
+        <td width="25%" class="veicolo-content-cell">
+            {{ $infortunato->lastname }}
+            {{ $infortunato->firstname }}
+        </td>
+        <td width="20%" class="veicolo-title-cell">NATO A</td>
+        <td width="20%" class="veicolo-content-cell">
+            {{ optional($infortunato->birth_town_id_value)->name ?? 'N/A' }}
+        </td>
+    </tr>
+    <tr>
+        <td width="5%" class="veicolo-title-cell"></td>
+        <td width="25%" class="veicolo-title-cell">NATO IL</td>
+        <td width="25%" class="veicolo-content-cell">
+            {{ DateHelper::formatDate($infortunato->birth_date) }}
+        </td>
+    </tr>
+
+    <tr>
+        <td width="5%" class="veicolo-title-cell"></td>
+        <td width="20%" class="veicolo-title-cell">DOCUMENTO</td>
+        <td width="20%" class="veicolo-content-cell">{{ $documentType }}</td>
+        <td width="30%" class="veicolo-title-cell">NUMERO</td>
+        <td width="25%" class="veicolo-content-cell">
+            {{ $infortunato->documento_numero }}
+        </td>
+    </tr>
+    <tr>
+        <td width="5%" class="veicolo-title-cell"></td>
+        <td width="25%" class="veicolo-title-cell">SEDICENTE</td>
+        <td width="20%" class="veicolo-content-cell">
+            {{ $infortunato->sedicente ? 'SI' : 'NO' }}
+        </td>
+    </tr>
+
+    <tr>
+        <td></td>
+    </tr>
+</table>

+ 40 - 0
resources/views/components/verbale/infortunati/index.blade.php

@@ -0,0 +1,40 @@
+{{-- resources/views/components/verbale/infortunati/index.blade.php --}}
+@php
+    $datiInfortunatiArray = $datiInfortunati->toArray();
+@endphp
+
+@if (count($datiInfortunatiArray) > 0)
+    <table class="table-content" width="100%">
+        <tr>
+            <td width="20%" align="center" style="font-size: 20px;">
+                <table class="">
+                    <tr class="tr-sub-title">
+                        <td class="bold">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

+ 66 - 0
resources/views/components/verbale/passeggeri/dettaglio.blade.php

@@ -0,0 +1,66 @@
+{{-- resources/views/components/verbale/passeggeri/dettaglio.blade.php --}}
+@php
+    use App\Helpers\DateHelper;
+    use App\Helpers\PasseggeroStatusHelper;
+@endphp
+
+<table>
+    <tr>
+        <td width="5%" class="veicolo-title-cell"></td>
+        <td width="25%" class="veicolo-title-cell">COGNOME</td>
+        <td width="25%" class="veicolo-content-cell">
+            {{ $passeggero->lastname }}
+        </td>
+        <td width="25%" class="veicolo-title-cell">NOME</td>
+        <td width="25%" class="veicolo-content-cell">
+            {{ $passeggero->firstname }}
+        </td>
+    </tr>
+    <tr>
+        <td width="5%" class="veicolo-title-cell"></td>
+        <td width="20%" class="veicolo-title-cell">NATO A</td>
+        <td width="20%" class="veicolo-content-cell">
+            {{ optional($passeggero->birth_town_id_value)->name ?? 'N/A' }}
+        </td>
+        <td width="25%" class="veicolo-title-cell">NATO IL</td>
+        <td width="25%" class="veicolo-content-cell">
+            {{ DateHelper::formatDate($passeggero->birth_date) }}
+        </td>
+    </tr>
+
+    <tr>
+        <td width="5%" class="veicolo-title-cell"></td>
+        <td width="20%" class="veicolo-title-cell">DOCUMENTO</td>
+        <td width="20%" class="veicolo-content-cell">
+            {{ PasseggeroStatusHelper::getStatusText(
+                $passeggero->documento_tipo,
+                PasseggeroStatusHelper::getDocumentTypeMap()
+            ) }}
+        </td>
+        <td width="30%" class="veicolo-title-cell">NUMERO</td>
+        <td width="25%" class="veicolo-content-cell">
+            {{ $passeggero->documento_numero }}
+        </td>
+    </tr>
+    <tr>
+        <td width="5%" class="veicolo-title-cell"></td>
+        <td width="25%" class="veicolo-title-cell">SEDICENTE</td>
+        <td width="20%" class="veicolo-content-cell">
+            {{ $passeggero->sedicente ? 'SI' : 'NO' }}
+        </td>
+    </tr>
+
+    <tr>
+        <td width="5%" class="veicolo-title-cell"></td>
+        <td width="35%" class="veicolo-title-cell">PASSEGGERO INFORTUNATO</td>
+        <td width="20%" class="veicolo-content-cell">
+            {{ PasseggeroStatusHelper::getStatusText(
+                $passeggeroRecord->infortunato,
+                PasseggeroStatusHelper::getInjuryStatusMap()
+            ) }}
+        </td>
+    </tr>
+    <tr>
+        <td></td>
+    </tr>
+</table>

+ 39 - 0
resources/views/components/verbale/passeggeri/index.blade.php

@@ -0,0 +1,39 @@
+{{-- resources/views/components/verbale/passeggeri/index.blade.php --}}
+@if (count($datiPasseggeri) > 0)
+    <table class="table-content" width="100%">
+        <tr>
+            <td width="20%" align="center" style="font-size: 20px;">
+                <table class="">
+                    <tr class="tr-sub-title">
+                        <td class="bold">PASSEGGERI</td>
+                    </tr>
+                </table>
+            </td>
+            <td width="80%">
+                @php
+                    $datiPasseggeriArray = $datiPasseggeri->toArray();
+                @endphp
+                @foreach ($datiPasseggeriArray as $idx => $passeggeroRecord)
+                    @php
+                        $record = is_array($passeggeroRecord[0] ?? null)
+                            ? $passeggeroRecord[0]
+                            : $passeggeroRecord;
+
+                        if (($record['passeggero'] ?? 0) > 0 && !empty($record['passeggero_value'])) {
+                            $passeggero = \App\Models\Anagrafica::find($record['passeggero']);
+                        } else {
+                            $passeggero = null;
+                        }
+                    @endphp
+                    @if ($passeggero)
+                    <x-verbale.passeggeri.dettaglio
+                        :passeggero="$passeggero"
+                        :passeggeroRecord="(object)$record"
+                        :idx="$idx + 1"
+                    />
+                    @endif
+            @endforeach
+            </td>
+        </tr>
+    </table>
+@endif

+ 198 - 0
resources/views/components/verbale/stato-veicolo/index.blade.php

@@ -0,0 +1,198 @@
+{{-- resources/views/components/verbale/stato-veicolo/index.blade.php --}}
+@php
+    use App\Helpers\VehicleStatusHelper;
+    use App\Helpers\StatusHelper;
+
+
+    $hasVehicleData = $datiVeicolo && (
+        (isset($datiVeicolo['posizione_statica_finale']) && !empty($datiVeicolo['posizione_statica_finale'])) ||
+        (isset($datiVeicolo['danni_visibili_riportati']) && !empty($datiVeicolo['danni_visibili_riportati'])) ||
+        (isset($datiVeicolo['danni_visibili_pre_esistenti']) && !empty($datiVeicolo['danni_visibili_pre_esistenti'])) ||
+        (isset($datiVeicolo['destinazione_veicolo']) && !empty($datiVeicolo['destinazione_veicolo'])) ||
+        (isset($datiVeicolo['circostanze_presunte_incidente']) && !empty($datiVeicolo['circostanze_presunte_incidente'])) ||
+        (isset($datiVeicolo['stato_pneumatici']) && !empty($datiVeicolo['stato_pneumatici']))
+    );
+@endphp
+
+@if ($hasVehicleData)
+
+<table width="100%">
+        <tr>
+            <td width="100%" valign="top" align="center">
+                <h2>STATO VEICOLO</h2>
+            </td>
+        </tr>
+        <tr><td></td></tr>
+    </table>
+
+    {{-- Static Position --}}
+    @if (isset($datiVeicolo['posizione_statica_finale']) && $datiVeicolo['posizione_statica_finale'])
+        <x-verbale.stato-veicolo.stato-veicolo-section
+            title="POSIZIONE STATICA VEICOLO"
+            :content="VehicleStatusHelper::getStatusText($datiVeicolo['posizione_statica_finale'], VehicleStatusHelper::getStaticPositionMap())"
+        />
+    @endif
+
+    {{-- Visible Damage --}}
+    @if (isset($datiVeicolo['danni_visibili_riportati']) && $datiVeicolo['danni_visibili_riportati'])
+        <x-verbale.stato-veicolo.stato-veicolo-section
+            title="DANNI VISIBILI RIPORTATI"
+            :content="$datiVeicolo['danni_visibili_riportati']"
+        />
+    @endif
+
+    {{-- Pre-existing Damage --}}
+    @if (isset($datiVeicolo['danni_visibili_pre_esistenti']) && $datiVeicolo['danni_visibili_pre_esistenti'])
+        <x-verbale.stato-veicolo.stato-veicolo-section
+            title="DANNI PRE ESISTENTI"
+            :content="$datiVeicolo['danni_visibili_pre_esistenti']"
+        />
+    @endif
+
+    {{-- Vehicle Destination --}}
+    @if (isset($datiVeicolo['destinazione_veicolo']) && $datiVeicolo['destinazione_veicolo'])
+        <table class="table-content" width="100%">
+            <tr>
+                <td width="20%" align="center" style="font-size: 20px;">
+                    <table>
+                        <tr class="tr-sub-title">
+                            <td class="bold">DESTINAZIONE VEICOLO</td>
+                        </tr>
+                    </table>
+                </td>
+                <td width="80%">
+                    <table>
+                        <tr>
+                            <td width="100%" class="">
+                                {{ VehicleStatusHelper::getStatusText($datiVeicolo['destinazione_veicolo'], VehicleStatusHelper::getDestinazioneVeicoloMap()) }}
+                            </td>
+                        </tr>
+                        @if (isset($datiVeicolo['destinazione_veicolo_affidato_a']) && $datiVeicolo['destinazione_veicolo_affidato_a'])
+                            <tr>
+                                <td width="100%" class="">VEICOLO AFFIDATO A {{ $datiVeicolo['destinazione_veicolo_affidato_a'] }}</td>
+                            </tr>
+                        @endif
+                        @foreach(['sequestro_num_art', 'amministrativo_num', 'amministrativo_num_art_violato', 'amministrativo_cds'] as $field)
+                            @if (isset($datiVeicolo["destinazione_veicolo_$field"]) && $datiVeicolo["destinazione_veicolo_$field"])
+                                <tr>
+                                    <td width="100%" class="">{{ $datiVeicolo["destinazione_veicolo_$field"] }}</td>
+                                </tr>
+                            @endif
+                        @endforeach
+                    </table>
+                </td>
+            </tr>
+        </table>
+    @endif
+
+    {{-- Presumed Circumstances --}}
+    @if (isset($datiVeicolo['circostanze_presunte_incidente']) && $datiVeicolo['circostanze_presunte_incidente'])
+        <x-verbale.stato-veicolo.stato-veicolo-section
+            title="CIRCOSTANZE PRESUNTE INCIDENTE"
+            :content="$datiVeicolo['circostanze_presunte_incidente']"
+        />
+    @endif
+
+    {{-- Vehicle Details Observations --}}
+    <table class="table-content" width="100%">
+        <tr>
+            <td width="20%" align="center" style="font-size: 20px;">
+                <table>
+                    <tr class="tr-sub-title">
+                        <td class="bold">DETTAGLIO OSSERVAZIONI VEICOLO</td>
+                    </tr>
+                </table>
+            </td>
+            <td width="80%">
+                <table>
+                    {{-- Tires Information --}}
+                    <tr>
+                        @if (isset($datiVeicolo['stato_pneumatici']) && $datiVeicolo['stato_pneumatici'])
+                            <td width="50%" class="">
+                                <b>STATO PNEUMATICI</b>
+                                {{ VehicleStatusHelper::getStatusText($datiVeicolo['stato_pneumatici'], VehicleStatusHelper::getStatoPneumaticiMap()) }}
+                            </td>
+                        @endif
+                        @if (isset($datiVeicolo['marca_pneumatici']) && $datiVeicolo['marca_pneumatici'])
+                            <td width="25%" class=""><b>MARCA PNEUMATICI</b> {{ $datiVeicolo['marca_pneumatici'] }}</td>
+                        @endif
+                        @if (isset($datiVeicolo['misura_pneumatici']) && $datiVeicolo['misura_pneumatici'])
+                            <td width="25%" class=""><b>MISURA PNEUMATICI</b> {{ $datiVeicolo['misura_pneumatici'] }}</td>
+                        @endif
+                    </tr>
+
+                    {{-- Device Statuses --}}
+                    @foreach([
+                        'dispositivi_ottici' => 'STATO DISPOSITIVI OTTICI',
+                        'tergicristalli' => 'STATO TERGICRISTALLI',
+                        'segnale_pericolo' => 'STATO SEGNALE PERICOLO',
+                        'abs' => 'ABS',
+                        'gps' => 'GPS',
+                        'specchio_retrovisore' => 'SPECCHIO RETROVISORE',
+                        'specchio_lat_dx' => 'SPECCHIO LAT DX',
+                        'specchio_lat_sx' => 'SPECCHIO LAT SX'
+                    ] as $field => $label)
+                        @if (isset($datiVeicolo[$field]) && $datiVeicolo[$field])
+                            <tr>
+                                <td width="100%" class="">
+                                    <b>{{ $label }}</b>
+                                    {{ StatusHelper::getStatusText(
+                                        $datiVeicolo[$field],
+                                        in_array($field, ['dispositivi_ottici', 'tergicristalli'])
+                                            ? StatusHelper::getDeviceStatusMap()
+                                            : StatusHelper::getBinaryStatusMap()
+                                    ) }}
+                                </td>
+                            </tr>
+                        @endif
+                    @endforeach
+
+                    {{-- Gear Status --}}
+                    @if (isset($datiVeicolo['marcia_inserita']) && $datiVeicolo['marcia_inserita'])
+                        <tr>
+                            <td width="100%" class="">
+                                <b>MARCIA INSERITA</b>
+                                {{ VehicleStatusHelper::getStatusText($datiVeicolo['marcia_inserita'], VehicleStatusHelper::getMarciaMap()) }}
+                            </td>
+                        </tr>
+                    @endif
+
+                    {{-- Crystal Status --}}
+                    @if (isset($datiVeicolo['cristallo']) && $datiVeicolo['cristallo'])
+                        <tr>
+                            <td width="100%" class="">
+                                <b>CRISTALLO</b>
+                                {{ StatusHelper::getStatusText($datiVeicolo['cristallo'], StatusHelper::getCrystalPositionMap()) }}
+                            </td>
+                        </tr>
+                    @elseif(isset($datiVeicolo['cristallo_posizione']) && $datiVeicolo['cristallo_posizione'])
+                        <tr>
+                            <td width="100%" class="">
+                                <b>CRISTALLO</b>
+                                {{ $datiVeicolo['cristallo_posizione'] }}
+                            </td>
+                        </tr>
+                    @endif
+
+                    {{-- Airbag Status --}}
+                    @if (isset($datiVeicolo['attivazione_airbag']) && $datiVeicolo['attivazione_airbag'])
+                        <tr>
+                            <td width="100%" class="">
+                                <b>ATTIVAZIONE AIRBAG</b>
+                                {{ StatusHelper::getStatusText($datiVeicolo['attivazione_airbag'], StatusHelper::getAirbagStatusMap()) }}
+                            </td>
+                        </tr>
+                    @endif
+                    @if (isset($datiVeicolo['airbag_posizione']) && $datiVeicolo['airbag_posizione'])
+                        <tr>
+                            <td width="100%" class="">
+                                <b>POSIZIONE AIRBAG</b>
+                                {{ $datiVeicolo['airbag_posizione'] }}
+                            </td>
+                        </tr>
+                    @endif
+                </table>
+            </td>
+        </tr>
+    </table>
+@endif

+ 23 - 0
resources/views/components/verbale/stato-veicolo/stato-veicolo-section.blade.php

@@ -0,0 +1,23 @@
+@props(['title', 'content'])
+
+<table class="table-content" width="100%">
+    <tr>
+        <td width="20%" align="center" style="font-size: 20px;">
+            <table>
+                <tr class="tr-sub-title">
+                    <td class="bold">{{ $title }}</td>
+                </tr>
+            </table>
+        </td>
+        <td width="80%">
+            <table>
+                <tr>
+                    <td width="100%" class="">{{ $content }}</td>
+                </tr>
+                <tr>
+                    <td></td>
+                </tr>
+            </table>
+        </td>
+    </tr>
+</table>

+ 68 - 0
resources/views/components/verbale/testimoni/index.blade.php

@@ -0,0 +1,68 @@
+{{-- resources/views/components/testimoni/index.blade.php --}}
+@php
+    use App\Helpers\VerbaleHelper;
+    $hasValidWitnesses = isset($data['testi_oculari']) &&
+        count($data['testi_oculari']) > 0 &&
+        collect($data['testi_oculari'])->some(fn($teste) => $teste->testi_oculari > 0);
+@endphp
+
+@if ($hasValidWitnesses)
+    <table width="100%">
+        <tr>
+            <td width="100%" valign="top" align="center">
+                <h2>TESTE OCULARI</h2>
+            </td>
+        </tr>
+        <tr><td></td></tr>
+    </table>
+
+    @foreach ($data['testi_oculari'] as $i => $teste)
+        @if ($teste->testi_oculari > 0)
+            <table class="table-content" width="100%">
+                <tr>
+                    <td width="20%" align="center" style="font-size: 20px;">
+                        <table>
+                            <tr class="tr-sub-title">
+                                <td class="bold">TESTE</td>
+                            </tr>
+                        </table>
+                    </td>
+                    <td width="80%">
+                        <table>
+                            <tr>
+                                <td width="25%" class="veicolo-title-cell">COGNOME E NOME</td>
+                                <td width="15%" class="veicolo-content-cell">
+                                    {{ @$teste->teste->lastname }} {{ @$teste->teste->firstname }}
+                                </td>
+                                <td width="15%" class="veicolo-title-cell">NATO A</td>
+                                <td width="20%" class="veicolo-content-cell">
+                                    {{ @$teste->teste->birth_town_id_value->title }}
+                                </td>
+                            </tr>
+
+                            @if ($teste->teste->birth_date != '')
+                                <tr>
+                                    <td width="15%" class="veicolo-title-cell">NATO IL</td>
+                                    <td width="25%" class="veicolo-content-cell">
+                                        {{ App\Helpers\DateHelper::formatDate(@$teste->teste->birth_date) }}
+                                    </td>
+                                </tr>
+                            @endif
+
+                            @if ($teste->stato_testi_oculari != '')
+                                <tr>
+                                    <td width="25%" class="veicolo-title-cell">STATO TESTE</td>
+                                    <td width="70%" class="veicolo-content-cell">
+                                        {{ VerbaleHelper::getStatusText($teste->stato_testi_oculari,VerbaleHelper::getWitnessStatusMap()) }}
+                                    </td>
+                                </tr>
+                            @endif
+
+                            <tr><td></td></tr>
+                        </table>
+                    </td>
+                </tr>
+            </table>
+        @endif
+    @endforeach
+@endif

+ 0 - 0
resources/views/components/verbalizzanti/index.blade.php → resources/views/components/verbale/verbalizzanti/index.blade.php


+ 19 - 635
resources/views/pdf/verbale.blade.php

@@ -160,7 +160,7 @@
 
     <div class="page-break"></div>
 
-    <x-accertatori.index :record="$data['record']" />
+    <x-verbale.accertatori.index :record="$data['record']" />
 
     @if (!empty($data['parti_coinvolte']))
         {{-- Vehicles Section --}}
@@ -1257,11 +1257,14 @@
 
             $datiVeicolo = $data['datiVeicolo'][$parte->progressive];
             $datiPedoni = $data['datiPedoni'][$parte->progressive];
-            $datiInfortunati = $data['datiInfortunati'][$parte->progressive];
-            $datiPasseggeri = $data['datiPasseggeri'][$parte->progressive];
-            $datiCascoOmologazione = $data['datiCascoOmologazione'][$parte->progressive];
-            $datiCasco = $data['datiCasco'][$parte->progressive];
-            $datiCintureSicurezza = $data['datiCintureSicurezza'][$parte->progressive];
+            $datiPasseggeri = App\Models\ReportDataPasseggeri::with('passeggero_value')
+                ->where('report_id', $data['record']->id)
+                ->get()
+                ->groupBy('progressive');
+            $datiInfortunati = App\Models\ReportDataInfortunati::with('infortunato_value')
+                ->where('report_id', $data['record']->id)
+                ->get()
+                ->groupBy('progressive');
             $vehicleNumber = 0;
             foreach ($data['parti_coinvolte'] as $prog => $parteCoinvolta) {
                 if ($prog < $parte->progressive && $parteCoinvolta->conducente_o_pedone == 2) {
@@ -1854,507 +1857,13 @@
                 </table>
             @endif
 
-            @if (false && count($data['datiPasseggeri']) > 0)
-                <table class="table-content" width="100%">
-                    <tr>
-                        <td width="20%" align="center" style="font-size: 20px;">
-                            <table class="">
-                                <tr class="tr-sub-title">
-                                    <td class="bold">PASSEGGERI</td>
-                                </tr>
-                            </table>
-                        </td>
-                        <td width="80%">
-                            @foreach ($data['datiPasseggeri'] as $idx => $passeggero)
-                                @if ($passeggero->passeggero > 0)
-                                    <table>
-                                        <tr>
-                                            <td width="2%" class="veicolo-title-cell">#</td>
-                                            <td width="3%" class="veicolo-content-cell">{{ @$idx }}</td>
-                                            <td width="25%" class="veicolo-title-cell">COGNOME E NOME</td>
-                                            <td width="25%" class="veicolo-content-cell">
-                                                {{ @$passeggero->passeggero_value->lastname }}
-                                                {{ @$passeggero->passeggero_value->firstname }}
-                                            </td>
-                                            <td width="20%" class="veicolo-title-cell">NATO A</td>
-                                            <td width="20%" class="veicolo-content-cell">
-                                                {{ @$passeggero->passeggero_value->birth_town_id_value }}
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td width="5%" class="veicolo-title-cell"></td>
-                                            <td width="25%" class="veicolo-title-cell">NATO IL</td>
-                                            <td width="25%" class="veicolo-content-cell">
-                                                {{ DateUtil::formatDate(@$passeggero->passeggero_value->birth_date) }}
-                                            </td>
-                                        </tr>
+            <x-verbale.passeggeri.index :datiPasseggeri="$datiPasseggeri" />
+            <x-verbale.infortunati.index :datiInfortunati="$datiInfortunati" />
 
-                                        <tr>
-                                            <td width="5%" class="veicolo-title-cell"></td>
-                                            <td width="20%" class="veicolo-title-cell">DOCUMENTO</td>
-                                            @php
-                                                $tipo = '';
-                                                switch ($passeggero->passeggero_value->documento_tipo) {
-                                                    case 1:
-                                                        $tipo = "Carta d'Identità";
-                                                        break;
-                                                    case 2:
-                                                        $tipo = 'Patente';
-                                                        break;
-                                                    case 3:
-                                                        $tipo = 'Passaporto';
-                                                        break;
-                                                    case 4:
-                                                        $tipo = 'Altro';
-                                                        break;
-                                                    default:
-                                                        break;
-                                                }
-                                            @endphp
-                                            <td width="20%" class="veicolo-content-cell">{{ @$tipo }}</td>
-                                            <td width="30%" class="veicolo-title-cell">NUMERO</td>
-                                            <td width="25%" class="veicolo-content-cell">
-                                                {{ @$passeggero->passeggero_value->documento_numero }}
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td width="5%" class="veicolo-title-cell"></td>
-                                            <td width="25%" class="veicolo-title-cell">SEDICENTE</td>
-                                            <td width="20%" class="veicolo-content-cell">
-                                                {{ @$passeggero->passeggero_value->sedicente ? 'SI' : 'NO' }}
-                                            </td>
-                                        </tr>
-
-                                        <tr>
-                                            <td width="5%" class="veicolo-title-cell"></td>
-                                            <td width="35%" class="veicolo-title-cell">PASSEGGERO INFORTUNATO</td>
-                                            <td width="20%" class="veicolo-content-cell">
-                                                @if ($passeggero->infortunato == 0)
-                                                    INCOLUME
-                                                @endif
-                                                @if ($passeggero->infortunato == 1)
-                                                    FERITO
-                                                @endif
-                                                @if ($passeggero->infortunato == 2)
-                                                    DECEDUTO ENTRO 24 ORE
-                                                @endif
-                                                @if ($passeggero->infortunato == 3)
-                                                    DECEDUTO ENTRO 30 GG.
-                                                @endif
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td></td>
-                                        </tr>
-                                    </table>
-                                @endif
-                            @endforeach
-                        </td>
-                    </tr>
-                </table>
-            @endif
-
-            @if (count($datiInfortunati) > 0)
-                <table class="table-content" width="100%">
-                    <tr>
-                        <td width="20%" align="center" style="font-size: 20px;">
-                            <table class="">
-                                <tr class="tr-sub-title">
-                                    <td class="bold">INFORTUNATI</td>
-                                </tr>
-                            </table>
-                        </td>
-                        <td width="80%">
-                            @foreach ($datiInfortunati as $idx => $infortunato)
-                                @if ($infortunato->infortunato > 0)
-                                    <table>
-                                        <tr>
-                                            <td width="2%" class="veicolo-title-cell">#</td>
-                                            <td width="3%" class="veicolo-content-cell">{{ @$idx }}</td>
-                                            <td width="25%" class="veicolo-title-cell">COGNOME E NOME</td>
-                                            <td width="25%" class="veicolo-content-cell">
-                                                {{ @$infortunato->infortunato_value->lastname }}
-                                                {{ @$infortunato->infortunato_value->firstname }}
-                                            </td>
-                                            <td width="20%" class="veicolo-title-cell">NATO A</td>
-                                            <td width="20%" class="veicolo-content-cell">
-                                                {{ @$infortunato->infortunato_value->birth_town_id_value }}
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td width="5%" class="veicolo-title-cell"></td>
-                                            <td width="25%" class="veicolo-title-cell">NATO IL</td>
-                                            <td width="25%" class="veicolo-content-cell">
-                                                {{ DateHelper::formatDate(@$infortunato->infortunato_value->birth_date) }}
-                                            </td>
-                                        </tr>
-
-                                        <tr>
-                                            <td width="5%" class="veicolo-title-cell"></td>
-                                            <td width="20%" class="veicolo-title-cell">DOCUMENTO</td>
-                                            @php
-                                                $tipo = '';
-                                                switch ($infortunato->infortunato_value->documento_tipo) {
-                                                    case 1:
-                                                        $tipo = "Carta d'Identità";
-                                                        break;
-                                                    case 2:
-                                                        $tipo = 'Patente';
-                                                        break;
-                                                    case 3:
-                                                        $tipo = 'Passaporto';
-                                                        break;
-                                                    case 4:
-                                                        $tipo = 'Altro';
-                                                        break;
-                                                    default:
-                                                        break;
-                                                }
-                                            @endphp
-                                            <td width="20%" class="veicolo-content-cell">{{ @$tipo }}</td>
-                                            <td width="30%" class="veicolo-title-cell">NUMERO</td>
-                                            <td width="25%" class="veicolo-content-cell">
-                                                {{ @$infortunato->infortunato_value->documento_numero }}
-                                            </td>
-                                        </tr>
-                                        <tr>
-                                            <td width="5%" class="veicolo-title-cell"></td>
-                                            <td width="25%" class="veicolo-title-cell">SEDICENTE</td>
-                                            <td width="20%" class="veicolo-content-cell">
-                                                {{ @$infortunato->infortunato_value->sedicente ? 'SI' : 'NO' }}
-                                            </td>
-                                        </tr>
-
-                                        <tr>
-                                            <td></td>
-                                        </tr>
-                                    </table>
-                                @endif
-                            @endforeach
-                        </td>
-                    </tr>
-                </table>
+            @if ($datiVeicolo)
+            <x-verbale.stato-veicolo.index :datiVeicolo="$datiVeicolo" />
             @endif
 
-            @php
-                $hasVehicleData =
-                    $datiVeicolo &&
-                    ($datiVeicolo->posizione_statica_finale ||
-                        $datiVeicolo->danni_visibili_riportati ||
-                        $datiVeicolo->danni_visibili_pre_esistenti ||
-                        $datiVeicolo->destinazione_veicolo ||
-                        $datiVeicolo->circostanze_presunte_incidente ||
-                        $datiVeicolo->stato_pneumatici);
-            @endphp
-
-            @if ($hasVehicleData)
-                <table width="100%">
-                    <tr>
-                        <td width="100%" valign="top" align="center">
-                            <h2>STATO VEICOLO</h2>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td></td>
-                    </tr>
-                </table>
-                @if ($datiVeicolo->posizione_statica_finale)
-                    <table class="table-content" width="100%">
-                        <tr>
-                            <td width="20%" align="center" style="font-size: 20px;">
-                                <table>
-                                    <tr class="tr-sub-title">
-                                        <td class="bold">POSIZIONE STATICA VEICOLO</td>
-                                    </tr>
-                                </table>
-                            </td>
-                            <td width="80%">
-                                <table>
-                                    <tr>
-                                        <td width="50%" class="veicolo-content-cell">
-                                            {{ App\Helpers\VehicleStatusHelper::getStatusText($datiVeicolo->posizione_statica_finale, App\Helpers\VehicleStatusHelper::getStaticPositionMap()) }}
-                                        </td>
-                                    </tr>
-                                    <tr>
-                                        <td></td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-                @endif
-                @if ($datiVeicolo->danni_visibili_riportati)
-                    <table class="table-content" width="100%">
-                        <tr>
-                            <td width="20%" align="center" style="font-size: 20px;">
-                                <table>
-                                    <tr class="tr-sub-title">
-                                        <td class="bold">DANNI VISIBILI RIPORTATI</td>
-                                    </tr>
-                                </table>
-                            </td>
-                            <td width="80%">
-                                <table>
-                                    <tr>
-                                        <td width="100%" class="">
-                                            {{ $datiVeicolo->danni_visibili_riportati }}
-                                        </td>
-                                    </tr>
-                                    <tr>
-                                        <td></td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-                @endif
-
-                @if ($datiVeicolo->danni_visibili_pre_esistenti)
-                    <table class="table-content" width="100%">
-                        <tr>
-                            <td width="20%" align="center" style="font-size: 20px;">
-                                <table>
-                                    <tr class="tr-sub-title">
-                                        <td class="bold">DANNI PRE ESISTENTI</td>
-                                    </tr>
-                                </table>
-                            </td>
-                            <td width="80%">
-                                <table>
-                                    <tr>
-                                        <td width="80%" class="">
-                                            {{ $datiVeicolo->danni_visibili_pre_esistenti }}
-                                        </td>
-                                    </tr>
-                                    <tr>
-                                        <td></td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-                @endif
-
-                @if ($datiVeicolo->destinazione_veicolo)
-                    <table class="table-content" width="100%">
-                        <tr>
-                            <td width="20%" align="center" style="font-size: 20px;">
-                                <table>
-                                    <tr class="tr-sub-title">
-                                        <td class="bold">DESTINAZIONE VEICOLO</td>
-                                    </tr>
-                                </table>
-                            </td>
-                            <td width="80%">
-                                <table>
-                                    <tr>
-                                        <td width="100%" class="">
-                                            {{ App\Helpers\VehicleStatusHelper::getStatusText($datiVeicolo->destinazione_veicolo, App\Helpers\VehicleStatusHelper::getDestinazioneVeicoloMap()) }}
-                                    </tr>
-                                    @if ($datiVeicolo->destinazione_veicolo_affidato_a)
-                                        <tr>
-                                            <td width="100%" class="">VEICOLO AFFIDATO A
-                                                {{ $datiVeicolo->destinazione_veicolo_affidato_a }}
-                                            </td>
-                                        </tr>
-                                    @endif
-                                    @if ($datiVeicolo->destinazione_veicolo_sequestro_num_art)
-                                        <tr>
-                                            <td width="100%" class="">
-                                                {{ $datiVeicolo->destinazione_veicolo_sequestro_num_art }}
-                                            </td>
-                                        </tr>
-                                    @endif
-                                    @if ($datiVeicolo->destinazione_veicolo_amministrativo_num)
-                                        <tr>
-                                            <td width="100%" class="">
-                                                {{ $datiVeicolo->destinazione_veicolo_amministrativo_num }}
-                                            </td>
-                                        </tr>
-                                    @endif
-                                    @if ($datiVeicolo->destinazione_veicolo_amministrativo_num_art_violato)
-                                        <tr>
-                                            <td width="100%" class="">
-                                                {{ $datiVeicolo->destinazione_veicolo_amministrativo_num_art_violato }}
-                                            </td>
-                                        </tr>
-                                    @endif
-                                    @if ($datiVeicolo->destinazione_veicolo_amministrativo_cds)
-                                        <tr>
-                                            <td width="100%" class="">
-                                                {{ $datiVeicolo->destinazione_veicolo_amministrativo_cds }}
-                                            </td>
-                                        </tr>
-                                    @endif
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-                @endif
-                @if ($datiVeicolo->circostanze_presunte_incidente)
-                    <table class="table-content" width="100%">
-                        <tr>
-                            <td width="20%" align="center" style="font-size: 20px;">
-                                <table>
-                                    <tr class="tr-sub-title">
-                                        <td class="bold">CIRCOSTANZE PRESUNTE INCIDENTE</td>
-                                    </tr>
-                                </table>
-                            </td>
-                            <td width="80%">
-                                <table>
-                                    <tr>
-                                        <td width="100%" class="veicolo-title-cell">
-                                            {{ $datiVeicolo->circostanze_presunte_incidente }}
-                                        </td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-                @endif
-                <table class="table-content" width="100%">
-                    <tr>
-                        <td width="20%" align="center" style="font-size: 20px;">
-                            <table>
-                                <tr class="tr-sub-title">
-                                    <td class="bold">DETTAGLIO OSSERVAZIONI VEICOLO</td>
-                                </tr>
-                            </table>
-                        </td>
-                        <td width="80%">
-                            <table>
-                                <tr>
-                                    @if ($datiVeicolo->stato_pneumatici)
-                                        <td width="50%" class="">
-                                            <b>STATO PNEUMATICI</b>
-                                            {{ App\Helpers\VehicleStatusHelper::getStatusText($datiVeicolo->stato_pneumatici, App\Helpers\VehicleStatusHelper::getStatoPneumaticiMap()) }}
-                                        </td>
-                                    @endif
-                                    @if ($datiVeicolo->marca_pneumatici)
-                                        <td width="25%" class="">
-                                            <b>MARCA PNEUMATICI</b>
-                                            {{ $datiVeicolo->marca_pneumatici }}
-                                        </td>
-                                    @endif
-                                    @if ($datiVeicolo->misura_pneumatici)
-                                        <td width="25%" class="">
-                                            <b>MISURA PNEUMATICI</b>
-                                            {{ $datiVeicolo->misura_pneumatici }}
-                                        </td>
-                                    @endif
-                                </tr>
-                                @if ($datiVeicolo->dispositivi_ottici)
-                                    <tr>
-                                        <td width="100%" class="">
-                                            <b>STATO DISPOSITIVI OTTICI</b>
-                                            {{ $datiVeicolo->dispositivi_ottici == 1 ? 'FUNZIONANTE' : ($datiVeicolo->dispositivi_ottici == 2 ? 'NON FUNZIONANTE' : 'NON RILEVATO') }}
-                                        </td>
-                                    </tr>
-                                @endif
-
-                                @if ($datiVeicolo->tergicristalli)
-                                    <tr>
-                                        <td width="100%" class="">
-                                            <b>STATO TERGICRISTALLI</b>
-                                            {{ App\Helpers\VehicleStatusHelper::getStatusText($datiVeicolo->tergicristalli, App\Helpers\VehicleStatusHelper::getTergicristalliMap()) }}
-                                        </td>
-                                    </tr>
-                                @endif
-                                @if ($datiVeicolo->segnale_pericolo)
-                                    <tr>
-                                        <td width="100%" class="">
-                                            <b>STATO SEGNALE PERICOLO</b>
-                                            {{ App\Helpers\VehicleStatusHelper::getStatusText($datiVeicolo->segnale_pericolo, App\Helpers\VehicleStatusHelper::getSegnalePericoloMap()) }}
-                                        </td>
-                                    </tr>
-                                @endif
-
-                                {{-- ABS --}}
-                                @if ($datiVeicolo->abs)
-                                    <tr>
-                                        <td width="100%" class="">
-                                            <b>ABS</b>
-                                            {{ $datiVeicolo->abs == 1 ? 'PRESENTE' : ($datiVeicolo->abs == 2 ? 'NON PRESENTE' : 'NON RILEVATO') }}
-                                        </td>
-                                    </tr>
-                                @endif
-                                @if ($datiVeicolo->gps)
-                                    <tr>
-                                        <td width="100%" class="">
-                                            <b>GPS</b>
-                                            {{ $datiVeicolo->gps == 1 ? 'PRESENTE' : ($datiVeicolo->gps == 2 ? 'NON PRESENTE' : 'NON RILEVATO') }}
-                                        </td>
-                                    </tr>
-                                @endif
-                                @if ($datiVeicolo->marcia_inserita)
-                                    <tr>
-                                        <td width="100%" class="">
-                                            <b>MARCIA INSERITA</b>
-                                            {{ App\Helpers\VehicleStatusHelper::getStatusText($datiVeicolo->marcia_inserita, App\Helpers\VehicleStatusHelper::getMarciaMap()) }}
-                                        </td>
-                                    </tr>
-                                @endif
-                                @if ($datiVeicolo->cristallo)
-                                    <tr>
-                                        <td width="100%" class="">
-                                            <b>CRISTALLO</b>
-                                            {{ $datiVeicolo->cristallo == 1 ? "Incrinato all'interno" : ($datiVeicolo->cristallo == 2 ? "Incrinato all'esterno" : 'ALTRA POSIZIONE') }}
-                                        </td>
-                                    </tr>
-                                @elseif($datiVeicolo->cristallo_posizione)
-                                    <tr>
-                                        <td width="100%" class="">
-                                            <b>CRISTALLO</b>
-                                            {{ $datiVeicolo->cristallo_posizione }}
-                                        </td>
-                                    </tr>
-                                @endif
-                                @if ($datiVeicolo->specchio_retrovisore)
-                                    <tr>
-                                        <td width="100%" class="">
-                                            <b>SPECCHIO RETROVISORE</b>
-                                            {{ $datiVeicolo->specchio_retrovisore == 1 ? 'PRESENTE' : ($datiVeicolo->specchio_retrovisore == 2 ? 'NON PRESENTE' : 'NON RILEVATO') }}
-                                        </td>
-                                    </tr>
-                                @endif
-                                @if ($datiVeicolo->specchio_lat_dx)
-                                    <tr>
-                                        <td width="100%" class="">
-                                            <b>SPECCHIO LAT DX</b>
-                                            {{ $datiVeicolo->specchio_lat_dx == 1 ? 'PRESENTE' : ($datiVeicolo->specchio_lat_dx == 2 ? 'NON PRESENTE' : 'NON RILEVATO') }}
-                                        </td>
-                                    </tr>
-                                @endif
-                                @if ($datiVeicolo->specchio_lat_sx)
-                                    <tr>
-                                        <td width="100%" class="">
-                                            <b>SPECCHIO LAT SX</b>
-                                            {{ $datiVeicolo->specchio_lat_sx == 1 ? 'PRESENTE' : ($datiVeicolo->specchio_lat_sx == 2 ? 'NON PRESENTE' : 'NON RILEVATO') }}
-                                        </td>
-                                    </tr>
-                                @endif
-                                @if ($datiVeicolo->attivazione_airbag)
-                                    <tr>
-                                        <td width="100%" class="">
-                                            <b>ATTIVAZIONE AIRBAG</b>
-                                            {{ $datiVeicolo->attivazione_airbag == 1 ? 'SI' : ($datiVeicolo->attivazione_airbag == 2 ? 'NO' : 'NON RILEVATO') }}
-                                        </td>
-                                    </tr>
-                                @endif
-                                @if ($datiVeicolo->airbag_posizione)
-                                    <tr>
-                                        <td width="100%" class="">
-                                            <b>POSIZIONE AIRBAG</b>
-                                            {{ $datiVeicolo->airbag_posizione }}
-                                        </td>
-                                    </tr>
-                                @endif
-                            </table>
-                        </td>
-                    </tr>
-                </table>
-            @endif
             @php
                 $datiCintureSicurezza = App\Models\ReportDataCintureSicurezza::where('report_id', $data['record']->id)
                     ->byProgressive($parte->progressive)
@@ -2412,7 +1921,7 @@
                 </table>
 
                 @if($hasDriverData)
-                    @include('components.accertamenti.conducente', [
+                    @include('components.verbale.accertamenti.conducente', [
                                     'datiCintureSicurezza' => $datiCintureSicurezza,
                                     'datiCasco' => $datiCasco,
                                     'datiCascoOmologazione' => $datiCascoOmologazione,
@@ -2421,7 +1930,7 @@
                 @endif
 
                 @if($hasPassengerData)
-                    @include('components.accertamenti.passeggeri', [
+                    @include('components.verbale.accertamenti.passeggeri', [
                                     'datiCintureSicurezza' => $datiCintureSicurezza,
                                     'datiCasco' => $datiCasco,
                                     'datiCascoOmologazione' => $datiCascoOmologazione,
@@ -2431,7 +1940,7 @@
                 @endif
 
                 @if($hasProvvedimenti)
-                    @include('components.accertamenti.provvedimenti', [
+                    @include('components.verbale.accertamenti.provvedimenti', [
                                     'datiVeicolo' => $datiVeicolo
                                 ])
                 @endif
@@ -2579,137 +2088,12 @@
 
     <div class="page-break"></div>
 
+    <x-verbale.testimoni.index :data="$data" />
 
-    @if (
-            isset($data['testi_oculari']) &&
-            count($data['testi_oculari']) > 0 &&
-            collect($data['testi_oculari'])->some(function ($teste) {
-                return $teste->testi_oculari > 0;
-            })
-        )
-
-            <table width="100%">
-                <tr>
-                    <td width="100%" valign="top" align="center">
-                        <h2>TESTE OCULARI</h2>
-                    </td>
-                </tr>
-                <tr>
-                    <td></td>
-                </tr>
-            </table>
-            @foreach ($data['testi_oculari'] as $i => $teste)
-                @if ($teste->testi_oculari > 0)
-                    <table class="table-content" width="100%">
-                        <tr>
-                            <td width="20%" align="center" style="font-size: 20px;">
-                                <table>
-                                    <tr class="tr-sub-title">
-                                        <td class="bold">TESTE</td>
-                                    </tr>
-                                </table>
-                            </td>
-                            <td width="80%">
-                                <table>
-                                    <tr>
-                                        <td width="25%" class="veicolo-title-cell">COGNOME E NOME</td>
-                                        <td width="15%" class="veicolo-content-cell">{{ @$teste->teste->lastname }}
-                                            {{ @$teste->teste->firstname }}
-                                        </td>
-
-                                        <td width="15%" class="veicolo-title-cell">NATO A</td>
-                                        <td width="20%" class="veicolo-content-cell">
-                                            {{ @$teste->teste->birth_town_id_value->title }}
-                                        </td>
-
-                                    </tr>
-                                    @if ($teste->teste->birth_date != '')
-                                        <tr>
-                                            <td width="15%" class="veicolo-title-cell">NATO IL</td>
-                                            <td width="25%" class="veicolo-content-cell">
-                                                {{ DateHelper::formatDate(@$teste->teste->birth_date) }}
-                                            </td>
-                                        </tr>
-                                    @endif
-                                    @if ($teste->stato_testi_oculari != '')
-                                            <tr>
-                                                <td width="25%" class="veicolo-title-cell">STATO TESTE</td>
-                                                @php
-                                                    $stato = '';
-                                                    switch ($teste->stato_testi_oculari) {
-                                                        case 1:
-                                                            $stato = 'Teste presente al momento del rilievo';
-                                                            break;
-                                                        case 2:
-                                                            $stato = 'Teste non presente al momento del rilievo';
-                                                            break;
-                                                        case 3:
-                                                            $stato = "Teste che dichiara sul luogo dell'incidente";
-                                                            break;
-                                                        case 4:
-                                                            $stato = 'Teste che dichiara al Pronto Soccorso';
-                                                            break;
-                                                        case 5:
-                                                            $stato = 'Teste che dichiara in un proseguo di tempo';
-                                                            break;
-                                                        default:
-                                                            break;
-                                                    }
-                                                @endphp
-                                                <td width="70%" class="veicolo-content-cell">{{ @$stato }}</td>
-                                            </tr>
-                                    @endif
-                                    <tr>
-                                        <td></td>
-                                    </tr>
-                                </table>
-                            </td>
-                        </tr>
-                    </table>
-                @endif
-            @endforeach
-
-    @endif
+    <x-verbale.allegati.index :allegati="$data['allegati']" />
 
-    <x-allegati.index :allegati="$data['allegati']" />
+    <x-verbale.verbalizzanti.index :record="$data['record']" />
 
-    <table width="100%">
-        <tr>
-            <td width="33%" align="center">
-                <b>IL RESPONSABILE DELL'UFFICIO</b>
-                <br><br>FRANCESCO MAROZZA
-                <br><small>COMMISSARIO COORDINATORE</small>
-            </td>
-            <td width="33%" align="center"></td>
-            <td width="33%" align="center">
-                <b>VERBALIZZANTI</b><br><br>
-                @if ($data['record']->accertatore_1 > 0)
-                    {{ @$data['record']->accertatore_1_value->name }}
-                    <br><small>{{ @$data['record']->grado_accertatore_1_value->name }}</small>
-                    <br>
-                @endif
-                @if ($data['record']->accertatore_2 > 0)
-                    {{ @$data['record']->accertatore_2_value->name }}
-                    <br><small>{{ @$data['record']->grado_accertatore_2_value->name }}</small>
-                    <br>
-                @endif
-                @if ($data['record']->accertatore_3 > 0)
-                    {{ @$data['record']->accertatore_3_value->name }}
-                    <br><small>{{ @$data['record']->grado_accertatore_3_value->name }}</small>
-                    <br>
-                @endif
-                @if ($data['record']->accertatore_4 > 0)
-                    {{ @$data['record']->accertatore_4_value->name }}
-                    <br><small>{{ @$data['record']->grado_accertatore_4_value->name }}</small>
-                    <br>
-                @endif
-                @if ($data['record']->accertatore_5 > 0)
-                    {{ @$data['record']->accertatore_5_value->name }}
-                    <br><small>{{ @$data['record']->grado_accertatore_5_value->name }}</small>
-                    <br>
-                @endif
-            </td>
-        </tr>
     </table>
 
 </body>