Просмотр исходного кода

fix e refactoring accertamenti

FabioFratini 1 год назад
Родитель
Сommit
3748e2a541

+ 81 - 0
app/Helpers/VehicleStatusHelper.php

@@ -0,0 +1,81 @@
+<?php
+
+namespace App\Helpers;
+
+class VehicleStatusHelper
+{
+    public static function getStatusText($value, $options)
+    {
+        return $options[$value] ?? '';
+    }
+
+    public static function getStaticPositionMap()
+    {
+        return [
+            1 => 'Come da documentazione fotografica',
+            2 => 'Come rilievo planimetrico',
+            3 => 'Coma da schizzo a vista non in scala',
+            4 => 'Già rimosso'
+        ];
+    }
+
+    public static function getDestinazioneVeicoloMap()
+    {
+        return [
+            1 => "Rimosso ai sensi dell'articolo 2028",
+            2 => 'Sequestro art. 354 Codice Procedura Penale',
+            3 => 'Sequestro art. 321 Codice Procedura Penale',
+            4 => 'Sequestro',
+            5 => 'Sequestro amministrativo',
+            6 => 'Fermo amministrativo',
+            7 => 'Ritirato dal conducente'
+        ];
+    }
+
+    public static function getStatoPneumaticiMap()
+    {
+        return [
+            1 => 'Regolamentare',
+            2 => 'Buono',
+            3 => 'Sufficiente',
+            4 => 'Insufficiente',
+            5 => 'Non rilevato'
+        ];
+    }
+
+    public static function getTergicristalliMap()
+    {
+        return [
+            1 => 'FUNZIONANTE',
+            2 => 'NON FUNZIONANTE',
+            3 => 'NON RILEVATO',
+            4 => 'NON PREVISTO'
+        ];
+    }
+
+    public static function getSegnalePericoloMap()
+    {
+        return [
+            1 => 'PRESENTE',
+            2 => 'NON PRESENTE',
+            3 => 'NON RILEVATO',
+            4 => 'NON PREVISTO'
+        ];
+    }
+
+    public static function getMarciaMap()
+    {
+        return [
+            0 => 'Folle',
+            1 => 'Prima',
+            2 => 'Seconda',
+            3 => 'Terza',
+            4 => 'Quarta',
+            5 => 'Quinta',
+            6 => 'Sesta',
+            7 => 'Retromarcia',
+            8 => 'Non rilevata',
+            9 => 'Cambio automatico'
+        ];
+    }
+}

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

@@ -0,0 +1,69 @@
+{{-- resources/views/components/accertamenti/conducente.blade.php --}}
+<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">ACCERTAMENTI CONDUCENTE</td>
+                </tr>
+            </table>
+        </td>
+        <td width="80%">
+            <table>
+                @if(isset($datiCintureSicurezza->conducente))
+                    <tr>
+                        <td width="100%" class="">
+                            <b>CINTURE SICUREZZA</b>
+                            {{ $datiCintureSicurezza->conducente == 1 ? 'SI' : ($datiCintureSicurezza->conducente == 2 ? 'NO' : 'NON RILEVATO') }}
+                        </td>
+                    </tr>
+                @endif
+
+                @if(isset($datiCasco->conducente))
+                    <tr>
+                        <td width="40%" class="">
+                            <b>USO CASCO</b>
+                            {{ $datiCasco->conducente == 1 ? 'SI' : ($datiCasco->conducente == 2 ? 'NO' : 'NON RILEVATO') }}
+                        </td>
+                        @if($datiCasco->conducente)
+                            <td width="60%" class="">
+                                <b>CASCO OMOLOGAZIONE</b>
+                                {{ $datiCascoOmologazione->conducente ?? '' }}
+                            </td>
+                        @endif
+                    </tr>
+                @endif
+
+                @if($datiVeicolo->alcool_test)
+                    <tr>
+                        <td width="100%" class="">
+                            <b>ALCOOL TEST</b>
+                            {{ $datiVeicolo->alcool_test ? 'SI' : 'NO' }}
+                        </td>
+                    </tr>
+                    <tr>
+                        <td width="100%" class="">
+                            <b>ALCOOL TEST ESITO</b>
+                            {{ $datiVeicolo->alcool_test_esito == 1 ? 'Esito negativo' : 'Esito positivo' }}
+                        </td>
+                    </tr>
+                @endif
+
+                @if($datiVeicolo->drug_test)
+                    <tr>
+                        <td width="100%" class="">
+                            <b>DRUG TEST</b>
+                            {{ $datiVeicolo->drug_test ? 'SI' : 'NO' }}
+                        </td>
+                    </tr>
+                    <tr>
+                        <td width="100%" class="">
+                            <b>DRUG TEST ESITO</b>
+                            {{ $datiVeicolo->drug_test_esito == 1 ? 'Esito negativo' : 'Esito positivo' }}
+                        </td>
+                    </tr>
+                @endif
+            </table>
+        </td>
+    </tr>
+</table>

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

@@ -0,0 +1,66 @@
+{{-- resources/views/components/accertamenti/passeggeri.blade.php --}}
+<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">ACCERTAMENTI PASSEGGERI</td>
+                </tr>
+            </table>
+        </td>
+        <td width="80%">
+            <table>
+                @if($datiCintureSicurezza)
+                    @for($i = 0; $i <= 3; $i++)
+                        <tr>
+                            <td width="100%" class="">
+                                <b>CINTURE SICUREZZA PASSEGGERO{{ $i + 1 }}</b>
+                                @php
+                                    $fieldName = "passeggeri_{$i}";
+                                    $value = $datiCintureSicurezza->$fieldName;
+                                @endphp
+                                {{ $getYesNoStatus($value) }}
+                            </td>
+                        </tr>
+                    @endfor
+
+                    @if($datiCasco)
+                        <tr>
+                            <td width="100%" class="">
+                                <b>USO CASCO</b>
+                                {{ $getYesNoStatus($datiCasco->passeggeri) }}
+                            </td>
+                        </tr>
+                    @endif
+
+                    @if($datiCascoOmologazione)
+                        <tr>
+                            <td width="100%" class="">
+                                <b>CASCO OMOLOGAZIONE</b>
+                                {{ $datiCascoOmologazione->passeggeri ?? 'NON RILEVATO' }}
+                            </td>
+                        </tr>
+                    @endif
+
+                    @if($datiVeicolo && $datiVeicolo->sistema_ritenuta_minori)
+                        <tr>
+                            <td width="100%" class="">
+                                <b>SISTEMA RITENUTA MINORI</b>
+                                {{ $getYesNoStatus($datiVeicolo->sistema_ritenuta_minori) }}
+                            </td>
+                        </tr>
+
+                        @if($datiVeicolo->sistema_ritenuta_minori == 1)
+                            <tr>
+                                <td width="100%" class="">
+                                    <b>SISTEMA RITENUTA MINORI OMOLOGAZIONE</b>
+                                    {{ $datiVeicolo->sistema_ritenuta_minori_omologazione ?? 'NON RILEVATO' }}
+                                </td>
+                            </tr>
+                        @endif
+                    @endif
+                @endif
+            </table>
+        </td>
+    </tr>
+</table>

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

@@ -0,0 +1,48 @@
+{{-- resources/views/components/accertamenti/provvedimenti.blade.php --}}
+<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">PROVVEDIMENTI ADOTTATI</td>
+                </tr>
+            </table>
+        </td>
+        <td width="80%">
+            @for($i = 1; $i <= 3; $i++)
+                @if($datiVeicolo->{"verbale_violazione_numero_$i"})
+                    <table>
+                        <tr>
+                            <td width="80%">
+                                <table>
+                                    <tr>
+                                        <td width="100%" class="">
+                                            <b>VERBALE VIOLAZIONE NUMERO</b>
+                                            {{ $datiVeicolo->{"verbale_violazione_numero_$i"} }}
+                                        </td>
+                                    </tr>
+                                    @if($datiVeicolo->{"articolo_violato_$i"})
+                                        <tr>
+                                            <td width="100%" class="">
+                                                <b>ARTICOLO VIOLATO</b>
+                                                {{ $datiVeicolo->{"articolo_violato_$i"} }}
+                                            </td>
+                                        </tr>
+                                    @endif
+                                    @if($datiVeicolo->{"cds_$i"})
+                                        <tr>
+                                            <td width="100%" class="">
+                                                <b>CDS</b>
+                                                {{ $datiVeicolo->{"cds_$i"} }}
+                                            </td>
+                                        </tr>
+                                    @endif
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
+                @endif
+            @endfor
+        </td>
+    </tr>
+</table>

Разница между файлами не показана из-за своего большого размера
+ 459 - 629
resources/views/pdf/verbale.blade.php


Некоторые файлы не были показаны из-за большого количества измененных файлов