|
@@ -0,0 +1,3444 @@
|
|
|
|
|
+<?php
|
|
|
|
|
+
|
|
|
|
|
+namespace App\Http\Livewire;
|
|
|
|
|
+
|
|
|
|
|
+use Livewire\Component;
|
|
|
|
|
+
|
|
|
|
|
+use Livewire\WithPagination;
|
|
|
|
|
+
|
|
|
|
|
+use Livewire\WithFileUploads;
|
|
|
|
|
+
|
|
|
|
|
+use Barryvdh\DomPDF\Facade\Pdf;
|
|
|
|
|
+
|
|
|
|
|
+class Report extends Component
|
|
|
|
|
+{
|
|
|
|
|
+
|
|
|
|
|
+ use WithPagination;
|
|
|
|
|
+
|
|
|
|
|
+ use WithFileUploads;
|
|
|
|
|
+
|
|
|
|
|
+ protected $paginationTheme = 'bootstrap';
|
|
|
|
|
+
|
|
|
|
|
+ public $title = 'Verbali';
|
|
|
|
|
+
|
|
|
|
|
+ public $loadPatente;
|
|
|
|
|
+ public $loadTarga;
|
|
|
|
|
+
|
|
|
|
|
+ public $segnaletiche = array(
|
|
|
|
|
+ array('id' => 1, 'name' => 'Segnaletica assente'),
|
|
|
|
|
+ array('id' => 2, 'name' => 'Segnaletica verticale'),
|
|
|
|
|
+ array('id' => 3, 'name' => 'Segnaletica orizzontale'),
|
|
|
|
|
+ array('id' => 4, 'name' => 'Segnaletica verticale e orizzontale'),
|
|
|
|
|
+ array('id' => 5, 'name' => 'Segnaletica temporanea di cantiere'),
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ public $linee = array(
|
|
|
|
|
+ array('id' => 4, 'name' => 'Assente'),
|
|
|
|
|
+ array('id' => 1, 'name' => 'Continua'),
|
|
|
|
|
+ array('id' => 2, 'name' => 'Tratteggiata'),
|
|
|
|
|
+ array('id' => 3, 'name' => 'Tratteggiata in corrispondenza di'),
|
|
|
|
|
+ array('id' => 5, 'name' => 'Singola'),
|
|
|
|
|
+ array('id' => 6, 'name' => 'Doppia'),
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ public $div_segnaletica_verticale_2 = false;
|
|
|
|
|
+ public $div_segnaletica_verticale_3 = false;
|
|
|
|
|
+ public $div_segnaletica_verticale_4 = false;
|
|
|
|
|
+
|
|
|
|
|
+ public $div_segnaletica_orizzontale_2 = false;
|
|
|
|
|
+ public $div_segnaletica_orizzontale_3 = false;
|
|
|
|
|
+ public $div_segnaletica_orizzontale_4 = false;
|
|
|
|
|
+
|
|
|
|
|
+ public $search, $dataId, $update = false, $add = false;
|
|
|
|
|
+
|
|
|
|
|
+ public $name,
|
|
|
|
|
+ $validated,
|
|
|
|
|
+ $necessita_nulla_osta,
|
|
|
|
|
+ $data_nulla_osta,
|
|
|
|
|
+ $protocollo_num,
|
|
|
|
|
+ $protocollo_ord,
|
|
|
|
|
+ $protocollo_anno,
|
|
|
|
|
+ $verificatosi_in_data,
|
|
|
|
|
+ $verificatosi_in_data_ora,
|
|
|
|
|
+ $verificatosi_in_data_minuti,
|
|
|
|
|
+ $utg,
|
|
|
|
|
+ $utg_data,
|
|
|
|
|
+ $utg_protocollo,
|
|
|
|
|
+ $ag,
|
|
|
|
|
+ $ag_data,
|
|
|
|
|
+ $ag_protocollo,
|
|
|
|
|
+ $incidente_con_danni_a_cose,
|
|
|
|
|
+ $incidente_con_feriti,
|
|
|
|
|
+ $incidente_con_feriti_lesioni_lievi,
|
|
|
|
|
+ $incidente_con_feriti_lesioni_gravi,
|
|
|
|
|
+ $incidente_mortale,
|
|
|
|
|
+ $localita_uno,
|
|
|
|
|
+ $localita_due,
|
|
|
|
|
+ $intersezione_con,
|
|
|
|
|
+ $prossimita_civico,
|
|
|
|
|
+ $prossimita_palo_luce,
|
|
|
|
|
+ $prossimita_chilometro,
|
|
|
|
|
+ $note_aggiuntive;
|
|
|
|
|
+
|
|
|
|
|
+ public $accertatore_1,
|
|
|
|
|
+ $grado_accertatore_1,
|
|
|
|
|
+ $accertatore_2,
|
|
|
|
|
+ $grado_accertatore_2,
|
|
|
|
|
+ $accertatore_3,
|
|
|
|
|
+ $grado_accertatore_3,
|
|
|
|
|
+ $accertatore_4,
|
|
|
|
|
+ $grado_accertatore_4,
|
|
|
|
|
+ $accertatore_5,
|
|
|
|
|
+ $grado_accertatore_5;
|
|
|
|
|
+
|
|
|
|
|
+ public $rilievi_id;
|
|
|
|
|
+
|
|
|
|
|
+ public $tipo_segnalazione;
|
|
|
|
|
+
|
|
|
|
|
+ public $parti_coinvolte;
|
|
|
|
|
+
|
|
|
|
|
+ public $segnalazione_data,
|
|
|
|
|
+ $segnalazione_ora,
|
|
|
|
|
+ $segnalazione_minuti,
|
|
|
|
|
+ $segnalazione_altro,
|
|
|
|
|
+ $ausilio_altri_enti_motivo,
|
|
|
|
|
+ $ausilio_altri_enti_ora_intervento,
|
|
|
|
|
+ $ausilio_altri_enti_minuti_intervento,
|
|
|
|
|
+ $ditta_intervenuta,
|
|
|
|
|
+ $ripristino_ora_chiamata,
|
|
|
|
|
+ $ripristino_minuti_chiamata,
|
|
|
|
|
+ $ripristino_ora_arrivo,
|
|
|
|
|
+ $ripristino_minuti_arrivo,
|
|
|
|
|
+ $danni_cose_diverse_da_veicoli;
|
|
|
|
|
+
|
|
|
|
|
+ public $sinistro_ora,
|
|
|
|
|
+ $sinistro_minuti,
|
|
|
|
|
+ $localizzazione_incidente,
|
|
|
|
|
+ $localizzazione_incidente_altro,
|
|
|
|
|
+ $condizioni_atmosferiche,
|
|
|
|
|
+ $condizioni_atmosferiche_altro,
|
|
|
|
|
+ $nomenclatura_strada,
|
|
|
|
|
+ $nomenclatura_strada_numero,
|
|
|
|
|
+ $nomenclatura_strada_altro,
|
|
|
|
|
+ $pavimentazione,
|
|
|
|
|
+ $pavimentazione_altro,
|
|
|
|
|
+ $condizione_strada,
|
|
|
|
|
+ $condizione_strada_altro,
|
|
|
|
|
+ $fondo_stradale,
|
|
|
|
|
+ $fondo_stradale_specifica,
|
|
|
|
|
+ $visibilita,
|
|
|
|
|
+ $visibilita_specifica,
|
|
|
|
|
+ $particolarita_strada,
|
|
|
|
|
+ $particolarita_strada_specifica,
|
|
|
|
|
+ $tipo_strada,
|
|
|
|
|
+ $tipo_strada_altro,
|
|
|
|
|
+ $traffico;
|
|
|
|
|
+
|
|
|
|
|
+ public $segnaletica,
|
|
|
|
|
+ $segnaletica_verticale_1_via,
|
|
|
|
|
+ $segnaletica_verticale_1_altro,
|
|
|
|
|
+ $segnaletica_verticale_1_limite_velocita,
|
|
|
|
|
+ $segnaletica_verticale_1_direzione,
|
|
|
|
|
+ $segnaletica_verticale_1_pannello_integrativo,
|
|
|
|
|
+ $segnaletica_verticale_2_via,
|
|
|
|
|
+ $segnaletica_verticale_2_altro,
|
|
|
|
|
+ $segnaletica_verticale_2_limite_velocita,
|
|
|
|
|
+ $segnaletica_verticale_2_direzione,
|
|
|
|
|
+ $segnaletica_verticale_2_pannello_integrativo,
|
|
|
|
|
+ $segnaletica_verticale_3_via,
|
|
|
|
|
+ $segnaletica_verticale_3_altro,
|
|
|
|
|
+ $segnaletica_verticale_3_limite_velocita,
|
|
|
|
|
+ $segnaletica_verticale_3_direzione,
|
|
|
|
|
+ $segnaletica_verticale_3_pannello_integrativo,
|
|
|
|
|
+ $segnaletica_verticale_4_via,
|
|
|
|
|
+ $segnaletica_verticale_4_altro,
|
|
|
|
|
+ $segnaletica_verticale_4_limite_velocita,
|
|
|
|
|
+ $segnaletica_verticale_4_direzione,
|
|
|
|
|
+ $segnaletica_verticale_4_pannello_integrativo,
|
|
|
|
|
+ $segnaletica_orizzontale_1_via,
|
|
|
|
|
+ $segnaletica_orizzontale_1_linea_margine,
|
|
|
|
|
+ $segnaletica_orizzontale_1_linea_margine_specifica,
|
|
|
|
|
+ $segnaletica_orizzontale_1_linea_mezzeria,
|
|
|
|
|
+ $segnaletica_orizzontale_1_linea_mezzeria_specifica,
|
|
|
|
|
+ $segnaletica_orizzontale_1_altro,
|
|
|
|
|
+ $segnaletica_orizzontale_1_direzione,
|
|
|
|
|
+ $segnaletica_orizzontale_2_via,
|
|
|
|
|
+ $segnaletica_orizzontale_2_linea_margine,
|
|
|
|
|
+ $segnaletica_orizzontale_2_linea_margine_specifica,
|
|
|
|
|
+ $segnaletica_orizzontale_2_linea_mezzeria,
|
|
|
|
|
+ $segnaletica_orizzontale_2_linea_mezzeria_specifica,
|
|
|
|
|
+ $segnaletica_orizzontale_2_altro,
|
|
|
|
|
+ $segnaletica_orizzontale_2_direzione,
|
|
|
|
|
+ $segnaletica_orizzontale_3_via,
|
|
|
|
|
+ $segnaletica_orizzontale_3_linea_margine,
|
|
|
|
|
+ $segnaletica_orizzontale_3_linea_margine_specifica,
|
|
|
|
|
+ $segnaletica_orizzontale_3_linea_mezzeria,
|
|
|
|
|
+ $segnaletica_orizzontale_3_linea_mezzeria_specifica,
|
|
|
|
|
+ $segnaletica_orizzontale_3_altro,
|
|
|
|
|
+ $segnaletica_orizzontale_3_direzione,
|
|
|
|
|
+ $segnaletica_orizzontale_4_via,
|
|
|
|
|
+ $segnaletica_orizzontale_4_linea_margine,
|
|
|
|
|
+ $segnaletica_orizzontale_4_linea_margine_specifica,
|
|
|
|
|
+ $segnaletica_orizzontale_4_linea_mezzeria,
|
|
|
|
|
+ $segnaletica_orizzontale_4_linea_mezzeria_specifica,
|
|
|
|
|
+ $segnaletica_orizzontale_4_altro,
|
|
|
|
|
+ $segnaletica_orizzontale_4_direzione;
|
|
|
|
|
+
|
|
|
|
|
+ public $provinces = [];
|
|
|
|
|
+
|
|
|
|
|
+ public $tipo_urto = [];
|
|
|
|
|
+
|
|
|
|
|
+ // Dati
|
|
|
|
|
+ // public $localita = array();
|
|
|
|
|
+ // public $stradario = array();
|
|
|
|
|
+ public $rilievi = array();
|
|
|
|
|
+ public $tipi_danno = array();
|
|
|
|
|
+ public $parti_macchina = array();
|
|
|
|
|
+ public $entita_danni = array();
|
|
|
|
|
+ public $effetto_danni = array();
|
|
|
|
|
+ public $tipi_urto = array();
|
|
|
|
|
+ public $tipi_segnalazioni = array();
|
|
|
|
|
+ public $pervenute_da = array();
|
|
|
|
|
+ public $altri_enti = array();
|
|
|
|
|
+ public $materiali = array();
|
|
|
|
|
+ public $nomenclature = array();
|
|
|
|
|
+ public $condizioni_atmosferiche_array = array();
|
|
|
|
|
+ public $condizioni_luce_array = array();
|
|
|
|
|
+ public $pavimentazioni = array();
|
|
|
|
|
+ public $condizioni_strada = array();
|
|
|
|
|
+ public $fondi_stradali = array();
|
|
|
|
|
+ public $particolarita_strade = array();
|
|
|
|
|
+ public $tipi_strade = array();
|
|
|
|
|
+ public $grado_accertatore = array();
|
|
|
|
|
+ // public $veicoli = array();
|
|
|
|
|
+ // public $anagrafiche = array();
|
|
|
|
|
+ public $tipi_veicolo = array();
|
|
|
|
|
+ public $marche = array();
|
|
|
|
|
+ public $modelli = array();
|
|
|
|
|
+ public $polizze = array();
|
|
|
|
|
+ public $allegatiType = array();
|
|
|
|
|
+
|
|
|
|
|
+ // Anagrafica
|
|
|
|
|
+ public $currentAnagrafica;
|
|
|
|
|
+ public $anag_type;
|
|
|
|
|
+ public $anag_firstname;
|
|
|
|
|
+ public $anag_lastname;
|
|
|
|
|
+ public $anag_gender;
|
|
|
|
|
+ public $anag_birth_date;
|
|
|
|
|
+ public $anag_birth_town_id;
|
|
|
|
|
+ public $anag_birth_prov_id;
|
|
|
|
|
+ public $anag_residenza_town_id;
|
|
|
|
|
+ public $anag_residenza_prov_id;
|
|
|
|
|
+ public $anag_residenza_address;
|
|
|
|
|
+ public $anag_residenza_cap;
|
|
|
|
|
+ public $anag_mobile;
|
|
|
|
|
+ public $anag_sedicente;
|
|
|
|
|
+ public $anag_documento_tipo;
|
|
|
|
|
+ public $anag_documento_patente_cat;
|
|
|
|
|
+ public $anag_documento_tipo_altro;
|
|
|
|
|
+ public $anag_documento_numero;
|
|
|
|
|
+ public $anag_documento_rilasciato_da;
|
|
|
|
|
+ public $anag_documento_rilasciato_da_altro;
|
|
|
|
|
+ public $anag_foreign_country;
|
|
|
|
|
+ public $anag_documento_rilasciato_da_di_foreign_localita;
|
|
|
|
|
+ public $anag_documento_rilasciato_da_di_foreign_country;
|
|
|
|
|
+ public $anag_documento_rilasciato_da_prov_id;
|
|
|
|
|
+ public $anag_documento_rilasciato_da_town_id;
|
|
|
|
|
+ public $anag_documento_rilasciato_il;
|
|
|
|
|
+ public $anag_documento_scadenza_il;
|
|
|
|
|
+ public $anag_state;
|
|
|
|
|
+ public $anag_nazionalita;
|
|
|
|
|
+ public $anag_nazione_straniera;
|
|
|
|
|
+ public $anag_localita_straniera;
|
|
|
|
|
+ public $anag_rag_soc;
|
|
|
|
|
+ public $anag_vat;
|
|
|
|
|
+ public $anag_sede_legale_town_id;
|
|
|
|
|
+ public $anag_sede_legale_prov_id;
|
|
|
|
|
+ public $anag_sede_legale_address;
|
|
|
|
|
+ public $anag_sede_legale_cap;
|
|
|
|
|
+ public $anag_phone;
|
|
|
|
|
+ public $anag_foreign_birth_country;
|
|
|
|
|
+ public $anag_foreign_birth_city;
|
|
|
|
|
+ public $anag_foreign_residence_country;
|
|
|
|
|
+ public $anag_foreign_residence_city;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // Veicolo
|
|
|
|
|
+ public $currentVeicolo;
|
|
|
|
|
+ public $vei_tipo_id;
|
|
|
|
|
+ public $vei_marca_id;
|
|
|
|
|
+ public $vei_marca_altro;
|
|
|
|
|
+ public $vei_modello_id;
|
|
|
|
|
+ public $vei_modello_altro;
|
|
|
|
|
+ public $vei_colore;
|
|
|
|
|
+ public $vei_targa;
|
|
|
|
|
+ public $vei_carta_circolazione;
|
|
|
|
|
+ public $vei_carta_circolazione_rilasciata_da;
|
|
|
|
|
+ public $vei_carta_circolazione_rilasciata_da_altro;
|
|
|
|
|
+ public $vei_foreign_country;
|
|
|
|
|
+ public $vei_carta_circolazione_rilasciata_da_di_foreign_country;
|
|
|
|
|
+ public $vei_carta_circolazione_rilasciata_da_di_foreign_localita;
|
|
|
|
|
+ public $vei_carta_circolazione_rilasciata_da_di;
|
|
|
|
|
+ public $vei_carta_circolazione_rilasciata_il;
|
|
|
|
|
+ public $vei_data_ultima_revisione;
|
|
|
|
|
+ public $vei_cilindrata;
|
|
|
|
|
+ public $vei_peso_complessivo;
|
|
|
|
|
+ public $vei_destinazione_uso;
|
|
|
|
|
+ public $vei_state;
|
|
|
|
|
+
|
|
|
|
|
+ public $currentProprietario;
|
|
|
|
|
+ public $currentCoproprietario;
|
|
|
|
|
+ public $currentConducente;
|
|
|
|
|
+
|
|
|
|
|
+ // Data vaicoli
|
|
|
|
|
+ public $currentTeste;
|
|
|
|
|
+ public $currentProgressive;
|
|
|
|
|
+ public $data_chilometri_percorsi;
|
|
|
|
|
+ public $data_stato_veicolo;
|
|
|
|
|
+ public $data_polizze;
|
|
|
|
|
+ public $data_proprietari;
|
|
|
|
|
+ public $data_coproprietari;
|
|
|
|
|
+ public $data_conducente_uguale_proprietario;
|
|
|
|
|
+ public $data_conducenti;
|
|
|
|
|
+ public $data_infortunato;
|
|
|
|
|
+ public $data_infortunato_ospedale;
|
|
|
|
|
+ public $data_patente_al_seguito;
|
|
|
|
|
+ public $data_generalizzato;
|
|
|
|
|
+ public $data_generalizzato_altrove;
|
|
|
|
|
+ public $data_posizione_statica_finale;
|
|
|
|
|
+ public $data_danni_visibili_riportati;
|
|
|
|
|
+ public $data_danni_visibili_pre_esistenti;
|
|
|
|
|
+ public $data_destinazione_veicolo;
|
|
|
|
|
+ public $data_destinazione_veicolo_affidato_a;
|
|
|
|
|
+ public $data_destinazione_veicolo_sequestro_num_art;
|
|
|
|
|
+ public $data_destinazione_veicolo_amministrativo_num;
|
|
|
|
|
+ public $data_destinazione_veicolo_amministrativo_num_art_violato;
|
|
|
|
|
+ public $data_destinazione_veicolo_amministrativo_cds;
|
|
|
|
|
+ public $data_circostanze_presunte_incidente;
|
|
|
|
|
+ public $data_stato_pneumatici;
|
|
|
|
|
+ public $data_marca_pneumatici;
|
|
|
|
|
+ public $data_misura_pneumatici;
|
|
|
|
|
+ public $data_dispositivi_ottici;
|
|
|
|
|
+ public $data_tergicristalli;
|
|
|
|
|
+ public $data_segnale_pericolo;
|
|
|
|
|
+ public $data_abs;
|
|
|
|
|
+ public $data_gps;
|
|
|
|
|
+ public $data_marcia_inserita;
|
|
|
|
|
+ public $data_cristallo;
|
|
|
|
|
+ public $data_cristallo_posizione;
|
|
|
|
|
+ public $data_specchio_retrovisore;
|
|
|
|
|
+ public $data_specchio_lat_dx;
|
|
|
|
|
+ public $data_specchio_lat_sx;
|
|
|
|
|
+ public $data_attivazione_airbag;
|
|
|
|
|
+ public $data_airbag_posizione;
|
|
|
|
|
+ public $data_alcool_test;
|
|
|
|
|
+ public $data_alcool_test_esito;
|
|
|
|
|
+ public $data_drug_test;
|
|
|
|
|
+ public $data_drug_test_esito;
|
|
|
|
|
+ public $data_sistema_ritenuta_minori;
|
|
|
|
|
+ public $data_sistema_ritenuta_minori_omologazione;
|
|
|
|
|
+ public $data_verbale_violazione_numero_1;
|
|
|
|
|
+ public $data_articolo_violato_1;
|
|
|
|
|
+ public $data_cds_1;
|
|
|
|
|
+ public $data_verbale_violazione_numero_2;
|
|
|
|
|
+ public $data_articolo_violato_2;
|
|
|
|
|
+ public $data_cds_2;
|
|
|
|
|
+ public $data_verbale_violazione_numero_3;
|
|
|
|
|
+ public $data_articolo_violato_3;
|
|
|
|
|
+ public $data_cds_3;
|
|
|
|
|
+ public $data_conducente_patente_numero;
|
|
|
|
|
+ public $data_conducente_patente_categoria;
|
|
|
|
|
+ public $data_conducente_patente_rilasciata_da;
|
|
|
|
|
+ public $data_conducente_patente_rilasciata_da_altro;
|
|
|
|
|
+ public $data_conducente_patente_rilasciata_il;
|
|
|
|
|
+ public $data_conducente_patente_scadenza;
|
|
|
|
|
+ public $data_conducente_patente_prescrizioni;
|
|
|
|
|
+ public $data_conducente_patente_limitazioni_art_117_1;
|
|
|
|
|
+ public $data_conducente_patente_limitazioni_art_117_2;
|
|
|
|
|
+ public $data_conducente_patente_abilitazione;
|
|
|
|
|
+ public $data_conducente_patente_abilitazione_numero;
|
|
|
|
|
+ public $data_conducente_patente_abilitazione_rilasciata_da;
|
|
|
|
|
+ public $data_conducente_patente_abilitazione_rilasciata_il;
|
|
|
|
|
+ public $data_conducente_documento;
|
|
|
|
|
+ public $data_conducente_documento_numero;
|
|
|
|
|
+ public $data_conducente_sedicente;
|
|
|
|
|
+
|
|
|
|
|
+ public $data_tipo_danno;
|
|
|
|
|
+ public $data_entita_danno;
|
|
|
|
|
+ public $data_effetto_danno;
|
|
|
|
|
+ public $data_parte_macchina;
|
|
|
|
|
+
|
|
|
|
|
+ public $data_tipo_danno_2;
|
|
|
|
|
+ public $data_entita_danno_2;
|
|
|
|
|
+ public $data_effetto_danno_2;
|
|
|
|
|
+ public $data_parte_macchina_2;
|
|
|
|
|
+
|
|
|
|
|
+ public $data_tipo_danno_3;
|
|
|
|
|
+ public $data_entita_danno_3;
|
|
|
|
|
+ public $data_effetto_danno_3;
|
|
|
|
|
+ public $data_parte_macchina_3;
|
|
|
|
|
+ public $data_tipo_danno_4;
|
|
|
|
|
+ public $data_entita_danno_4;
|
|
|
|
|
+ public $data_effetto_danno_4;
|
|
|
|
|
+ public $data_parte_macchina_4;
|
|
|
|
|
+
|
|
|
|
|
+ public $data_cinture_conducente;
|
|
|
|
|
+ public $data_cinture_passeggeri_0;
|
|
|
|
|
+ public $data_cinture_passeggeri_1;
|
|
|
|
|
+ public $data_cinture_passeggeri_2;
|
|
|
|
|
+ public $data_cinture_passeggeri_3;
|
|
|
|
|
+
|
|
|
|
|
+ public $data_casco_conducente;
|
|
|
|
|
+ public $data_casco_passeggero;
|
|
|
|
|
+ public $data_casco_omologazione_conducente;
|
|
|
|
|
+ public $data_casco_omologazione_passeggero;
|
|
|
|
|
+
|
|
|
|
|
+ public $data_passeggero_0;
|
|
|
|
|
+ public $data_infortunato_0;
|
|
|
|
|
+ public $data_infortunato_ospedale_0;
|
|
|
|
|
+
|
|
|
|
|
+ public $data_passeggero_1;
|
|
|
|
|
+ public $data_infortunato_1;
|
|
|
|
|
+ public $data_infortunato_ospedale_1;
|
|
|
|
|
+
|
|
|
|
|
+ public $data_passeggero_2;
|
|
|
|
|
+ public $data_infortunato_2;
|
|
|
|
|
+ public $data_infortunato_ospedale_2;
|
|
|
|
|
+
|
|
|
|
|
+ public $data_passeggero_3;
|
|
|
|
|
+ public $data_infortunato_3;
|
|
|
|
|
+ public $data_infortunato_ospedale_3;
|
|
|
|
|
+
|
|
|
|
|
+ public $data_infortunato_extra_0;
|
|
|
|
|
+ public $data_infortunato_extra_1;
|
|
|
|
|
+ public $data_infortunato_extra_2;
|
|
|
|
|
+ public $data_infortunato_extra_3;
|
|
|
|
|
+
|
|
|
|
|
+ public $data_testi_oculari_0;
|
|
|
|
|
+ public $data_testi_oculari_stato_0;
|
|
|
|
|
+ public $data_testi_oculari_1;
|
|
|
|
|
+ public $data_testi_oculari_stato_1;
|
|
|
|
|
+ public $data_testi_oculari_2;
|
|
|
|
|
+ public $data_testi_oculari_stato_2;
|
|
|
|
|
+ public $data_testi_oculari_3;
|
|
|
|
|
+ public $data_testi_oculari_stato_3;
|
|
|
|
|
+
|
|
|
|
|
+ // Pedoni
|
|
|
|
|
+
|
|
|
|
|
+ public $currentPedone;
|
|
|
|
|
+ public $generalizzato;
|
|
|
|
|
+ public $generalizzato_altrove;
|
|
|
|
|
+ public $infortunato;
|
|
|
|
|
+ public $infortunato_ospedale;
|
|
|
|
|
+ public $pedone_posizione;
|
|
|
|
|
+ public $pedone_posizione_desc;
|
|
|
|
|
+ public $pedone_referto;
|
|
|
|
|
+ public $pedone_prognosi;
|
|
|
|
|
+ public $pedone_pioggia;
|
|
|
|
|
+ public $pedone_ombrello;
|
|
|
|
|
+ public $pedone_notte;
|
|
|
|
|
+ public $pedone_abiti_scuri;
|
|
|
|
|
+ public $verbale_violazione_numero;
|
|
|
|
|
+ public $articolo_violato;
|
|
|
|
|
+ public $cds;
|
|
|
|
|
+
|
|
|
|
|
+ public $noteText;
|
|
|
|
|
+ public $notes;
|
|
|
|
|
+
|
|
|
|
|
+ public $richiestaId;
|
|
|
|
|
+ public $richiestaAnagrafica;
|
|
|
|
|
+ public $richiestaData;
|
|
|
|
|
+ public $richiestaConsegna;
|
|
|
|
|
+ public $richiestaText;
|
|
|
|
|
+ public $richieste;
|
|
|
|
|
+
|
|
|
|
|
+ public $allegatoId;
|
|
|
|
|
+ public $allegatoType;
|
|
|
|
|
+ public $allegatoGallery;
|
|
|
|
|
+ public $allegatoName;
|
|
|
|
|
+ public $allegatoVisible;
|
|
|
|
|
+ public $allegatoFiles;
|
|
|
|
|
+ public $allegatiFiles;
|
|
|
|
|
+ public $allegatiImmagini;
|
|
|
|
|
+ public $allegatiDocumenti;
|
|
|
|
|
+
|
|
|
|
|
+ // Accertatore
|
|
|
|
|
+ public $currentAccertatore;
|
|
|
|
|
+ public $currentAccertatoreNumero;
|
|
|
|
|
+ public $accertatore_nome;
|
|
|
|
|
+ public $accertatore_cognome;
|
|
|
|
|
+ public $accertatore_grado;
|
|
|
|
|
+ public $accertatore_username;
|
|
|
|
|
+ public $accertatore_email;
|
|
|
|
|
+ public $accertatore_password;
|
|
|
|
|
+ public $accertatore_password_conferma;
|
|
|
|
|
+
|
|
|
|
|
+ public $allegati = [];
|
|
|
|
|
+
|
|
|
|
|
+ public function updatedAllegati()
|
|
|
|
|
+ {
|
|
|
|
|
+ foreach ($this->allegati as $allegato)
|
|
|
|
|
+ {
|
|
|
|
|
+ $name = $allegato->getClientOriginalName(); // . '.'.$allegato->extension();
|
|
|
|
|
+ $allegato->storeAs('public', $name);
|
|
|
|
|
+ $this->allegatiFiles[] = $name;
|
|
|
|
|
+ }
|
|
|
|
|
+ $this->emit('attachments', implode("|", $this->allegatiFiles));
|
|
|
|
|
+ $this->allegati = [];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ protected $rules = [
|
|
|
|
|
+ //'name' => 'required'
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ protected $messages = [
|
|
|
|
|
+ 'localita_uno.required' => 'Il campo località è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'localita_due.required' => 'Il campo indirizzo è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'verificatosi_in_data.required' => 'Il campo verificatosi in data è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'verificatosi_in_data_ora.required' => 'Il campo verificatosi alle ore è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'verificatosi_in_data_minuti.required' => 'Il campo verificatosi alle ore/minuti è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'rilievi_id.required' => 'Il campo tipo di rilievo è obbligatorio per la validazione del verbale',
|
|
|
|
|
+ 'segnalazione_data.required' => 'Il campo segnalazione data è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'segnalazione_ora.required' => 'Il campo ora segnalazione è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'segnalazione_minuti.required' => 'Il campo minuti segnalazione è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'sinistro_ora.required' => 'Il campo ora sinistro è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'sinistro_minuti.required' => 'Il campo minuti intervento è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'localizzazione_incidente.required' => 'Il campo localizzazione incidente strada è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'nomenclatura_strada.required' => 'Il campo nomenclatura strada è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'condizioni_atmosferiche.required' => 'Il campo condizioni atmosferiche è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'pavimentazione.required' => 'Il campo pavimentazione è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'condizione_strada.required' => 'Il campo condizione strada è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'fondo_stradale.required' => 'Il campo fondo stradale è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'visibilita.required' => 'Il campo visibilita è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ 'particolarita_strada.required' => 'Il campo particolarità strada è obbligatorio ai fini della validazione del verbale',
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ public function resetFields(){
|
|
|
|
|
+ $this->name = '';
|
|
|
|
|
+ $this->validated = false;
|
|
|
|
|
+ $this->necessita_nulla_osta = false;
|
|
|
|
|
+ $this->data_nulla_osta = $this->dateToNull();
|
|
|
|
|
+ $this->protocollo_num = '';
|
|
|
|
|
+ $this->protocollo_ord = '';
|
|
|
|
|
+ $this->protocollo_anno = '';
|
|
|
|
|
+ $this->verificatosi_in_data = null;
|
|
|
|
|
+ $this->verificatosi_in_data_ora = '';
|
|
|
|
|
+ $this->verificatosi_in_data_minuti = '';
|
|
|
|
|
+ $this->utg = false;
|
|
|
|
|
+ $this->utg_data = null;
|
|
|
|
|
+ $this->utg_protocollo = '';
|
|
|
|
|
+ $this->ag = false;
|
|
|
|
|
+ $this->ag_data = null;
|
|
|
|
|
+ $this->ag_protocollo = '';
|
|
|
|
|
+ $this->incidente_con_danni_a_cose = false;
|
|
|
|
|
+ $this->incidente_con_feriti = false;
|
|
|
|
|
+ $this->incidente_con_feriti_lesioni_lievi = false;
|
|
|
|
|
+ $this->incidente_con_feriti_lesioni_gravi = false;
|
|
|
|
|
+ $this->incidente_mortale = false;
|
|
|
|
|
+ $this->localita_uno = '';
|
|
|
|
|
+ $this->localita_due = '';
|
|
|
|
|
+ $this->intersezione_con = '';
|
|
|
|
|
+ $this->prossimita_civico = '';
|
|
|
|
|
+ $this->prossimita_palo_luce = '';
|
|
|
|
|
+ $this->prossimita_chilometro = '';
|
|
|
|
|
+ $this->note_aggiuntive = '';
|
|
|
|
|
+
|
|
|
|
|
+ $this->accertatore_1 = '';
|
|
|
|
|
+ $this->grado_accertatore_1 = '';
|
|
|
|
|
+ $this->accertatore_2 = '';
|
|
|
|
|
+ $this->grado_accertatore_2 = '';
|
|
|
|
|
+ $this->accertatore_3 = '';
|
|
|
|
|
+ $this->grado_accertatore_3 = '';
|
|
|
|
|
+ $this->accertatore_4 = '';
|
|
|
|
|
+ $this->grado_accertatore_4 = '';
|
|
|
|
|
+ $this->accertatore_5 = '';
|
|
|
|
|
+ $this->grado_accertatore_5 = '';
|
|
|
|
|
+
|
|
|
|
|
+ $this->parti_coinvolte = [];
|
|
|
|
|
+
|
|
|
|
|
+ $this->rilievi_id = null;
|
|
|
|
|
+ $this->tipo_urto = [];
|
|
|
|
|
+
|
|
|
|
|
+ $this->tipo_segnalazione = [];
|
|
|
|
|
+ $this->segnalazione_pervenuta_da = [];
|
|
|
|
|
+ $this->ausilio_altri_enti = [];
|
|
|
|
|
+ $this->segnalazione_data = null;
|
|
|
|
|
+ $this->segnalazione_ora = '';
|
|
|
|
|
+ $this->segnalazione_minuti = '';
|
|
|
|
|
+ $this->segnalazione_altro = '';
|
|
|
|
|
+ $this->ausilio_altri_enti_motivo = '';
|
|
|
|
|
+ $this->ausilio_altri_enti_ora_intervento = '';
|
|
|
|
|
+ $this->ausilio_altri_enti_minuti_intervento = '';
|
|
|
|
|
+ $this->ditta_intervenuta = '';
|
|
|
|
|
+ $this->ripristino_ora_chiamata = '';
|
|
|
|
|
+ $this->ripristino_minuti_chiamata = '';
|
|
|
|
|
+ $this->ripristino_ora_arrivo = '';
|
|
|
|
|
+ $this->ripristino_minuti_arrivo = '';
|
|
|
|
|
+ $this->materiale_recuperato = [];
|
|
|
|
|
+ $this->danni_cose_diverse_da_veicoli = '';
|
|
|
|
|
+
|
|
|
|
|
+ $this->condizioni_luce = [];
|
|
|
|
|
+ $this->tipo_strada = [];
|
|
|
|
|
+ $this->sinistro_ora = '';
|
|
|
|
|
+ $this->sinistro_minuti = '';
|
|
|
|
|
+ $this->localizzazione_incidente = '';
|
|
|
|
|
+ $this->localizzazione_incidente_altro = '';
|
|
|
|
|
+ $this->condizioni_atmosferiche = '';
|
|
|
|
|
+ $this->condizioni_atmosferiche_altro = '';
|
|
|
|
|
+ $this->nomenclatura_strada = '';
|
|
|
|
|
+ $this->nomenclatura_strada_numero = '';
|
|
|
|
|
+ $this->nomenclatura_strada_altro = '';
|
|
|
|
|
+ $this->pavimentazione = '';
|
|
|
|
|
+ $this->pavimentazione_altro = '';
|
|
|
|
|
+ $this->condizione_strada = '';
|
|
|
|
|
+ $this->condizione_strada_altro = '';
|
|
|
|
|
+ $this->fondo_stradale = '';
|
|
|
|
|
+ $this->fondo_stradale_specifica = '';
|
|
|
|
|
+ $this->visibilita = '';
|
|
|
|
|
+ $this->visibilita_specifica = '';
|
|
|
|
|
+ $this->particolarita_strada = '';
|
|
|
|
|
+ $this->particolarita_strada_specifica = '';
|
|
|
|
|
+ // $this->tipo_strada = '';
|
|
|
|
|
+ $this->tipo_strada_altro = '';
|
|
|
|
|
+ $this->traffico = '';
|
|
|
|
|
+
|
|
|
|
|
+ $this->segnaletica_verticale_1 = [];
|
|
|
|
|
+ $this->segnaletica_verticale_2 = [];
|
|
|
|
|
+ $this->segnaletica_verticale_3 = [];
|
|
|
|
|
+ $this->segnaletica_verticale_4 = [];
|
|
|
|
|
+
|
|
|
|
|
+ $this->segnaletica_orizzontale_1 = [];
|
|
|
|
|
+ $this->segnaletica_orizzontale_2 = [];
|
|
|
|
|
+ $this->segnaletica_orizzontale_3 = [];
|
|
|
|
|
+ $this->segnaletica_orizzontale_4 = [];
|
|
|
|
|
+
|
|
|
|
|
+ $this->segnaletica = '';
|
|
|
|
|
+ $this->segnaletica_verticale_1_via = '';
|
|
|
|
|
+ $this->segnaletica_verticale_1_altro = '';
|
|
|
|
|
+ $this->segnaletica_verticale_1_limite_velocita = '';
|
|
|
|
|
+ $this->segnaletica_verticale_1_direzione = '';
|
|
|
|
|
+ $this->segnaletica_verticale_1_pannello_integrativo = '';
|
|
|
|
|
+ $this->segnaletica_verticale_2_via = '';
|
|
|
|
|
+ $this->segnaletica_verticale_2_altro = '';
|
|
|
|
|
+ $this->segnaletica_verticale_2_limite_velocita = '';
|
|
|
|
|
+ $this->segnaletica_verticale_2_direzione = '';
|
|
|
|
|
+ $this->segnaletica_verticale_2_pannello_integrativo = '';
|
|
|
|
|
+ $this->segnaletica_verticale_3_via = '';
|
|
|
|
|
+ $this->segnaletica_verticale_3_altro = '';
|
|
|
|
|
+ $this->segnaletica_verticale_3_limite_velocita = '';
|
|
|
|
|
+ $this->segnaletica_verticale_3_direzione = '';
|
|
|
|
|
+ $this->segnaletica_verticale_3_pannello_integrativo = '';
|
|
|
|
|
+ $this->segnaletica_verticale_4_via = '';
|
|
|
|
|
+ $this->segnaletica_verticale_4_altro = '';
|
|
|
|
|
+ $this->segnaletica_verticale_4_limite_velocita = '';
|
|
|
|
|
+ $this->segnaletica_verticale_4_direzione = '';
|
|
|
|
|
+ $this->segnaletica_verticale_4_pannello_integrativo = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_via = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_linea_margine = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_linea_margine_specifica = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_linea_mezzeria = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_linea_mezzeria_specifica = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_altro = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_direzione = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_via = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_linea_margine = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_linea_margine_specifica = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_linea_mezzeria = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_linea_mezzeria_specifica = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_altro;
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_direzione;
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_via = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_linea_margine = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_linea_margine_specifica = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_linea_mezzeria = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_linea_mezzeria_specifica = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_altro;
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_direzione;
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_via = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_linea_margine = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_linea_margine_specifica = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_linea_mezzeria = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_linea_mezzeria_specifica = '';
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_altro;
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_direzione;
|
|
|
|
|
+
|
|
|
|
|
+ $this->noteText = '';
|
|
|
|
|
+ $this->notes = [];
|
|
|
|
|
+
|
|
|
|
|
+ $this->richiestaId = 0;
|
|
|
|
|
+ $this->richiestaAnagrafica = null;
|
|
|
|
|
+ $this->richiestaData = null;
|
|
|
|
|
+ $this->richiestaConsegna = null;
|
|
|
|
|
+ $this->richiestaText = '';
|
|
|
|
|
+ $this->richieste = [];
|
|
|
|
|
+
|
|
|
|
|
+ $this->allegatoId = 0;
|
|
|
|
|
+ $this->allegatoType = 0;
|
|
|
|
|
+ $this->allegatoGallery = 0;
|
|
|
|
|
+ $this->allegatoName = '';
|
|
|
|
|
+ $this->allegatoVisible = false;
|
|
|
|
|
+ $this->allegatoFiles = '';
|
|
|
|
|
+ $this->allegatiFiles = [];
|
|
|
|
|
+ $this->allegatiImmagini = [];
|
|
|
|
|
+ $this->allegatiDocumenti = [];
|
|
|
|
|
+
|
|
|
|
|
+ $this->data_testi_oculari_0 = 0;
|
|
|
|
|
+ $this->data_testi_oculari_stato_0 = 0;
|
|
|
|
|
+ $this->data_testi_oculari_1 = 0;
|
|
|
|
|
+ $this->data_testi_oculari_stato_1 = 0;
|
|
|
|
|
+ $this->data_testi_oculari_2 = 0;
|
|
|
|
|
+ $this->data_testi_oculari_stato_2 = 0;
|
|
|
|
|
+ $this->data_testi_oculari_3 = 0;
|
|
|
|
|
+ $this->data_testi_oculari_stato_3 = 0;
|
|
|
|
|
+
|
|
|
|
|
+ $this->div_segnaletica_verticale_2 = false;
|
|
|
|
|
+ $this->div_segnaletica_verticale_3 = false;
|
|
|
|
|
+ $this->div_segnaletica_verticale_4 = false;
|
|
|
|
|
+
|
|
|
|
|
+ $this->div_segnaletica_orizzontale_2 = false;
|
|
|
|
|
+ $this->div_segnaletica_orizzontale_3 = false;
|
|
|
|
|
+ $this->div_segnaletica_orizzontale_4 = false;
|
|
|
|
|
+
|
|
|
|
|
+ $this->emit('load-select');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function showSegnaleticaVerticale()
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!$this->div_segnaletica_verticale_2)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->div_segnaletica_verticale_2 = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!$this->div_segnaletica_verticale_3)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->div_segnaletica_verticale_3 = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!$this->div_segnaletica_verticale_4)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->div_segnaletica_verticale_4 = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function showSegnaleticaOrizzontale()
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!$this->div_segnaletica_orizzontale_2)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->div_segnaletica_orizzontale_2 = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!$this->div_segnaletica_orizzontale_3)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->div_segnaletica_orizzontale_3 = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!$this->div_segnaletica_orizzontale_4)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->div_segnaletica_orizzontale_4 = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function resetAnagrafica()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->loadAnagrafica = '';
|
|
|
|
|
+ $this->currentAnagrafica = 0;
|
|
|
|
|
+ $this->currentPasseggero = 0;
|
|
|
|
|
+ $this->currentInfortunato = 0;
|
|
|
|
|
+ $this->currentProprietario = 0;
|
|
|
|
|
+ $this->currentCoproprietario = 0;
|
|
|
|
|
+ $this->currentConducente = 0;
|
|
|
|
|
+ $this->currentTeste = 0;
|
|
|
|
|
+ //$this->currentProgressive = -1;
|
|
|
|
|
+ $this->anag_type = 0;
|
|
|
|
|
+ $this->anag_firstname = '';
|
|
|
|
|
+ $this->anag_lastname = '';
|
|
|
|
|
+ $this->anag_gender = '';
|
|
|
|
|
+ $this->anag_birth_date = null;
|
|
|
|
|
+ $this->anag_birth_town_id = null;
|
|
|
|
|
+ $this->anag_birth_prov_id = null;
|
|
|
|
|
+ $this->anag_residenza_town_id = null;
|
|
|
|
|
+ $this->anag_residenza_prov_id = null;
|
|
|
|
|
+ $this->anag_residenza_address = '';
|
|
|
|
|
+ $this->anag_residenza_cap = '';
|
|
|
|
|
+ $this->anag_mobile = '';
|
|
|
|
|
+ $this->anag_sedicente;
|
|
|
|
|
+ $this->anag_documento_tipo = '';
|
|
|
|
|
+ $this->anag_documento_patente_cat = '';
|
|
|
|
|
+ $this->anag_documento_tipo_altro = '';
|
|
|
|
|
+ $this->anag_documento_numero = '';
|
|
|
|
|
+ $this->anag_documento_rilasciato_da = '';
|
|
|
|
|
+ $this->anag_documento_rilasciato_da_altro = '';
|
|
|
|
|
+ $this->anag_foreign_country = null;
|
|
|
|
|
+ $this->anag_documento_rilasciato_da_di_foreign_localita = null;
|
|
|
|
|
+ $this->anag_documento_rilasciato_da_di_foreign_country = null;
|
|
|
|
|
+ $this->anag_documento_rilasciato_da_prov_id = null;
|
|
|
|
|
+ $this->anag_documento_rilasciato_da_town_id = null;
|
|
|
|
|
+ $this->anag_documento_rilasciato_il = '';
|
|
|
|
|
+ $this->anag_documento_scadenza_il = '';
|
|
|
|
|
+ $this->anag_state = '';
|
|
|
|
|
+ $this->anag_nazionalita = '';
|
|
|
|
|
+ $this->anag_nazione_straniera = '';
|
|
|
|
|
+ $this->anag_localita_straniera = '';
|
|
|
|
|
+ $this->anag_rag_soc = '';
|
|
|
|
|
+ $this->anag_vat = '';
|
|
|
|
|
+ $this->anag_sede_legale_town_id = null;
|
|
|
|
|
+ $this->anag_sede_legale_prov_id = null;
|
|
|
|
|
+ $this->anag_sede_legale_address = '';
|
|
|
|
|
+ $this->anag_sede_legale_cap = '';
|
|
|
|
|
+ $this->anag_phone = '';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function resetVeicolo()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->loadTarga = '';
|
|
|
|
|
+ $this->currentVeicolo = 0;
|
|
|
|
|
+ $this->currentProgressive = -1;
|
|
|
|
|
+ $this->vei_tipo_id = null;
|
|
|
|
|
+ $this->vei_marca_id = null;
|
|
|
|
|
+ $this->vei_marca_altro = '';
|
|
|
|
|
+ $this->vei_modello_id = null;
|
|
|
|
|
+ $this->vei_modello_altro = '';
|
|
|
|
|
+ $this->vei_colore = '';
|
|
|
|
|
+ $this->vei_targa = '';
|
|
|
|
|
+ $this->vei_carta_circolazione = '';
|
|
|
|
|
+ $this->vei_carta_circolazione_rilasciata_da = '';
|
|
|
|
|
+ $this->vei_carta_circolazione_rilasciata_da_altro = '';
|
|
|
|
|
+ $this->vei_foreign_country = null;
|
|
|
|
|
+ $this->vei_carta_circolazione_rilasciata_da_di_foreign_country = null;
|
|
|
|
|
+ $this->vei_carta_circolazione_rilasciata_da_di_foreign_localita = null;
|
|
|
|
|
+ $this->vei_carta_circolazione_rilasciata_da_di = '';
|
|
|
|
|
+ $this->vei_carta_circolazione_rilasciata_il = null;
|
|
|
|
|
+ $this->vei_data_ultima_revisione = null;
|
|
|
|
|
+ $this->vei_cilindrata = '';
|
|
|
|
|
+ $this->vei_peso_complessivo = '';
|
|
|
|
|
+ $this->vei_destinazione_uso = '';
|
|
|
|
|
+ $this->vei_state = '';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function resetVeicoloData()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->currentVeicolo = 0;
|
|
|
|
|
+ $this->currentProgressive = -1;
|
|
|
|
|
+ $this->data_chilometri_percorsi = 0;
|
|
|
|
|
+ $this->data_stato_veicolo = null;
|
|
|
|
|
+ $this->data_polizze = null;
|
|
|
|
|
+ $this->data_proprietari = null;
|
|
|
|
|
+ $this->data_coproprietari = null;
|
|
|
|
|
+ $this->data_conducente_uguale_proprietario = true;
|
|
|
|
|
+ $this->data_conducenti = null;
|
|
|
|
|
+ $this->data_infortunato = null;
|
|
|
|
|
+ $this->data_infortunato_ospedale = '';
|
|
|
|
|
+ $this->data_patente_al_seguito = null;
|
|
|
|
|
+ $this->data_generalizzato = null;
|
|
|
|
|
+ $this->data_generalizzato_altrove = '';
|
|
|
|
|
+ $this->data_posizione_statica_finale = null;
|
|
|
|
|
+ $this->data_danni_visibili_riportati = '';
|
|
|
|
|
+ $this->data_danni_visibili_pre_esistenti = '';
|
|
|
|
|
+ $this->data_destinazione_veicolo = null;
|
|
|
|
|
+ $this->data_destinazione_veicolo_affidato_a = '';
|
|
|
|
|
+ $this->data_destinazione_veicolo_sequestro_num_art = '';
|
|
|
|
|
+ $this->data_destinazione_veicolo_amministrativo_num = '';
|
|
|
|
|
+ $this->data_destinazione_veicolo_amministrativo_num_art_violato = '';
|
|
|
|
|
+ $this->data_destinazione_veicolo_amministrativo_cds = '';
|
|
|
|
|
+ $this->data_circostanze_presunte_incidente = '';
|
|
|
|
|
+ $this->data_stato_pneumatici = null;
|
|
|
|
|
+ $this->data_marca_pneumatici = '';
|
|
|
|
|
+ $this->data_misura_pneumatici = '';
|
|
|
|
|
+ $this->data_dispositivi_ottici = null;
|
|
|
|
|
+ $this->data_tergicristalli = null;
|
|
|
|
|
+ $this->data_segnale_pericolo = null;
|
|
|
|
|
+ $this->data_abs = null;
|
|
|
|
|
+ $this->data_gps = null;
|
|
|
|
|
+ $this->data_marcia_inserita = null;
|
|
|
|
|
+ $this->data_cristallo = null;
|
|
|
|
|
+ $this->data_cristallo_posizione = '';
|
|
|
|
|
+ $this->data_specchio_retrovisore = null;
|
|
|
|
|
+ $this->data_specchio_lat_dx = null;
|
|
|
|
|
+ $this->data_specchio_lat_sx = null;
|
|
|
|
|
+ $this->data_attivazione_airbag = null;
|
|
|
|
|
+ $this->data_airbag_posizione = '';
|
|
|
|
|
+ $this->data_alcool_test = null;
|
|
|
|
|
+ $this->data_alcool_test_esito = null;
|
|
|
|
|
+ $this->data_drug_test = null;
|
|
|
|
|
+ $this->data_drug_test_esito = null;
|
|
|
|
|
+ $this->data_sistema_ritenuta_minori = null;
|
|
|
|
|
+ $this->data_sistema_ritenuta_minori_omologazione = '';
|
|
|
|
|
+ $this->data_verbale_violazione_numero_1 = '';
|
|
|
|
|
+ $this->data_articolo_violato_1 = '';
|
|
|
|
|
+ $this->data_cds_1 = '';
|
|
|
|
|
+ $this->data_verbale_violazione_numero_2 = '';
|
|
|
|
|
+ $this->data_articolo_violato_2 = '';
|
|
|
|
|
+ $this->cds_2 = '';
|
|
|
|
|
+ $this->data_verbale_violazione_numero_3 = '';
|
|
|
|
|
+ $this->data_articolo_violato_3 = '';
|
|
|
|
|
+ $this->data_cds_3 = '';
|
|
|
|
|
+ $this->data_conducente_patente_numero = '';
|
|
|
|
|
+ $this->data_conducente_patente_categoria = '';
|
|
|
|
|
+ $this->data_conducente_patente_rilasciata_da = null;
|
|
|
|
|
+ $this->data_conducente_patente_rilasciata_da_altro = '';
|
|
|
|
|
+ $this->data_conducente_patente_rilasciata_il = null;
|
|
|
|
|
+ $this->data_conducente_patente_scadenza = null;
|
|
|
|
|
+ $this->data_conducente_patente_prescrizioni = null;
|
|
|
|
|
+ $this->data_conducente_patente_limitazioni_art_117_1 = '';
|
|
|
|
|
+ $this->data_conducente_patente_limitazioni_art_117_2 = '';
|
|
|
|
|
+ $this->data_conducente_patente_abilitazione = null;
|
|
|
|
|
+ $this->data_conducente_patente_abilitazione_numero = '';
|
|
|
|
|
+ $this->data_conducente_patente_abilitazione_rilasciata_da = null;
|
|
|
|
|
+ $this->data_conducente_patente_abilitazione_rilasciata_il = null;
|
|
|
|
|
+ $this->data_conducente_documento = null;
|
|
|
|
|
+ $this->data_conducente_documento_numero = '';
|
|
|
|
|
+ $this->data_conducente_sedicente = null;
|
|
|
|
|
+ $this->data_tipo_danno = null;
|
|
|
|
|
+ $this->data_entita_danno = null;
|
|
|
|
|
+ $this->data_effetto_danno = null;
|
|
|
|
|
+ $this->data_parte_macchina = null;
|
|
|
|
|
+ $this->data_tipo_danno_2 = null;
|
|
|
|
|
+ $this->data_entita_danno_2 = null;
|
|
|
|
|
+ $this->data_effetto_danno_2 = null;
|
|
|
|
|
+ $this->data_parte_macchina_2 = null;
|
|
|
|
|
+ $this->data_tipo_danno_3 = null;
|
|
|
|
|
+ $this->data_entita_danno_3 = null;
|
|
|
|
|
+ $this->data_effetto_danno_3 = null;
|
|
|
|
|
+ $this->data_parte_macchina_3 = null;
|
|
|
|
|
+ $this->data_tipo_danno_4 = null;
|
|
|
|
|
+ $this->data_entita_danno_4 = null;
|
|
|
|
|
+ $this->data_effetto_danno_4 = null;
|
|
|
|
|
+ $this->data_parte_macchina_4 = null;
|
|
|
|
|
+
|
|
|
|
|
+ $this->data_cinture_conducente = '';
|
|
|
|
|
+ $this->data_cinture_passeggeri_0 = '';
|
|
|
|
|
+ $this->data_cinture_passeggeri_1 = '';
|
|
|
|
|
+ $this->data_cinture_passeggeri_2 = '';
|
|
|
|
|
+ $this->data_cinture_passeggeri_3 = '';
|
|
|
|
|
+
|
|
|
|
|
+ $this->data_casco_conducente = '';
|
|
|
|
|
+ $this->data_casco_passeggero = '';
|
|
|
|
|
+ $this->data_casco_omologazione_conducente = '';
|
|
|
|
|
+ $this->data_casco_omologazione_passeggero = '';
|
|
|
|
|
+
|
|
|
|
|
+ $this->data_passeggero_0 = 0;
|
|
|
|
|
+ $this->data_infortunato_0 = 0;
|
|
|
|
|
+ $this->data_infortunato_ospedale_0 = '';
|
|
|
|
|
+
|
|
|
|
|
+ $this->data_passeggero_1 = 0;
|
|
|
|
|
+ $this->data_infortunato_1 = 0;
|
|
|
|
|
+ $this->data_infortunato_ospedale_1 = '';
|
|
|
|
|
+
|
|
|
|
|
+ $this->data_passeggero_2 = 0;
|
|
|
|
|
+ $this->data_infortunato_2 = 0;
|
|
|
|
|
+ $this->data_infortunato_ospedale_2 = '';
|
|
|
|
|
+
|
|
|
|
|
+ $this->data_passeggero_3 = 0;
|
|
|
|
|
+ $this->data_infortunato_3 = 0;
|
|
|
|
|
+ $this->data_infortunato_ospedale_3 = '';
|
|
|
|
|
+
|
|
|
|
|
+ $this->data_infortunato_extra_0 = 0;
|
|
|
|
|
+ $this->data_infortunato_extra_1 = 0;
|
|
|
|
|
+ $this->data_infortunato_extra_2 = 0;
|
|
|
|
|
+ $this->data_infortunato_extra_3 = 0;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function resetPedoniData()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->currentPedone = 0;
|
|
|
|
|
+ $this->generalizzato = '';
|
|
|
|
|
+ $this->generalizzato_altrove = '';
|
|
|
|
|
+ $this->infortunato = '';
|
|
|
|
|
+ $this->infortunato_ospedale = '';
|
|
|
|
|
+ $this->pedone_posizione = '';
|
|
|
|
|
+ $this->pedone_posizione_desc = '';
|
|
|
|
|
+ $this->pedone_referto = '';
|
|
|
|
|
+ $this->pedone_prognosi = '';
|
|
|
|
|
+ $this->pedone_pioggia = '';
|
|
|
|
|
+ $this->pedone_ombrello = '';
|
|
|
|
|
+ $this->pedone_notte = '';
|
|
|
|
|
+ $this->pedone_abiti_scuri = '';
|
|
|
|
|
+ $this->verbale_violazione_numero = '';
|
|
|
|
|
+ $this->articolo_violato = '';
|
|
|
|
|
+ $this->cds = '';
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function resetAccertatore()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->currentAccertatore = 0;
|
|
|
|
|
+ $this->currentAccertatoreNumero = 0;
|
|
|
|
|
+ $this->accertatore_nome = '';
|
|
|
|
|
+ $this->accertatore_cognome = '';
|
|
|
|
|
+ $this->accertatore_grado = 0;
|
|
|
|
|
+ $this->accertatore_username = '';
|
|
|
|
|
+ $this->accertatore_email = '';
|
|
|
|
|
+ $this->accertatore_password = '';
|
|
|
|
|
+ $this->accertatore_password_conferma = '';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function hydrate()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->emit('load-select');
|
|
|
|
|
+ $this->emit('load-check');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function updatingSearch()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->resetPage();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function mount()
|
|
|
|
|
+ {
|
|
|
|
|
+ // $this->localita = \App\Models\LocationTown::orderBy('title')->get();
|
|
|
|
|
+ // $this->stradario = \App\Models\Stradario::orderBy('descrizione')->get();
|
|
|
|
|
+ $this->provinces = \App\Models\LocationProvince::orderBy('title')->get();
|
|
|
|
|
+ $this->rilievi = \App\Models\Rilievi::orderBy('name')->get();
|
|
|
|
|
+ $this->tipi_urto = \App\Models\TipoUrto::orderBy('name')->get();
|
|
|
|
|
+ $this->tipi_danno = \App\Models\TipoDanno::orderBy('name')->get();
|
|
|
|
|
+ $this->entita_danni = \App\Models\EntitaDanno::orderBy('name')->get();
|
|
|
|
|
+ $this->effetto_danni = \App\Models\EffettoDanno::orderBy('name')->get();
|
|
|
|
|
+ $this->parti_macchina = \App\Models\ParteMacchina::orderBy('name')->get();
|
|
|
|
|
+ $this->tipi_veicolo = \App\Models\TipoVeicolo::orderBy('name')->get();
|
|
|
|
|
+ $this->marche = \App\Models\MarcaVeicolo::orderBy('name')->get();
|
|
|
|
|
+ $this->modelli = \App\Models\ModelloVeicolo::orderBy('name')->get();
|
|
|
|
|
+ $this->tipi_segnalazioni = \App\Models\TipoSegnalazione::orderBy('name')->get();
|
|
|
|
|
+ $this->pervenute_da = \App\Models\SegnalazionePervenutaDa::orderBy('name')->get();
|
|
|
|
|
+ $this->altri_enti = \App\Models\AusilioAltriEnti::orderBy('name')->get();
|
|
|
|
|
+ $this->materiali = \App\Models\MaterialeRecuperato::orderBy('name')->get();
|
|
|
|
|
+ $this->nomenclature = \App\Models\NomenclaturaStrada::orderBy('name')->get();
|
|
|
|
|
+ $this->condizioni_atmosferiche_array = \App\Models\CondizioniAtmosferiche::orderBy('name')->get();
|
|
|
|
|
+ $this->condizioni_luce_array = \App\Models\CondizioniLuce::orderBy('name')->get();
|
|
|
|
|
+ $this->pavimentazioni = \App\Models\PavimentazioneStrada::orderBy('name')->get();
|
|
|
|
|
+ $this->condizioni_strada = \App\Models\CondizioneStrada::orderBy('name')->get();
|
|
|
|
|
+ $this->fondi_stradali = \App\Models\FondoStradale::orderBy('name')->get();
|
|
|
|
|
+ $this->particolarita_strade = \App\Models\ParticolaritaStrada::orderBy('name')->get();
|
|
|
|
|
+ $this->tipi_strade = \App\Models\TipoStrada::orderBy('name')->get();
|
|
|
|
|
+ $this->grado_accertatore = \App\Models\AccertatoreGrado::orderBy('name')->get();
|
|
|
|
|
+ $this->segnaletica_verticale = \App\Models\SegnalazioneVerticale::orderBy('name')->get();
|
|
|
|
|
+ $this->segnaletica_orizzontale = \App\Models\SegnalazioneOrizzontale::orderBy('name')->get();
|
|
|
|
|
+ // $this->anagrafiche = \App\Models\Anagrafica::orderBy('lastname')->orderBy('firstname')->get();
|
|
|
|
|
+ // $this->veicoli = \App\Models\Vehicle::with('marca')->with('modello')->get()->sortBy('marca.name',SORT_REGULAR,false);
|
|
|
|
|
+ $this->allegatiType = \App\Models\AllegatiGalleryType::orderBy('name')->get();
|
|
|
|
|
+
|
|
|
|
|
+ // $this->polizze = array();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function render()
|
|
|
|
|
+ {
|
|
|
|
|
+ $rows = \App\Models\Report::query()
|
|
|
|
|
+ ->leftJoin('fcf_reports_stradario', 'fcf_reports_reports.localita_due', '=', 'fcf_reports_stradario.id')
|
|
|
|
|
+ ->where(function($query) {
|
|
|
|
|
+ $query->where('fcf_reports_reports.name', 'like', '%'.$this->search.'%')
|
|
|
|
|
+ ->orWhere('fcf_reports_stradario.descrizione', 'like', '%'.$this->search.'%');
|
|
|
|
|
+ })
|
|
|
|
|
+ ->select('fcf_reports_reports.*')
|
|
|
|
|
+ ->orderBy('protocollo_anno', 'DESC')
|
|
|
|
|
+ ->orderBy('protocollo_num', 'DESC')
|
|
|
|
|
+ ->paginate(10);
|
|
|
|
|
+
|
|
|
|
|
+ return view('livewire.report', ['records' => $rows]);
|
|
|
|
|
+ }
|
|
|
|
|
+ public function add()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->resetFields();
|
|
|
|
|
+ try {
|
|
|
|
|
+
|
|
|
|
|
+ $this->protocollo_num = \DB::table('fcf_reports_reports')->where('protocollo_anno', date('Y'))->max('protocollo_num') + 1;
|
|
|
|
|
+ $this->protocollo_anno = date('Y');
|
|
|
|
|
+ $this->name = $this->protocollo_num . "/" . $this->protocollo_anno;
|
|
|
|
|
+ $record = \App\Models\Report::create([
|
|
|
|
|
+ 'name' => $this->name,
|
|
|
|
|
+ 'protocollo_num' => $this->protocollo_num,
|
|
|
|
|
+ 'protocollo_anno' => $this->protocollo_anno,
|
|
|
|
|
+ 'validated' => $this->validated,
|
|
|
|
|
+ 'necessita_nulla_osta' => $this->necessita_nulla_osta,
|
|
|
|
|
+ 'data_nulla_osta' => $this->data_nulla_osta,
|
|
|
|
|
+
|
|
|
|
|
+ ]);
|
|
|
|
|
+ session()->flash('success','Record creato');
|
|
|
|
|
+ $this->edit($record->id);
|
|
|
|
|
+ } catch (\Exception $ex) {
|
|
|
|
|
+ //$this->add = true;
|
|
|
|
|
+ //$this->update = true;
|
|
|
|
|
+ session()->flash('error','Errore in fase di salvataggio (' . $ex->getMessage() . ')');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function store()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->validate();
|
|
|
|
|
+ try {
|
|
|
|
|
+ \App\Models\Report::create([
|
|
|
|
|
+ 'name' => $this->name
|
|
|
|
|
+ ]);
|
|
|
|
|
+ session()->flash('success','Record creato');
|
|
|
|
|
+ $this->resetFields();
|
|
|
|
|
+ $this->add = false;
|
|
|
|
|
+ } catch (\Exception $ex) {
|
|
|
|
|
+ session()->flash('error','Errore in fase di salvataggio');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function edit($idReport){
|
|
|
|
|
+ $this->resetFields();
|
|
|
|
|
+ try {
|
|
|
|
|
+ $record = \App\Models\Report::findOrFail($idReport);
|
|
|
|
|
+ if( !$record) {
|
|
|
|
|
+ session()->flash('error','Record non trovato');
|
|
|
|
|
+ } else {
|
|
|
|
|
+
|
|
|
|
|
+ // Generale
|
|
|
|
|
+ $this->name = $record->name;
|
|
|
|
|
+ $this->validated = $record->validated;
|
|
|
|
|
+ $this->necessita_nulla_osta = $record->necessita_nulla_osta;
|
|
|
|
|
+ $this->data_nulla_osta = $record->data_nulla_osta;
|
|
|
|
|
+ $this->protocollo_num = $record->protocollo_num;
|
|
|
|
|
+ $this->protocollo_ord = $record->protocollo_ord;
|
|
|
|
|
+ $this->protocollo_anno = $record->protocollo_anno;
|
|
|
|
|
+ $this->verificatosi_in_data = $record->verificatosi_in_data;
|
|
|
|
|
+ $this->verificatosi_in_data_ora = $record->verificatosi_in_data_ora;
|
|
|
|
|
+ $this->verificatosi_in_data_minuti = $record->verificatosi_in_data_minuti;
|
|
|
|
|
+ $this->utg = $record->utg;
|
|
|
|
|
+ $this->utg_data = $record->utg_data;
|
|
|
|
|
+ $this->utg_protocollo = $record->utg_protocollo;
|
|
|
|
|
+ $this->ag = $record->ag;
|
|
|
|
|
+ $this->ag_data = $record->ag_data;
|
|
|
|
|
+ $this->ag_protocollo = $record->ag_protocollo;
|
|
|
|
|
+ $this->incidente_con_danni_a_cose = $record->incidente_con_danni_a_cose;
|
|
|
|
|
+ $this->incidente_con_feriti = $record->incidente_con_feriti;
|
|
|
|
|
+ $this->incidente_con_feriti_lesioni_lievi = $record->incidente_con_feriti_lesioni_lievi;
|
|
|
|
|
+ $this->incidente_con_feriti_lesioni_gravi = $record->incidente_con_feriti_lesioni_gravi;
|
|
|
|
|
+ $this->incidente_mortale = $record->incidente_mortale;
|
|
|
|
|
+ $this->localita_uno = $record->localita_uno;
|
|
|
|
|
+ $this->localita_due = $record->localita_due;
|
|
|
|
|
+ $this->intersezione_con = $record->intersezione_con;
|
|
|
|
|
+ $this->prossimita_civico = $record->prossimita_civico;
|
|
|
|
|
+ $this->prossimita_palo_luce = $record->prossimita_palo_luce;
|
|
|
|
|
+ $this->prossimita_chilometro = $record->prossimita_chilometro;
|
|
|
|
|
+ $this->note_aggiuntive = $record->note_aggiuntive;
|
|
|
|
|
+
|
|
|
|
|
+ $this->accertatore_1 = $record->accertatore_1;
|
|
|
|
|
+ $this->grado_accertatore_1 = $record->grado_accertatore_1;
|
|
|
|
|
+ $this->accertatore_2 = $record->accertatore_2;
|
|
|
|
|
+ $this->grado_accertatore_2 = $record->grado_accertatore_2;
|
|
|
|
|
+ $this->accertatore_3 = $record->accertatore_3;
|
|
|
|
|
+ $this->grado_accertatore_3 = $record->grado_accertatore_3;
|
|
|
|
|
+ $this->accertatore_4 = $record->accertatore_4;
|
|
|
|
|
+ $this->grado_accertatore_4 = $record->grado_accertatore_4;
|
|
|
|
|
+ $this->accertatore_5 = $record->accertatore_5;
|
|
|
|
|
+ $this->grado_accertatore_5 = $record->grado_accertatore_5;
|
|
|
|
|
+
|
|
|
|
|
+ $this->parti_coinvolte = \App\Models\ReportDataPartiCoinvolte::where('report_id', $idReport)->get();
|
|
|
|
|
+
|
|
|
|
|
+ $this->tipo_urto = \App\Models\ReportTipoUrto::where('report_id', $idReport)->pluck('tipo_urto_id');
|
|
|
|
|
+
|
|
|
|
|
+ $this->rilievi_id = $record->rilievi_id;
|
|
|
|
|
+
|
|
|
|
|
+ $this->segnalazione_data = $record->segnalazione_data;
|
|
|
|
|
+ $this->segnalazione_ora = $record->segnalazione_ora;
|
|
|
|
|
+ $this->segnalazione_minuti = $record->segnalazione_minuti;
|
|
|
|
|
+ $this->segnalazione_altro = $record->segnalazione_altro;
|
|
|
|
|
+ $this->ausilio_altri_enti_motivo = $record->ausilio_altri_enti_motivo;
|
|
|
|
|
+ $this->ausilio_altri_enti_ora_intervento = $record->ausilio_altri_enti_ora_intervento;
|
|
|
|
|
+ $this->ausilio_altri_enti_minuti_intervento = $record->ausilio_altri_enti_minuti_intervento;
|
|
|
|
|
+ $this->ditta_intervenuta = $record->ditta_intervenuta;
|
|
|
|
|
+ $this->ripristino_ora_chiamata = $record->ripristino_ora_chiamata;
|
|
|
|
|
+ $this->ripristino_minuti_chiamata = $record->ripristino_minuti_chiamata;
|
|
|
|
|
+ $this->ripristino_ora_arrivo = $record->ripristino_ora_arrivo;
|
|
|
|
|
+ $this->ripristino_minuti_arrivo = $record->ripristino_minuti_arrivo;
|
|
|
|
|
+ $this->danni_cose_diverse_da_veicoli = $record->danni_cose_diverse_da_veicoli;
|
|
|
|
|
+
|
|
|
|
|
+ $this->tipo_segnalazione = \App\Models\ReportTipoSegnalazione::where('report_id', $idReport)->pluck('tipo_segnalazione_id');
|
|
|
|
|
+ $this->segnalazione_pervenuta_da = \App\Models\ReportSegnalazionePervenutaDa::where('report_id', $idReport)->pluck('segnalazione_pervenuta_da_id');
|
|
|
|
|
+
|
|
|
|
|
+ $this->materiale_recuperato = \App\Models\ReportMaterialeRecuperato::where('report_id', $idReport)->pluck('materiale_recuperato_id');
|
|
|
|
|
+ $this->ausilio_altri_enti = \App\Models\ReportAusilioAltriEnti::where('report_id', $idReport)->pluck('ausilio_altri_enti_id');
|
|
|
|
|
+
|
|
|
|
|
+ $this->condizioni_luce = \App\Models\ReportCondizioniLuce::where('report_id', $idReport)->pluck('condizioni_luce_id');
|
|
|
|
|
+ $this->tipo_strada = \App\Models\ReportTipoStrada::where('report_id', $idReport)->pluck('tipo_strada_id');
|
|
|
|
|
+
|
|
|
|
|
+ $this->sinistro_ora = $record->sinistro_ora;
|
|
|
|
|
+ $this->sinistro_minuti = $record->sinistro_minuti;
|
|
|
|
|
+ $this->localizzazione_incidente = $record->localizzazione_incidente;
|
|
|
|
|
+ $this->localizzazione_incidente_altro = $record->localizzazione_incidente_altro;
|
|
|
|
|
+ $this->condizioni_atmosferiche = $record->condizioni_atmosferiche;
|
|
|
|
|
+ $this->condizioni_atmosferiche_altro = $record->condizioni_atmosferiche_altro;
|
|
|
|
|
+ $this->nomenclatura_strada = $record->nomenclatura_strada;
|
|
|
|
|
+ $this->nomenclatura_strada_numero = $record->nomenclatura_strada_numero;
|
|
|
|
|
+ $this->nomenclatura_strada_altro = $record->nomenclatura_strada_altro;
|
|
|
|
|
+ $this->pavimentazione = $record->pavimentazione;
|
|
|
|
|
+ $this->pavimentazione_altro = $record->pavimentazione_altro;
|
|
|
|
|
+ $this->condizione_strada = $record->condizione_strada;
|
|
|
|
|
+ $this->condizione_strada_altro = $record->condizione_strada_altro;
|
|
|
|
|
+ $this->fondo_stradale = $record->fondo_stradale;
|
|
|
|
|
+ $this->fondo_stradale_specifica = $record->fondo_stradale_specifica;
|
|
|
|
|
+ $this->visibilita = $record->visibilita;
|
|
|
|
|
+ $this->visibilita_specifica = $record->visibilita_specifica;
|
|
|
|
|
+ $this->particolarita_strada = $record->particolarita_strada;
|
|
|
|
|
+ $this->particolarita_strada_specifica = $record->particolarita_strada_specifica;
|
|
|
|
|
+ // $this->tipo_strada = $record->tipo_strada;
|
|
|
|
|
+ $this->tipo_strada_altro = $record->tipo_strada_altro;
|
|
|
|
|
+ $this->traffico = $record->traffico;
|
|
|
|
|
+
|
|
|
|
|
+ $this->segnaletica_verticale_1 = \App\Models\ReportSegnaleticaVerticale1::where('report_id', $idReport)->pluck('segnaletica_verticale_id');
|
|
|
|
|
+ $this->segnaletica_verticale_2 = \App\Models\ReportSegnaleticaVerticale2::where('report_id', $idReport)->pluck('segnaletica_verticale_id');
|
|
|
|
|
+ $this->segnaletica_verticale_3 = \App\Models\ReportSegnaleticaVerticale3::where('report_id', $idReport)->pluck('segnaletica_verticale_id');
|
|
|
|
|
+ $this->segnaletica_verticale_4 = \App\Models\ReportSegnaleticaVerticale4::where('report_id', $idReport)->pluck('segnaletica_verticale_id');
|
|
|
|
|
+
|
|
|
|
|
+ $this->segnaletica_orizzontale_1 = \App\Models\ReportSegnaleticaOrizzontale1::where('report_id', $idReport)->pluck('segnaletica_orizzontale_id');
|
|
|
|
|
+ $this->segnaletica_orizzontale_2 = \App\Models\ReportSegnaleticaOrizzontale2::where('report_id', $idReport)->pluck('segnaletica_orizzontale_id');
|
|
|
|
|
+ $this->segnaletica_orizzontale_3 = \App\Models\ReportSegnaleticaOrizzontale3::where('report_id', $idReport)->pluck('segnaletica_orizzontale_id');
|
|
|
|
|
+ $this->segnaletica_orizzontale_4 = \App\Models\ReportSegnaleticaOrizzontale4::where('report_id', $idReport)->pluck('segnaletica_orizzontale_id');
|
|
|
|
|
+
|
|
|
|
|
+ $this->segnaletica = $record->segnaletica;
|
|
|
|
|
+ $this->segnaletica_verticale_1_via = $record->segnaletica_verticale_1_via;
|
|
|
|
|
+ $this->segnaletica_verticale_1_altro = $record->segnaletica_verticale_1_altro;
|
|
|
|
|
+ $this->segnaletica_verticale_1_limite_velocita = $record->segnaletica_verticale_1_limite_velocita;
|
|
|
|
|
+ $this->segnaletica_verticale_1_direzione = $record->segnaletica_verticale_1_direzione;
|
|
|
|
|
+ $this->segnaletica_verticale_1_pannello_integrativo = $record->segnaletica_verticale_1_pannello_integrativo;
|
|
|
|
|
+ $this->segnaletica_verticale_2_via = $record->segnaletica_verticale_2_via;
|
|
|
|
|
+ $this->div_segnaletica_verticale_2 = $record->segnaletica_verticale_2_via != "";
|
|
|
|
|
+ $this->segnaletica_verticale_2_altro = $record->segnaletica_verticale_2_altro;
|
|
|
|
|
+ $this->segnaletica_verticale_2_limite_velocita = $record->segnaletica_verticale_2_limite_velocita;
|
|
|
|
|
+ $this->segnaletica_verticale_2_direzione = $record->segnaletica_verticale_2_direzione;
|
|
|
|
|
+ $this->segnaletica_verticale_2_pannello_integrativo = $record->segnaletica_verticale_2_pannello_integrativo;
|
|
|
|
|
+ $this->segnaletica_verticale_3_via = $record->segnaletica_verticale_3_via;
|
|
|
|
|
+ $this->div_segnaletica_verticale_3 = $record->segnaletica_verticale_3_via != "";
|
|
|
|
|
+ $this->segnaletica_verticale_3_altro = $record->segnaletica_verticale_3_altro;
|
|
|
|
|
+ $this->segnaletica_verticale_3_limite_velocita = $record->segnaletica_verticale_3_limite_velocita;
|
|
|
|
|
+ $this->segnaletica_verticale_3_direzione = $record->segnaletica_verticale_3_direzione;
|
|
|
|
|
+ $this->segnaletica_verticale_3_pannello_integrativo = $record->segnaletica_verticale_3_pannello_integrativo;
|
|
|
|
|
+ $this->segnaletica_verticale_4_via = $record->segnaletica_verticale_4_via;
|
|
|
|
|
+ $this->div_segnaletica_verticale_4 = $record->segnaletica_verticale_4_via != "";
|
|
|
|
|
+ $this->segnaletica_verticale_4_altro = $record->segnaletica_verticale_4_altro;
|
|
|
|
|
+ $this->segnaletica_verticale_4_limite_velocita = $record->segnaletica_verticale_4_limite_velocita;
|
|
|
|
|
+ $this->segnaletica_verticale_4_direzione = $record->segnaletica_verticale_4_direzione;
|
|
|
|
|
+ $this->segnaletica_verticale_4_pannello_integrativo = $record->segnaletica_verticale_4_pannello_integrativo;
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_via = $record->segnaletica_orizzontale_1_via;
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_linea_margine = $record->segnaletica_orizzontale_1_linea_margine;
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_linea_margine_specifica = $record->segnaletica_orizzontale_1_linea_margine_specifica;
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_linea_mezzeria = $record->segnaletica_orizzontale_1_linea_mezzeria;
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_linea_mezzeria_specifica = $record->segnaletica_orizzontale_1_linea_mezzeria_specifica;
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_altro = $record->segnaletica_orizzontale_1_altro;
|
|
|
|
|
+ $this->segnaletica_orizzontale_1_direzione = $record->segnaletica_orizzontale_1_direzione;
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_via = $record->segnaletica_orizzontale_2_via;
|
|
|
|
|
+ $this->div_segnaletica_orizzontale_2 = $record->segnaletica_orizzontale_2_via != "";
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_linea_margine = $record->segnaletica_orizzontale_2_linea_margine;
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_linea_margine_specifica = $record->segnaletica_orizzontale_2_linea_margine_specifica;
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_linea_mezzeria = $record->segnaletica_orizzontale_2_linea_mezzeria;
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_linea_mezzeria_specifica = $record->segnaletica_orizzontale_2_linea_mezzeria_specifica;
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_altro = $record->segnaletica_orizzontale_2_altro;
|
|
|
|
|
+ $this->segnaletica_orizzontale_2_direzione = $record->segnaletica_orizzontale_2_direzione;
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_via = $record->segnaletica_orizzontale_3_via;
|
|
|
|
|
+ $this->div_segnaletica_orizzontale_3 = $record->segnaletica_orizzontale_3_via != "";
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_linea_margine = $record->segnaletica_orizzontale_3_linea_margine;
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_linea_margine_specifica = $record->segnaletica_orizzontale_3_linea_margine_specifica;
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_linea_mezzeria = $record->segnaletica_orizzontale_3_linea_mezzeria;
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_linea_mezzeria_specifica = $record->segnaletica_orizzontale_3_linea_mezzeria_specifica;
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_altro = $record->segnaletica_orizzontale_3_altro;
|
|
|
|
|
+ $this->segnaletica_orizzontale_3_direzione = $record->segnaletica_orizzontale_3_direzione;
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_via = $record->segnaletica_orizzontale_4_via;
|
|
|
|
|
+ $this->div_segnaletica_orizzontale_4 = $record->segnaletica_orizzontale_4_via != "";
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_linea_margine = $record->segnaletica_orizzontale_4_linea_margine;
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_linea_margine_specifica = $record->segnaletica_orizzontale_4_linea_margine_specifica;
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_linea_mezzeria = $record->segnaletica_orizzontale_4_linea_mezzeria;
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_linea_mezzeria_specifica = $record->segnaletica_orizzontale_4_linea_mezzeria_specifica;
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_altro = $record->segnaletica_orizzontale_4_altro;
|
|
|
|
|
+ $this->segnaletica_orizzontale_4_direzione = $record->segnaletica_orizzontale_4_direzione;
|
|
|
|
|
+
|
|
|
|
|
+ $this->notes = \App\Models\ReportProtocolloNote::where('report_id', $idReport)->get();
|
|
|
|
|
+
|
|
|
|
|
+ $this->richieste = \App\Models\ReportRichiesta::where('report_id', $idReport)->get();
|
|
|
|
|
+
|
|
|
|
|
+ $this->allegatiImmagini = \App\Models\ReportAllegatiGallery::where('report_id', $idReport)->where('file_type', 0)->orderBy('name')->get();
|
|
|
|
|
+ $this->allegatiDocumenti = \App\Models\ReportAllegatiGallery::where('report_id', $idReport)->where('file_type', 1)->orderBy('name')->get();
|
|
|
|
|
+
|
|
|
|
|
+ // Testi oculari
|
|
|
|
|
+ $testi_oculari = \App\Models\ReportDataTestimoniOculari::where('report_id', $idReport)->get();
|
|
|
|
|
+ foreach($testi_oculari as $idx => $i)
|
|
|
|
|
+ {
|
|
|
|
|
+ if($idx == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_testi_oculari_0 = $i->testi_oculari;
|
|
|
|
|
+ $this->data_testi_oculari_stato_0 = $i->stato_testi_oculari;
|
|
|
|
|
+ }
|
|
|
|
|
+ if($idx == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_testi_oculari_1 = $i->testi_oculari;
|
|
|
|
|
+ $this->data_testi_oculari_stato_1 = $i->stato_testi_oculari;
|
|
|
|
|
+ }
|
|
|
|
|
+ if($idx == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_testi_oculari_2 = $i->testi_oculari;
|
|
|
|
|
+ $this->data_testi_oculari_stato_2 = $i->stato_testi_oculari;
|
|
|
|
|
+ }
|
|
|
|
|
+ if($idx == 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_testi_oculari_3 = $i->testi_oculari;
|
|
|
|
|
+ $this->data_testi_oculari_stato_3 = $i->stato_testi_oculari;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $this->dataId = $record->id;
|
|
|
|
|
+ $this->update = true;
|
|
|
|
|
+ $this->add = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (\Exception $ex) {
|
|
|
|
|
+ session()->flash('error','Errore (' . $ex->getMessage() . ')');
|
|
|
|
|
+ }
|
|
|
|
|
+ $this->emit('load-check', "");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function update($validate = false)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ if ($validate)
|
|
|
|
|
+ {
|
|
|
|
|
+ $rulesValidate = [
|
|
|
|
|
+ 'localita_uno' => 'required',
|
|
|
|
|
+ 'localita_due' => 'required',
|
|
|
|
|
+ 'verificatosi_in_data' => 'required',
|
|
|
|
|
+ 'verificatosi_in_data_ora' => 'required',
|
|
|
|
|
+ 'verificatosi_in_data_minuti' => 'required',
|
|
|
|
|
+ 'rilievi_id' => 'required',
|
|
|
|
|
+ 'segnalazione_data' => 'required',
|
|
|
|
|
+ 'segnalazione_ora' => 'required',
|
|
|
|
|
+ 'segnalazione_minuti' => 'required',
|
|
|
|
|
+ 'sinistro_ora' => 'required',
|
|
|
|
|
+ 'sinistro_minuti' => 'required',
|
|
|
|
|
+ 'localizzazione_incidente' => 'required',
|
|
|
|
|
+ 'nomenclatura_strada' => 'required',
|
|
|
|
|
+ 'condizioni_atmosferiche' => 'required',
|
|
|
|
|
+ 'pavimentazione' => 'required',
|
|
|
|
|
+ 'condizione_strada' => 'required',
|
|
|
|
|
+ 'fondo_stradale' => 'required',
|
|
|
|
|
+ 'visibilita' => 'required',
|
|
|
|
|
+ 'particolarita_strada' => 'required',
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ $this->validate($rulesValidate);
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ \App\Models\Report::whereId($this->dataId)->update([
|
|
|
|
|
+ 'name' => '0'.$this->protocollo_num . "/" . $this->protocollo_anno,
|
|
|
|
|
+ 'necessita_nulla_osta' => $this->necessita_nulla_osta,
|
|
|
|
|
+ 'data_nulla_osta' => $this->data_nulla_osta,
|
|
|
|
|
+ 'protocollo_num' => $this->protocollo_num,
|
|
|
|
|
+ 'protocollo_ord' => $this->protocollo_ord,
|
|
|
|
|
+ 'protocollo_anno' => $this->protocollo_anno,
|
|
|
|
|
+ 'verificatosi_in_data' => $this->verificatosi_in_data,
|
|
|
|
|
+ 'verificatosi_in_data_ora' => $this->verificatosi_in_data_ora,
|
|
|
|
|
+ 'verificatosi_in_data_minuti' => $this->verificatosi_in_data_minuti,
|
|
|
|
|
+ 'utg' => $this->utg,
|
|
|
|
|
+ 'utg_data' => $this->utg_data,
|
|
|
|
|
+ 'utg_protocollo' => $this->utg_protocollo,
|
|
|
|
|
+ 'ag' => $this->ag,
|
|
|
|
|
+ 'ag_data' => $this->ag_data,
|
|
|
|
|
+ 'ag_protocollo' => $this->ag_protocollo,
|
|
|
|
|
+ 'incidente_con_danni_a_cose' => $this->incidente_con_danni_a_cose,
|
|
|
|
|
+ 'incidente_con_feriti' => $this->incidente_con_feriti,
|
|
|
|
|
+ 'incidente_con_feriti_lesioni_lievi' => $this->incidente_con_feriti_lesioni_lievi,
|
|
|
|
|
+ 'incidente_con_feriti_lesioni_gravi' => $this->incidente_con_feriti_lesioni_gravi,
|
|
|
|
|
+ 'incidente_mortale' => $this->incidente_mortale,
|
|
|
|
|
+ 'localita_uno' => $this->localita_uno,
|
|
|
|
|
+ 'localita_due' => $this->localita_due,
|
|
|
|
|
+ 'intersezione_con' => $this->intersezione_con,
|
|
|
|
|
+ 'prossimita_civico' => $this->prossimita_civico,
|
|
|
|
|
+ 'prossimita_palo_luce' => $this->prossimita_palo_luce,
|
|
|
|
|
+ 'prossimita_chilometro' => $this->prossimita_chilometro,
|
|
|
|
|
+ 'note_aggiuntive' => $this->note_aggiuntive,
|
|
|
|
|
+ 'accertatore_1' => $this->accertatore_1,
|
|
|
|
|
+ 'grado_accertatore_1' => $this->grado_accertatore_1,
|
|
|
|
|
+ 'accertatore_2' => $this->accertatore_2,
|
|
|
|
|
+ 'grado_accertatore_2' => $this->grado_accertatore_2,
|
|
|
|
|
+ 'accertatore_3' => $this->accertatore_3,
|
|
|
|
|
+ 'grado_accertatore_3' => $this->grado_accertatore_3,
|
|
|
|
|
+ 'accertatore_4' => $this->accertatore_4,
|
|
|
|
|
+ 'grado_accertatore_4' => $this->grado_accertatore_4,
|
|
|
|
|
+ 'accertatore_5' => $this->accertatore_5,
|
|
|
|
|
+ 'grado_accertatore_5' => $this->grado_accertatore_5,
|
|
|
|
|
+ 'rilievi_id' => $this->rilievi_id,
|
|
|
|
|
+ 'segnalazione_data' => $this->segnalazione_data,
|
|
|
|
|
+ 'segnalazione_ora' => $this->segnalazione_ora,
|
|
|
|
|
+ 'segnalazione_minuti' => $this->segnalazione_minuti,
|
|
|
|
|
+ 'segnalazione_altro' => $this->segnalazione_altro,
|
|
|
|
|
+ 'ausilio_altri_enti_motivo' => $this->ausilio_altri_enti_motivo,
|
|
|
|
|
+ 'ausilio_altri_enti_ora_intervento' => $this->ausilio_altri_enti_ora_intervento,
|
|
|
|
|
+ 'ausilio_altri_enti_minuti_intervento' => $this->ausilio_altri_enti_minuti_intervento,
|
|
|
|
|
+ 'ditta_intervenuta' => $this->ditta_intervenuta,
|
|
|
|
|
+ 'ripristino_ora_chiamata' => $this->ripristino_ora_chiamata,
|
|
|
|
|
+ 'ripristino_minuti_chiamata' => $this->ripristino_minuti_chiamata,
|
|
|
|
|
+ 'ripristino_ora_arrivo' => $this->ripristino_ora_arrivo,
|
|
|
|
|
+ 'ripristino_minuti_arrivo' => $this->ripristino_minuti_arrivo,
|
|
|
|
|
+ 'danni_cose_diverse_da_veicoli' => $this->danni_cose_diverse_da_veicoli,
|
|
|
|
|
+ 'sinistro_ora' => $this->sinistro_ora,
|
|
|
|
|
+ 'sinistro_minuti' => $this->sinistro_minuti,
|
|
|
|
|
+ 'localizzazione_incidente' => $this->localizzazione_incidente,
|
|
|
|
|
+ 'localizzazione_incidente_altro' => $this->localizzazione_incidente_altro,
|
|
|
|
|
+ 'condizioni_atmosferiche' => $this->condizioni_atmosferiche,
|
|
|
|
|
+ 'condizioni_atmosferiche_altro' => $this->condizioni_atmosferiche_altro,
|
|
|
|
|
+ 'nomenclatura_strada' => $this->nomenclatura_strada,
|
|
|
|
|
+ 'nomenclatura_strada_numero' => $this->nomenclatura_strada_numero,
|
|
|
|
|
+ 'nomenclatura_strada_altro' => $this->nomenclatura_strada_altro,
|
|
|
|
|
+ 'pavimentazione' => $this->pavimentazione,
|
|
|
|
|
+ 'pavimentazione_altro' => $this->pavimentazione_altro,
|
|
|
|
|
+ 'condizione_strada' => $this->condizione_strada,
|
|
|
|
|
+ 'condizione_strada_altro' => $this->condizione_strada_altro,
|
|
|
|
|
+ 'fondo_stradale' => $this->fondo_stradale,
|
|
|
|
|
+ 'fondo_stradale_specifica' => $this->fondo_stradale_specifica,
|
|
|
|
|
+ 'visibilita' => $this->visibilita,
|
|
|
|
|
+ 'visibilita_specifica' => $this->visibilita_specifica,
|
|
|
|
|
+ 'particolarita_strada' => $this->particolarita_strada,
|
|
|
|
|
+ 'particolarita_strada_specifica' => $this->particolarita_strada_specifica,
|
|
|
|
|
+ // 'tipo_strada' => $this->tipo_strada,
|
|
|
|
|
+ 'tipo_strada_altro' => $this->tipo_strada_altro,
|
|
|
|
|
+ 'traffico' => $this->traffico,
|
|
|
|
|
+ 'segnaletica' => $this->segnaletica,
|
|
|
|
|
+ 'segnaletica_verticale_1_via' => $this->segnaletica_verticale_1_via,
|
|
|
|
|
+ 'segnaletica_verticale_1_altro' => $this->segnaletica_verticale_1_altro,
|
|
|
|
|
+ 'segnaletica_verticale_1_limite_velocita' => $this->segnaletica_verticale_1_limite_velocita,
|
|
|
|
|
+ 'segnaletica_verticale_1_direzione' => $this->segnaletica_verticale_1_direzione,
|
|
|
|
|
+ 'segnaletica_verticale_1_pannello_integrativo' => $this->segnaletica_verticale_1_pannello_integrativo,
|
|
|
|
|
+ 'segnaletica_verticale_2_via' => $this->segnaletica_verticale_2_via,
|
|
|
|
|
+ 'segnaletica_verticale_2_altro' => $this->segnaletica_verticale_2_altro,
|
|
|
|
|
+ 'segnaletica_verticale_2_limite_velocita' => $this->segnaletica_verticale_2_limite_velocita,
|
|
|
|
|
+ 'segnaletica_verticale_2_direzione' => $this->segnaletica_verticale_2_direzione,
|
|
|
|
|
+ 'segnaletica_verticale_2_pannello_integrativo' => $this->segnaletica_verticale_2_pannello_integrativo,
|
|
|
|
|
+ 'segnaletica_verticale_3_via' => $this->segnaletica_verticale_3_via,
|
|
|
|
|
+ 'segnaletica_verticale_3_altro' => $this->segnaletica_verticale_3_altro,
|
|
|
|
|
+ 'segnaletica_verticale_3_limite_velocita' => $this->segnaletica_verticale_3_limite_velocita,
|
|
|
|
|
+ 'segnaletica_verticale_3_direzione' => $this->segnaletica_verticale_3_direzione,
|
|
|
|
|
+ 'segnaletica_verticale_3_pannello_integrativo' => $this->segnaletica_verticale_3_pannello_integrativo,
|
|
|
|
|
+ 'segnaletica_verticale_4_via' => $this->segnaletica_verticale_4_via,
|
|
|
|
|
+ 'segnaletica_verticale_4_altro' => $this->segnaletica_verticale_4_altro,
|
|
|
|
|
+ 'segnaletica_verticale_4_limite_velocita' => $this->segnaletica_verticale_4_limite_velocita,
|
|
|
|
|
+ 'segnaletica_verticale_4_direzione' => $this->segnaletica_verticale_4_direzione,
|
|
|
|
|
+ 'segnaletica_verticale_4_pannello_integrativo' => $this->segnaletica_verticale_4_pannello_integrativo,
|
|
|
|
|
+ 'segnaletica_orizzontale_1_via' => $this->segnaletica_orizzontale_1_via,
|
|
|
|
|
+ 'segnaletica_orizzontale_1_linea_margine' => $this->segnaletica_orizzontale_1_linea_margine,
|
|
|
|
|
+ 'segnaletica_orizzontale_1_linea_margine_specifica' => $this->segnaletica_orizzontale_1_linea_margine_specifica,
|
|
|
|
|
+ 'segnaletica_orizzontale_1_linea_mezzeria' => $this->segnaletica_orizzontale_1_linea_mezzeria,
|
|
|
|
|
+ 'segnaletica_orizzontale_1_linea_mezzeria_specifica' => $this->segnaletica_orizzontale_1_linea_mezzeria_specifica,
|
|
|
|
|
+ 'segnaletica_orizzontale_1_altro' => $this->segnaletica_orizzontale_1_altro,
|
|
|
|
|
+ 'segnaletica_orizzontale_1_direzione' => $this->segnaletica_orizzontale_1_direzione,
|
|
|
|
|
+ 'segnaletica_orizzontale_2_via' => $this->segnaletica_orizzontale_2_via,
|
|
|
|
|
+ 'segnaletica_orizzontale_2_linea_margine' => $this->segnaletica_orizzontale_2_linea_margine,
|
|
|
|
|
+ 'segnaletica_orizzontale_2_linea_margine_specifica' => $this->segnaletica_orizzontale_2_linea_margine_specifica,
|
|
|
|
|
+ 'segnaletica_orizzontale_2_linea_mezzeria' => $this->segnaletica_orizzontale_2_linea_mezzeria,
|
|
|
|
|
+ 'segnaletica_orizzontale_2_linea_mezzeria_specifica' => $this->segnaletica_orizzontale_2_linea_mezzeria_specifica,
|
|
|
|
|
+ 'segnaletica_orizzontale_2_altro' => $this->segnaletica_orizzontale_2_altro,
|
|
|
|
|
+ 'segnaletica_orizzontale_2_direzione' => $this->segnaletica_orizzontale_2_direzione,
|
|
|
|
|
+ 'segnaletica_orizzontale_3_via' => $this->segnaletica_orizzontale_3_via,
|
|
|
|
|
+ 'segnaletica_orizzontale_3_linea_margine' => $this->segnaletica_orizzontale_3_linea_margine,
|
|
|
|
|
+ 'segnaletica_orizzontale_3_linea_margine_specifica' => $this->segnaletica_orizzontale_3_linea_margine_specifica,
|
|
|
|
|
+ 'segnaletica_orizzontale_3_linea_mezzeria' => $this->segnaletica_orizzontale_3_linea_mezzeria,
|
|
|
|
|
+ 'segnaletica_orizzontale_3_linea_mezzeria_specifica' => $this->segnaletica_orizzontale_3_linea_mezzeria_specifica,
|
|
|
|
|
+ 'segnaletica_orizzontale_3_altro' => $this->segnaletica_orizzontale_3_altro,
|
|
|
|
|
+ 'segnaletica_orizzontale_3_direzione' => $this->segnaletica_orizzontale_3_direzione,
|
|
|
|
|
+ 'segnaletica_orizzontale_4_via' => $this->segnaletica_orizzontale_4_via,
|
|
|
|
|
+ 'segnaletica_orizzontale_4_linea_margine' => $this->segnaletica_orizzontale_4_linea_margine,
|
|
|
|
|
+ 'segnaletica_orizzontale_4_linea_margine_specifica' => $this->segnaletica_orizzontale_4_linea_margine_specifica,
|
|
|
|
|
+ 'segnaletica_orizzontale_4_linea_mezzeria' => $this->segnaletica_orizzontale_4_linea_mezzeria,
|
|
|
|
|
+ 'segnaletica_orizzontale_4_linea_mezzeria_specifica' => $this->segnaletica_orizzontale_4_linea_mezzeria_specifica,
|
|
|
|
|
+ 'segnaletica_orizzontale_4_altro' => $this->segnaletica_orizzontale_4_altro,
|
|
|
|
|
+ 'segnaletica_orizzontale_4_direzione' => $this->segnaletica_orizzontale_4_direzione,
|
|
|
|
|
+ 'validated' => $validate
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportTipoUrto::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->tipo_urto as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportTipoUrto::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'tipo_urto_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportTipoSegnalazione::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->tipo_segnalazione as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportTipoSegnalazione::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'tipo_segnalazione_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportSegnalazionePervenutaDa::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->segnalazione_pervenuta_da as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportSegnalazionePervenutaDa::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'segnalazione_pervenuta_da_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportMaterialeRecuperato::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->materiale_recuperato as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportMaterialeRecuperato::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'materiale_recuperato_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportAusilioAltriEnti::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->ausilio_altri_enti as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportAusilioAltriEnti::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'ausilio_altri_enti_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportCondizioniLuce::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->condizioni_luce as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportCondizioniLuce::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'condizioni_luce_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportTipoStrada::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->tipo_strada as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportTipoStrada::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'tipo_strada_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportSegnaleticaVerticale1::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->segnaletica_verticale_1 as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportSegnaleticaVerticale1::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'segnaletica_verticale_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportSegnaleticaVerticale2::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->segnaletica_verticale_2 as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportSegnaleticaVerticale2::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'segnaletica_verticale_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportSegnaleticaVerticale3::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->segnaletica_verticale_3 as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportSegnaleticaVerticale3::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'segnaletica_verticale_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportSegnaleticaVerticale4::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->segnaletica_verticale_4 as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportSegnaleticaVerticale4::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'segnaletica_verticale_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportSegnaleticaOrizzontale1::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->segnaletica_orizzontale_1 as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportSegnaleticaOrizzontale1::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'segnaletica_orizzontale_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportSegnaleticaOrizzontale2::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->segnaletica_orizzontale_2 as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportSegnaleticaOrizzontale2::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'segnaletica_orizzontale_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportSegnaleticaOrizzontale3::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->segnaletica_orizzontale_3 as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportSegnaleticaOrizzontale3::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'segnaletica_orizzontale_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportSegnaleticaOrizzontale4::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ foreach($this->segnaletica_orizzontale_4 as $x)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportSegnaleticaOrizzontale4::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'segnaletica_orizzontale_id' => $x
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportDataTestimoniOculari::where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ try {
|
|
|
|
|
+ \App\Models\ReportDataTestimoniOculari::create([
|
|
|
|
|
+ 'progressive' => 0,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'testi_oculari' => $this->data_testi_oculari_0,
|
|
|
|
|
+ 'stato_testi_oculari' => $this->data_testi_oculari_stato_0
|
|
|
|
|
+ ]);
|
|
|
|
|
+ \App\Models\ReportDataTestimoniOculari::create([
|
|
|
|
|
+ 'progressive' => 1,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'testi_oculari' => $this->data_testi_oculari_1,
|
|
|
|
|
+ 'stato_testi_oculari' => $this->data_testi_oculari_stato_1
|
|
|
|
|
+ ]);
|
|
|
|
|
+ \App\Models\ReportDataTestimoniOculari::create([
|
|
|
|
|
+ 'progressive' => 2,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'testi_oculari' => $this->data_testi_oculari_2,
|
|
|
|
|
+ 'stato_testi_oculari' => $this->data_testi_oculari_stato_2
|
|
|
|
|
+ ]);
|
|
|
|
|
+ \App\Models\ReportDataTestimoniOculari::create([
|
|
|
|
|
+ 'progressive' => 3,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'testi_oculari' => $this->data_testi_oculari_3,
|
|
|
|
|
+ 'stato_testi_oculari' => $this->data_testi_oculari_stato_3
|
|
|
|
|
+ ]);
|
|
|
|
|
+ } catch (\Exception $ex) {
|
|
|
|
|
+ session()->flash('error','Errore in fase di salvataggio (' . $ex->getMessage() . ')');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ session()->flash('success','Record aggiornato');
|
|
|
|
|
+ $this->resetFields();
|
|
|
|
|
+ $this->update = false;
|
|
|
|
|
+ } catch (\Exception $ex) {
|
|
|
|
|
+ session()->flash('error','Errore (' . $ex->getMessage() . ')');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function cancel()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->add = false;
|
|
|
|
|
+ $this->update = false;
|
|
|
|
|
+ $this->resetFields();
|
|
|
|
|
+ $this->resetAnagrafica();
|
|
|
|
|
+ $this->resetVeicolo();
|
|
|
|
|
+ $this->resetVeicoloData();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function delete($id)
|
|
|
|
|
+ {
|
|
|
|
|
+ try{
|
|
|
|
|
+ \App\Models\Report::find($id)->delete();
|
|
|
|
|
+ session()->flash('success',"Record eliminato");
|
|
|
|
|
+ }catch(\Exception $e){
|
|
|
|
|
+ session()->flash('error',"Errore");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addNote()
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportProtocolloNote::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'text' => $this->noteText,
|
|
|
|
|
+ 'created' => date("Y-m-d H:i:s"),
|
|
|
|
|
+ 'created_by' => 0 // * * *
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $this->noteText = '';
|
|
|
|
|
+ $this->notes = \App\Models\ReportProtocolloNote::where('report_id', $this->dataId)->get();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function removeNote($id)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportProtocolloNote::findOrFail($id)->delete();
|
|
|
|
|
+ $this->notes = \App\Models\ReportProtocolloNote::where('report_id', $this->dataId)->get();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function saveRichiesta()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $rules = [
|
|
|
|
|
+ 'richiestaAnagrafica' => 'required|min:1',
|
|
|
|
|
+ 'richiestaData' => 'required|date',
|
|
|
|
|
+ 'richiestaConsegna' => 'required|date',
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ $messages = [
|
|
|
|
|
+ 'richiestaData.required' => 'Il campo data richiesta è obbligatorio.',
|
|
|
|
|
+ 'richiestaData.date' => 'Il campo data richiesta deve essere una data valida.',
|
|
|
|
|
+ 'richiestaConsegna.required' => 'Il campo data consegna è obbligatorio.',
|
|
|
|
|
+ 'richiestaConsegna.date' => 'Il campo data consegna deve essere una data valida.',
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ $this->validate($rules);
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->richiestaId > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportRichiesta::where('id', $this->richiestaId)->update([
|
|
|
|
|
+ 'anagrafica_id' => $this->richiestaAnagrafica,
|
|
|
|
|
+ 'data_richiesta' => $this->richiestaData,
|
|
|
|
|
+ 'consegna_richiesta' => $this->richiestaConsegna,
|
|
|
|
|
+ 'description' => $this->richiestaText,
|
|
|
|
|
+ 'state' => 0
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportRichiesta::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'anagrafica_id' => $this->richiestaAnagrafica,
|
|
|
|
|
+ 'data_richiesta' => $this->richiestaData,
|
|
|
|
|
+ 'consegna_richiesta' => $this->richiestaConsegna,
|
|
|
|
|
+ 'description' => $this->richiestaText,
|
|
|
|
|
+ 'state' => 0,
|
|
|
|
|
+ 'created' => date("Y-m-d H:i:s"),
|
|
|
|
|
+ 'created_by' => 0 // * * *
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $this->richiestaId = 0;
|
|
|
|
|
+ $this->richiestaAnagrafica = 0;
|
|
|
|
|
+ $this->richiestaData = null;
|
|
|
|
|
+ $this->richiestaConsegna = null;
|
|
|
|
|
+ $this->richiestaText = '';
|
|
|
|
|
+
|
|
|
|
|
+ $this->richieste = \App\Models\ReportRichiesta::where('report_id', $this->dataId)->get();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function editRichiesta($id)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $r = \App\Models\ReportRichiesta::where('id', $id)->first();
|
|
|
|
|
+ if ($r != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->richiestaId = $id;
|
|
|
|
|
+ $this->richiestaAnagrafica = $r->anagrafica_id;
|
|
|
|
|
+ $this->richiestaData = $r->data_richiesta;
|
|
|
|
|
+ $this->richiestaConsegna = $r->consegna_richiesta;
|
|
|
|
|
+ $this->richiestaText = $r->description;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function removeRichiesta($id)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportRichiesta::findOrFail($id)->delete();
|
|
|
|
|
+ $this->richieste = \App\Models\ReportRichiesta::where('report_id', $this->dataId)->get();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addAllegato($type)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->allegatoId = 0;
|
|
|
|
|
+ $this->allegatoType = $type;
|
|
|
|
|
+ $this->allegatoGallery = 0;
|
|
|
|
|
+ $this->allegatoName = '';
|
|
|
|
|
+ $this->allegatoVisible = false;
|
|
|
|
|
+ $this->allegatoFiles = '';
|
|
|
|
|
+ $this->allegatiFiles = [];
|
|
|
|
|
+ $this->emit('attachments', "");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function saveAllegato()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $files = implode("|", $this->allegatiFiles);
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->allegatoId > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportAllegatiGallery::where('id', $this->allegatoId)->update([
|
|
|
|
|
+ 'file_type' => $this->allegatoType,
|
|
|
|
|
+ 'gallery_type' => $this->allegatoGallery,
|
|
|
|
|
+ 'name' => $this->allegatoName,
|
|
|
|
|
+ 'is_visible' => $this->allegatoVisible,
|
|
|
|
|
+ 'files' => $files,
|
|
|
|
|
+ 'state' => 0
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportAllegatiGallery::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'file_type' => $this->allegatoType,
|
|
|
|
|
+ 'gallery_type' => $this->allegatoGallery,
|
|
|
|
|
+ 'name' => $this->allegatoName,
|
|
|
|
|
+ 'is_visible' => $this->allegatoVisible,
|
|
|
|
|
+ 'files' => $files,
|
|
|
|
|
+ 'state' => 0,
|
|
|
|
|
+ 'created' => date("Y-m-d H:i:s"),
|
|
|
|
|
+ 'created_by' => 0 // * * *
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $this->allegatoId = 0;
|
|
|
|
|
+ $this->allegatoGallery = 0;
|
|
|
|
|
+ $this->allegatoName = '';
|
|
|
|
|
+ $this->allegatoVisible = false;
|
|
|
|
|
+ $this->allegatoFiles = '';
|
|
|
|
|
+ $this->allegatiFiles = [];
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->allegatoType == 0)
|
|
|
|
|
+ $this->allegatiImmagini = \App\Models\ReportAllegatiGallery::where('report_id', $this->dataId)->where('file_type', 0)->orderBy('name')->get();
|
|
|
|
|
+ else
|
|
|
|
|
+ $this->allegatiDocumenti = \App\Models\ReportAllegatiGallery::where('report_id', $this->dataId)->where('file_type', 1)->orderBy('name')->get();
|
|
|
|
|
+
|
|
|
|
|
+ $this->allegatoType = 0;
|
|
|
|
|
+
|
|
|
|
|
+ $this->emit('close-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function editAllegato($id)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->emit('attachments', "");
|
|
|
|
|
+ $a = \App\Models\ReportAllegatiGallery::where('id', $id)->first();
|
|
|
|
|
+ if ($a != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->allegatoId = $id;
|
|
|
|
|
+ $this->allegatoType = $a->file_type;
|
|
|
|
|
+ $this->allegatoGallery = $a->gallery_type;
|
|
|
|
|
+ $this->allegatoName = $a->name;
|
|
|
|
|
+ $this->allegatoFiles = $a->files;
|
|
|
|
|
+ $this->allegatiFiles = explode("|", $this->allegatoFiles);
|
|
|
|
|
+ $this->emit('attachments', $this->allegatoFiles);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function removeAllegato($id)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportAllegatiGallery::findOrFail($id)->delete();
|
|
|
|
|
+ $this->allegatiImmagini = \App\Models\ReportAllegatiGallery::where('report_id', $this->dataId)->where('file_type', 0)->orderBy('name')->get();
|
|
|
|
|
+ $this->allegatiDocumenti = \App\Models\ReportAllegatiGallery::where('report_id', $this->dataId)->where('file_type', 1)->orderBy('name')->get();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addParteCoinvolta($type = 'pedone')
|
|
|
|
|
+ {
|
|
|
|
|
+ $count = \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->count();
|
|
|
|
|
+ $progressive = $count == 0 ? 0 : $count;
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportDataPartiCoinvolte::create([
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'progressive' => $progressive,
|
|
|
|
|
+ 'progressive_type' => $progressive,
|
|
|
|
|
+ 'conducente_o_pedone' => $type === 'veicolo' ? 2 : 1
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ $this->parti_coinvolte = \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->get();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function changeAnagType($type)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->anag_type = $type;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function updateConducentePedoneParteCoinvolta($conducente_o_pedone, $progressive)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->where('progressive', $progressive)->update([
|
|
|
|
|
+ 'conducente_o_pedone' => $conducente_o_pedone
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $this->parti_coinvolte = \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->get();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function updateAnagraficaParteCoinvolta($anagrafica, $progressive)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->where('progressive', $progressive)->update([
|
|
|
|
|
+ 'anagrafica' => $anagrafica
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $this->parti_coinvolte = \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->get();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function removeAnagraficaParteCoinvolta($progressive)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->where('progressive', $progressive)->update([
|
|
|
|
|
+ 'anagrafica' => 0
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $this->parti_coinvolte = \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->get();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function updateVeicoloParteCoinvolta($veicolo, $progressive)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->where('progressive', $progressive)->update([
|
|
|
|
|
+ 'veicolo' => $veicolo
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $this->parti_coinvolte = \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->get();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function removeVeicoloParteCoinvolta($progressive)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->where('progressive', $progressive)->update([
|
|
|
|
|
+ 'veicolo' => 0
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $this->parti_coinvolte = \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->get();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function removeParteCoinvolta($progressive)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->where('progressive', $progressive)->delete();
|
|
|
|
|
+ $this->parti_coinvolte = \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->get();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function editAnagraficaParte($progressive)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $parte_comune = \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->where('progressive', $progressive)->first();
|
|
|
|
|
+ if ($parte_comune != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->editAnagrafica($parte_comune->anagrafica);
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addAnagrafica($progressive)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetAnagrafica();
|
|
|
|
|
+ $this->currentProgressive = $progressive;
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addTesteOculare($x)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetAnagrafica();
|
|
|
|
|
+ $this->currentTeste = $x;
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addConducente()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetAnagrafica();
|
|
|
|
|
+ $this->currentConducente = 99;
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addProprietario()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetAnagrafica();
|
|
|
|
|
+ $this->currentProprietario = 99;
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addCoproprietario()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetAnagrafica();
|
|
|
|
|
+ $this->currentCoproprietario = 99;
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addPasseggero($x)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetAnagrafica();
|
|
|
|
|
+ $this->currentPasseggero = $x;
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function removeProprietario()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_proprietari = 0;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_proprietari, '', 'data_proprietari');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function removeCoproprietario()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_coproprietari = 0;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_coproprietari, '', 'data_coproprietari');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function removeConducente()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_conducenti = 0;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_conducenti, '', 'data_conducenti');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function editProprietario()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->currentProprietario = $this->data_proprietari;
|
|
|
|
|
+ $this->editAnagrafica($this->data_proprietari);
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function editCoproprietario()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->currentCoproprietario = $this->data_coproprietari;
|
|
|
|
|
+ $this->editAnagrafica($this->data_coproprietari);
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function editConducente()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->currentConducente = $this->data_conducenti;
|
|
|
|
|
+ $this->editAnagrafica($this->data_conducenti);
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function editPasseggero($x)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->currentPasseggero = $x;
|
|
|
|
|
+ if ($x == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->editAnagrafica($this->data_passeggero_0);
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($x == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->editAnagrafica($this->data_passeggero_1);
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($x == 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->editAnagrafica($this->data_passeggero_2);
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($x == 4)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->editAnagrafica($this->data_passeggero_3s);
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function removePasseggero($x)
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($x == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_0 = 0;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_0, '', 'data_passeggero_0');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($x == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_1 = 0;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_1, '', 'data_passeggero_1');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($x == 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_2 = 0;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_2, '', 'data_passeggero_2');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($x == 4)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_3 = 0;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_3, '', 'data_passeggero_3');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addInfortunato($x)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetAnagrafica();
|
|
|
|
|
+ $this->currentInfortunato = $x;
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function editAnagrafica($anagrafica)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetAnagrafica();
|
|
|
|
|
+
|
|
|
|
|
+ $anag = \App\Models\Anagrafica::where('id', $anagrafica)->first();
|
|
|
|
|
+ if ($anag != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->currentAnagrafica = $anagrafica;
|
|
|
|
|
+ $this->anag_type = $anag->type;
|
|
|
|
|
+ $this->anag_firstname = $anag->firstname;
|
|
|
|
|
+ $this->anag_lastname = $anag->lastname;
|
|
|
|
|
+ $this->anag_gender = $anag->gender;
|
|
|
|
|
+ $this->anag_birth_date = $anag->birth_date;
|
|
|
|
|
+ $this->anag_birth_town_id = $anag->birth_town_id;
|
|
|
|
|
+ $this->anag_birth_prov_id = $anag->birth_prov_id;
|
|
|
|
|
+ $this->anag_residenza_town_id = $anag->residenza_town_id;
|
|
|
|
|
+ $this->anag_residenza_prov_id = $anag->residenza_prov_id;
|
|
|
|
|
+ $this->anag_residenza_address = $anag->residenza_address;
|
|
|
|
|
+ $this->anag_residenza_cap = $anag->residenza_cap;
|
|
|
|
|
+ $this->anag_mobile = $anag->mobile;
|
|
|
|
|
+ $this->anag_sedicente = $anag->sedicente;
|
|
|
|
|
+ $this->anag_documento_tipo = $anag->documento_tipo;
|
|
|
|
|
+ $this->anag_documento_patente_cat = $anag->documento_patente_cat;
|
|
|
|
|
+ $this->anag_documento_tipo_altro = $anag->documento_tipo_altro;
|
|
|
|
|
+ $this->anag_documento_numero = $anag->documento_numero;
|
|
|
|
|
+ $this->anag_documento_rilasciato_da = $anag->documento_rilasciato_da;
|
|
|
|
|
+ $this->anag_documento_rilasciato_da_altro = $anag->documento_rilasciato_da_altro;
|
|
|
|
|
+ $this->anag_foreign_country = $anag->foreign_country;
|
|
|
|
|
+ $this->anag_documento_rilasciato_da_di_foreign_localita = $anag->documento_rilasciato_da_di_foreign_localita;
|
|
|
|
|
+ $this->anag_documento_rilasciato_da_di_foreign_country = $anag->documento_rilasciato_da_di_foreign_country;
|
|
|
|
|
+ $this->anag_documento_rilasciato_da_prov_id = $anag->documento_rilasciato_da_prov_id;
|
|
|
|
|
+ $this->anag_documento_rilasciato_da_town_id = $anag->documento_rilasciato_da_town_id;
|
|
|
|
|
+ $this->anag_documento_rilasciato_il = $anag->documento_rilasciato_il;
|
|
|
|
|
+ $this->anag_documento_scadenza_il = $anag->documento_scadenza_il;
|
|
|
|
|
+ $this->anag_state = $anag->state;
|
|
|
|
|
+ $this->anag_nazionalita = $anag->nazionalita;
|
|
|
|
|
+ $this->anag_nazione_straniera = $anag->nazione_straniera;
|
|
|
|
|
+ $this->anag_localita_straniera = $anag->localita_straniera;
|
|
|
|
|
+ $this->anag_rag_soc = $anag->rag_soc;
|
|
|
|
|
+ $this->anag_vat = $anag->vat;
|
|
|
|
|
+ $this->anag_sede_legale_town_id = $anag->sede_legale_town_id;
|
|
|
|
|
+ $this->anag_sede_legale_prov_id = $anag->sede_legale_prov_id;
|
|
|
|
|
+ $this->anag_sede_legale_address = $anag->sede_legale_address;
|
|
|
|
|
+ $this->anag_sede_legale_cap = $anag->sede_legale_cap;
|
|
|
|
|
+ $this->anag_phone = $anag->phone;
|
|
|
|
|
+
|
|
|
|
|
+ $this->anag_foreign_birth_country = $anag->anag_foreign_birth_country;
|
|
|
|
|
+ $this->anag_foreign_birth_city = $anag->anag_foreign_birth_city;
|
|
|
|
|
+ $this->anag_foreign_residence_country = $anag->anag_foreign_residence_country;
|
|
|
|
|
+ $this->anag_foreign_residence_city = $anag->anag_foreign_residence_city;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $this->emit('load-anagrafica-modal');
|
|
|
|
|
+
|
|
|
|
|
+ $this->emit('change-visualization', $this->anag_type);
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->anag_birth_town_id > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->anag_birth_town_id, $this->getLocalita($this->anag_birth_town_id), 'anag_birth_town_id');
|
|
|
|
|
+ if ($this->anag_residenza_town_id > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->anag_residenza_town_id, $this->getLocalita($this->anag_residenza_town_id), 'anag_residenza_town_id');
|
|
|
|
|
+ if ($this->anag_documento_rilasciato_da_di_foreign_localita > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->anag_documento_rilasciato_da_di_foreign_localita, $this->getLocalita($this->anag_documento_rilasciato_da_di_foreign_localita), 'anag_documento_rilasciato_da_di_foreign_localita');
|
|
|
|
|
+ if ($this->vei_carta_circolazione_rilasciata_da_di_foreign_localita > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->vei_carta_circolazione_rilasciata_da_di_foreign_localita, $this->getLocalita($this->vei_carta_circolazione_rilasciata_da_di_foreign_localita), 'vei_carta_circolazione_rilasciata_da_di_foreign_localita');
|
|
|
|
|
+ if ($this->anag_sede_legale_town_id > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->anag_sede_legale_town_id, $this->getLocalita($this->anag_sede_legale_town_id), 'anag_sede_legale_town_id');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addVeicolo($progressive)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetVeicolo();
|
|
|
|
|
+ $this->currentProgressive = $progressive;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function editVeicolo($veicolo)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetVeicolo();
|
|
|
|
|
+
|
|
|
|
|
+ $vei = \App\Models\Vehicle::where('id', $veicolo)->first();
|
|
|
|
|
+ if ($vei != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->currentVeicolo = $veicolo;
|
|
|
|
|
+ $this->vei_tipo_id = $vei->tipo_id;
|
|
|
|
|
+ $this->vei_marca_id = $vei->marca_id;
|
|
|
|
|
+ $this->vei_marca_altro = $vei->marca_altro;
|
|
|
|
|
+ $this->vei_modello_id = $vei->modello_id;
|
|
|
|
|
+ $this->vei_modello_altro = $vei->modello_altro;
|
|
|
|
|
+ $this->vei_colore = $vei->colore;
|
|
|
|
|
+ $this->vei_targa = $vei->targa;
|
|
|
|
|
+ $this->vei_carta_circolazione = $vei->carta_circolazione;
|
|
|
|
|
+ $this->vei_carta_circolazione_rilasciata_da = $vei->carta_circolazione_rilasciata_da;
|
|
|
|
|
+ $this->vei_carta_circolazione_rilasciata_da_altro = $vei->carta_circolazione_rilasciata_da_altro;
|
|
|
|
|
+ $this->vei_foreign_country = $vei->foreign_country;
|
|
|
|
|
+ $this->vei_carta_circolazione_rilasciata_da_di_foreign_country = $vei->carta_circolazione_rilasciata_da_di_foreign_country;
|
|
|
|
|
+ $this->vei_carta_circolazione_rilasciata_da_di_foreign_localita = $vei->carta_circolazione_rilasciata_da_di_foreign_localita;
|
|
|
|
|
+ $this->vei_carta_circolazione_rilasciata_da_di = $vei->carta_circolazione_rilasciata_da_di;
|
|
|
|
|
+ $this->vei_carta_circolazione_rilasciata_il = $vei->carta_circolazione_rilasciata_il;
|
|
|
|
|
+ $this->vei_data_ultima_revisione = $vei->data_ultima_revisione;
|
|
|
|
|
+ $this->vei_cilindrata = $vei->cilindrata;
|
|
|
|
|
+ $this->vei_peso_complessivo = $vei->peso_complessivo;
|
|
|
|
|
+ $this->vei_destinazione_uso = $vei->destinazione_uso;
|
|
|
|
|
+ $this->vei_state = $vei->state;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function editVeicoloData($progressive)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetVeicoloData();
|
|
|
|
|
+
|
|
|
|
|
+ $this->currentProgressive = $progressive;
|
|
|
|
|
+
|
|
|
|
|
+ $data = \App\Models\ReportDataVeicoli::where('progressive', $progressive)->where('report_id', $this->dataId)->first();
|
|
|
|
|
+ if ($data != null)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->currentVeicolo = $data->veicolo;
|
|
|
|
|
+
|
|
|
|
|
+ $this->data_chilometri_percorsi = $data->chilometri_percorsi;
|
|
|
|
|
+ $this->data_stato_veicolo = $data->stato_veicolo;
|
|
|
|
|
+ $this->data_polizze = $data->polizze;
|
|
|
|
|
+ $this->data_proprietari = $data->proprietari;
|
|
|
|
|
+ $this->data_coproprietari = $data->coproprietari;
|
|
|
|
|
+ $this->data_conducente_uguale_proprietario = $data->conducente_uguale_proprietario;
|
|
|
|
|
+ $this->data_conducenti = $data->conducenti;
|
|
|
|
|
+ $this->data_infortunato = $data->infortunato;
|
|
|
|
|
+ $this->data_infortunato_ospedale = $data->infortunato_ospedale;
|
|
|
|
|
+ $this->data_patente_al_seguito = $data->patente_al_seguito;
|
|
|
|
|
+ $this->data_generalizzato = $data->generalizzato;
|
|
|
|
|
+ $this->data_generalizzato_altrove = $data->generalizzato_altrove;
|
|
|
|
|
+ $this->data_posizione_statica_finale = $data->posizione_statica_finale;
|
|
|
|
|
+ $this->data_danni_visibili_riportati = $data->danni_visibili_riportati;
|
|
|
|
|
+ $this->data_danni_visibili_pre_esistenti = $data->danni_visibili_pre_esistenti;
|
|
|
|
|
+ $this->data_destinazione_veicolo = $data->destinazione_veicolo;
|
|
|
|
|
+ $this->data_destinazione_veicolo_affidato_a = $data->destinazione_veicolo_affidato_a;
|
|
|
|
|
+ $this->data_destinazione_veicolo_sequestro_num_art = $data->destinazione_veicolo_sequestro_num_art;
|
|
|
|
|
+ $this->data_destinazione_veicolo_amministrativo_num = $data->destinazione_veicolo_amministrativo_num;
|
|
|
|
|
+ $this->data_destinazione_veicolo_amministrativo_num_art_violato = $data->destinazione_veicolo_amministrativo_num_art_violato;
|
|
|
|
|
+ $this->data_destinazione_veicolo_amministrativo_cds = $data->destinazione_veicolo_amministrativo_cds;
|
|
|
|
|
+ $this->data_circostanze_presunte_incidente = $data->circostanze_presunte_incidente;
|
|
|
|
|
+ $this->data_stato_pneumatici = $data->stato_pneumatici;
|
|
|
|
|
+ $this->data_marca_pneumatici = $data->marca_pneumatici;
|
|
|
|
|
+ $this->data_misura_pneumatici = $data->misura_pneumatici;
|
|
|
|
|
+ $this->data_dispositivi_ottici = $data->dispositivi_ottici;
|
|
|
|
|
+ $this->data_tergicristalli = $data->tergicristalli;
|
|
|
|
|
+ $this->data_segnale_pericolo = $data->segnale_pericolo;
|
|
|
|
|
+ $this->data_abs = $data->abs;
|
|
|
|
|
+ $this->data_gps = $data->gps;
|
|
|
|
|
+ $this->data_marcia_inserita = $data->marcia_inserita;
|
|
|
|
|
+ $this->data_cristallo = $data->cristallo;
|
|
|
|
|
+ $this->data_cristallo_posizione = $data->cristallo_posizione;
|
|
|
|
|
+ $this->data_specchio_retrovisore = $data->specchio_retrovisore;
|
|
|
|
|
+ $this->data_specchio_lat_dx = $data->specchio_lat_dx;
|
|
|
|
|
+ $this->data_specchio_lat_sx = $data->specchio_lat_sx;
|
|
|
|
|
+ $this->data_attivazione_airbag = $data->attivazione_airbag;
|
|
|
|
|
+ $this->data_airbag_posizione = $data->airbag_posizione;
|
|
|
|
|
+ $this->data_alcool_test = $data->alcool_test;
|
|
|
|
|
+ $this->data_alcool_test_esito = $data->alcool_test_esito;
|
|
|
|
|
+ $this->data_drug_test = $data->drug_test;
|
|
|
|
|
+ $this->data_drug_test_esito = $data->drug_test_esito;
|
|
|
|
|
+ $this->data_sistema_ritenuta_minori = $data->sistema_ritenuta_minori;
|
|
|
|
|
+ $this->data_sistema_ritenuta_minori_omologazione = $data->sistema_ritenuta_minori_omologazione;
|
|
|
|
|
+ $this->data_verbale_violazione_numero_1 = $data->verbale_violazione_numero_1;
|
|
|
|
|
+ $this->data_articolo_violato_1 = $data->articolo_violato_1;
|
|
|
|
|
+ $this->data_cds_1 = $data->cds_1;
|
|
|
|
|
+ $this->data_verbale_violazione_numero_2 = $data->verbale_violazione_numero_2;
|
|
|
|
|
+ $this->data_articolo_violato_2 = $data->articolo_violato_2;
|
|
|
|
|
+ $this->data_cds_2 = $data->cds_2;
|
|
|
|
|
+ $this->data_verbale_violazione_numero_3 = $data->verbale_violazione_numero_3;
|
|
|
|
|
+ $this->data_articolo_violato_3 = $data->articolo_violato_3;
|
|
|
|
|
+ $this->data_cds_3 = $data->cds_3;
|
|
|
|
|
+ $this->data_conducente_patente_numero = $data->conducente_patente_numero;
|
|
|
|
|
+ $this->data_conducente_patente_categoria = $data->conducente_patente_categoria;
|
|
|
|
|
+ $this->data_conducente_patente_rilasciata_da = $data->conducente_patente_rilasciata_da;
|
|
|
|
|
+ $this->data_conducente_patente_rilasciata_da_altro = $data->conducente_patente_rilasciata_da_altro;
|
|
|
|
|
+ $this->data_conducente_patente_rilasciata_il = $data->conducente_patente_rilasciata_il;
|
|
|
|
|
+ $this->data_conducente_patente_scadenza = $data->conducente_patente_scadenza;
|
|
|
|
|
+ $this->data_conducente_patente_prescrizioni = $data->conducente_patente_prescrizioni;
|
|
|
|
|
+ $this->data_conducente_patente_limitazioni_art_117_1 = $data->conducente_patente_limitazioni_art_117_1;
|
|
|
|
|
+ $this->data_conducente_patente_limitazioni_art_117_2 = $data->conducente_patente_limitazioni_art_117_2;
|
|
|
|
|
+ $this->data_conducente_patente_abilitazione = $data->conducente_patente_abilitazione;
|
|
|
|
|
+ $this->data_conducente_patente_abilitazione_numero = $data->conducente_patente_abilitazione_numero;
|
|
|
|
|
+ $this->data_conducente_patente_abilitazione_rilasciata_da = $data->conducente_patente_abilitazione_rilasciata_da;
|
|
|
|
|
+ $this->data_conducente_patente_abilitazione_rilasciata_il = $data->conducente_patente_abilitazione_rilasciata_il;
|
|
|
|
|
+ $this->data_conducente_documento = $data->conducente_documento;
|
|
|
|
|
+ $this->data_conducente_documento_numero = $data->conducente_documento_numero;
|
|
|
|
|
+ $this->data_conducente_sedicente = $data->conducente_sedicente;
|
|
|
|
|
+ $this->data_tipo_danno = $data->tipo_danno;
|
|
|
|
|
+ $this->data_entita_danno = $data->entita_danno;
|
|
|
|
|
+ $this->data_effetto_danno = $data->effetto_danno;
|
|
|
|
|
+ $this->data_parte_macchina = $data->parte_macchina;
|
|
|
|
|
+
|
|
|
|
|
+ $this->data_tipo_danno_2 = $data->tipo_danno_2;
|
|
|
|
|
+ $this->data_entita_danno_2 = $data->entita_danno_2;
|
|
|
|
|
+ $this->data_effetto_danno_2 = $data->effetto_danno_2;
|
|
|
|
|
+ $this->data_parte_macchina_2 = $data->parte_macchina_2;
|
|
|
|
|
+
|
|
|
|
|
+ $this->data_tipo_danno_3 = $data->tipo_danno_3;
|
|
|
|
|
+ $this->data_entita_danno_3 = $data->entita_danno_3;
|
|
|
|
|
+ $this->data_effetto_danno_3 = $data->effetto_danno_3;
|
|
|
|
|
+ $this->data_parte_macchina_3 = $data->parte_macchina_3;
|
|
|
|
|
+
|
|
|
|
|
+ $this->data_tipo_danno_4 = $data->tipo_danno_4;
|
|
|
|
|
+ $this->data_entita_danno_4 = $data->entita_danno_4;
|
|
|
|
|
+ $this->data_effetto_danno_4 = $data->effetto_danno_4;
|
|
|
|
|
+ $this->data_parte_macchina_4 = $data->parte_macchina_4;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($this->data_conducenti == "" || $this->data_conducenti == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $an = \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->where('progressive', $progressive)->first();
|
|
|
|
|
+ $this->data_conducenti = $an->anagrafica;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $cinture = \App\Models\ReportDataCintureSicurezza::where('progressive', $progressive)->where('report_id', $this->dataId)->first();
|
|
|
|
|
+ if ($cinture != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_cinture_conducente = $cinture->conducente;
|
|
|
|
|
+ $this->data_cinture_passeggeri_0 = $cinture->passeggeri_0;
|
|
|
|
|
+ $this->data_cinture_passeggeri_1 = $cinture->passeggeri_1;
|
|
|
|
|
+ $this->data_cinture_passeggeri_2 = $cinture->passeggeri_2;
|
|
|
|
|
+ $this->data_cinture_passeggeri_3 = $cinture->passeggeri_3;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $casco = \App\Models\ReportDataUsoDelCasco::where('progressive', $progressive)->where('report_id', $this->dataId)->first();
|
|
|
|
|
+ if ($casco != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_casco_conducente = $casco->conducente;
|
|
|
|
|
+ $this->data_casco_passeggero = $casco->passeggeri;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $omologazione = \App\Models\ReportDataUsoDelCascoOmologazione::where('progressive', $progressive)->where('report_id', $this->dataId)->first();
|
|
|
|
|
+ if ($omologazione != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_casco_omologazione_conducente = $omologazione->conducente;
|
|
|
|
|
+ $this->data_casco_omologazione_passeggero = $omologazione->passeggeri;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Passeggeri
|
|
|
|
|
+ $passeggeri = \App\Models\ReportDataPasseggeri::where('progressive', $progressive)->where('report_id', $this->dataId)->get();
|
|
|
|
|
+ foreach($passeggeri as $idx => $pa)
|
|
|
|
|
+ {
|
|
|
|
|
+ if($idx == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_0 = $pa->passeggero;
|
|
|
|
|
+ $this->data_infortunato_0 = $pa->infortunato;
|
|
|
|
|
+ $this->data_infortunato_ospedale_0 = $pa->infortunato_ospedale;
|
|
|
|
|
+ }
|
|
|
|
|
+ if($idx == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_1 = $pa->passeggero;
|
|
|
|
|
+ $this->data_infortunato_1 = $pa->infortunato;
|
|
|
|
|
+ $this->data_infortunato_ospedale_1 = $pa->infortunato_ospedale;
|
|
|
|
|
+ }
|
|
|
|
|
+ if($idx == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_2 = $pa->passeggero;
|
|
|
|
|
+ $this->data_infortunato_2 = $pa->infortunato;
|
|
|
|
|
+ $this->data_infortunato_ospedale_2 = $pa->infortunato_ospedale;
|
|
|
|
|
+ }
|
|
|
|
|
+ if($idx == 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_3 = $pa->passeggero;
|
|
|
|
|
+ $this->data_infortunato_3 = $pa->infortunato;
|
|
|
|
|
+ $this->data_infortunato_ospedale_3 = $pa->infortunato_ospedale;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Infortunati
|
|
|
|
|
+ $infortunati = \App\Models\ReportDataInfortunati::where('progressive', $progressive)->where('report_id', $this->dataId)->get();
|
|
|
|
|
+ foreach($infortunati as $idx => $i)
|
|
|
|
|
+ {
|
|
|
|
|
+ if($idx == 0)
|
|
|
|
|
+ $this->data_infortunato_extra_0 = $i->infortunato;
|
|
|
|
|
+ if($idx == 1)
|
|
|
|
|
+ $this->data_infortunato_extra_1 = $i->infortunato;
|
|
|
|
|
+ if($idx == 2)
|
|
|
|
|
+ $this->data_infortunato_extra_2 = $i->infortunato;
|
|
|
|
|
+ if($idx == 3)
|
|
|
|
|
+ $this->data_infortunato_extra_3 = $i->infortunato;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $this->emit('load-select-modal');
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->data_polizze > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_polizze, $this->getPolizza($this->data_polizze), 'data_polizze');
|
|
|
|
|
+ if ($this->data_proprietari > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_proprietari, $this->getAnagrafica($this->data_proprietari), 'data_proprietari');
|
|
|
|
|
+ if ($this->data_coproprietari > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_coproprietari, $this->getAnagrafica($this->data_coproprietari), 'data_coproprietari');
|
|
|
|
|
+ if ($this->data_passeggero_0 > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_0, $this->getAnagrafica($this->data_passeggero_0), 'data_passeggero_0');
|
|
|
|
|
+ if ($this->data_passeggero_1 > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_1, $this->getAnagrafica($this->data_passeggero_1), 'data_passeggero_1');
|
|
|
|
|
+ if ($this->data_passeggero_2 > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_2, $this->getAnagrafica($this->data_passeggero_2), 'data_passeggero_2');
|
|
|
|
|
+ if ($this->data_passeggero_3 > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_3, $this->getAnagrafica($this->data_passeggero_3), 'data_passeggero_3');
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->data_infortunato_extra_0 > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_infortunato_extra_0, $this->getAnagrafica($this->data_infortunato_extra_0), 'data_infortunato_extra_0');
|
|
|
|
|
+ if ($this->data_infortunato_extra_1 > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_infortunato_extra_1, $this->getAnagrafica($this->data_infortunato_extra_1), 'data_infortunato_extra_1');
|
|
|
|
|
+ if ($this->data_infortunato_extra_2 > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_infortunato_extra_2, $this->getAnagrafica($this->data_infortunato_extra_2), 'data_infortunato_extra_2');
|
|
|
|
|
+ if ($this->data_infortunato_extra_3 > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_infortunato_extra_3, $this->getAnagrafica($this->data_infortunato_extra_3), 'data_infortunato_extra_3');
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->data_conducenti > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_conducenti, $this->getAnagrafica($this->data_conducenti), 'data_conducenti');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function editPedoneData($progressive)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetPedoniData();
|
|
|
|
|
+
|
|
|
|
|
+ $this->currentProgressive = $progressive;
|
|
|
|
|
+
|
|
|
|
|
+ $x = \App\Models\ReportDataPartiCoinvolte::where('report_id', $this->dataId)->where('progressive', $progressive)->first();
|
|
|
|
|
+
|
|
|
|
|
+ $this->currentPedone = $x->anagrafica;
|
|
|
|
|
+
|
|
|
|
|
+ $data = \App\Models\ReportDataPedoni::where('progressive', $progressive)->where('report_id', $this->dataId)->first();
|
|
|
|
|
+ if ($data != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->generalizzato = $data->generalizzato;
|
|
|
|
|
+ $this->generalizzato_altrove = $data->generalizzato_altrove;
|
|
|
|
|
+ $this->infortunato = $data->infortunato;
|
|
|
|
|
+ $this->infortunato_ospedale = $data->infortunato_ospedale;
|
|
|
|
|
+ $this->pedone_posizione = $data->pedone_posizione;
|
|
|
|
|
+ $this->pedone_posizione_desc = $data->pedone_posizione_desc;
|
|
|
|
|
+ $this->pedone_referto = $data->pedone_referto;
|
|
|
|
|
+ $this->pedone_prognosi = $data->pedone_prognosi;
|
|
|
|
|
+ $this->pedone_pioggia = $data->pedone_pioggia;
|
|
|
|
|
+ $this->pedone_ombrello = $data->pedone_ombrello;
|
|
|
|
|
+ $this->pedone_notte = $data->pedone_notte;
|
|
|
|
|
+ $this->pedone_abiti_scuri = $data->pedone_abiti_scuri;
|
|
|
|
|
+ $this->verbale_violazione_numero = $data->verbale_violazione_numero;
|
|
|
|
|
+ $this->articolo_violato = $data->articolo_violato;
|
|
|
|
|
+ $this->cds = $data->cds;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->currentPedone > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->emit('load-pedone', $this->getAnagrafica($this->currentPedone));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $this->emit('load-select-pedone');
|
|
|
|
|
+
|
|
|
|
|
+ /*$this->emit('load-select-modal');
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->data_polizze > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_polizze, $this->getPolizza($this->data_polizze), 'data_polizze');
|
|
|
|
|
+ if ($this->data_proprietari > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_proprietari, $this->getAnagrafica($this->data_proprietari), 'data_proprietari');
|
|
|
|
|
+ if ($this->data_conducenti > 0)
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_conducenti, $this->getAnagrafica($this->data_conducenti), 'data_conducenti');*/
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function anagraficaSave()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->currentAnagrafica > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\Anagrafica::whereId($this->currentAnagrafica)->update([
|
|
|
|
|
+ 'type' => $this->anag_type,
|
|
|
|
|
+ 'firstname' => $this->anag_firstname,
|
|
|
|
|
+ 'lastname' => $this->anag_lastname,
|
|
|
|
|
+ 'gender' => $this->anag_gender,
|
|
|
|
|
+ 'birth_date' => $this->anag_birth_date,
|
|
|
|
|
+ 'birth_town_id' => $this->anag_birth_town_id,
|
|
|
|
|
+ 'birth_prov_id' => $this->anag_birth_prov_id,
|
|
|
|
|
+ 'residenza_town_id' => $this->anag_residenza_town_id,
|
|
|
|
|
+ 'residenza_prov_id' => $this->anag_residenza_prov_id,
|
|
|
|
|
+ 'residenza_address' => $this->anag_residenza_address,
|
|
|
|
|
+ 'residenza_cap' => $this->anag_residenza_cap,
|
|
|
|
|
+ 'mobile' => $this->anag_mobile,
|
|
|
|
|
+ 'sedicente' => $this->anag_sedicente,
|
|
|
|
|
+ 'documento_tipo' => $this->anag_documento_tipo,
|
|
|
|
|
+ 'documento_patente_cat' => $this->anag_documento_patente_cat,
|
|
|
|
|
+ 'documento_tipo_altro' => $this->anag_documento_tipo_altro,
|
|
|
|
|
+ 'documento_numero' => $this->anag_documento_numero,
|
|
|
|
|
+ 'documento_rilasciato_da' => $this->anag_documento_rilasciato_da,
|
|
|
|
|
+ 'documento_rilasciato_da_altro' => $this->anag_documento_rilasciato_da_altro,
|
|
|
|
|
+ 'foreign_country' => $this->anag_foreign_country,
|
|
|
|
|
+ 'documento_rilasciato_da_di_foreign_localita' => $this->anag_documento_rilasciato_da_di_foreign_localita,
|
|
|
|
|
+ 'documento_rilasciato_da_di_foreign_country' => $this->anag_documento_rilasciato_da_di_foreign_country,
|
|
|
|
|
+ 'documento_rilasciato_da_prov_id' => $this->anag_documento_rilasciato_da_prov_id,
|
|
|
|
|
+ 'documento_rilasciato_da_town_id' => $this->anag_documento_rilasciato_da_town_id,
|
|
|
|
|
+ 'documento_rilasciato_il' => $this->anag_documento_rilasciato_il,
|
|
|
|
|
+ 'documento_scadenza_il' => $this->anag_documento_scadenza_il,
|
|
|
|
|
+ 'state' => $this->anag_state,
|
|
|
|
|
+ 'nazionalita' => $this->anag_nazionalita,
|
|
|
|
|
+ 'nazione_straniera' => $this->anag_nazione_straniera,
|
|
|
|
|
+ 'localita_straniera' => $this->anag_localita_straniera,
|
|
|
|
|
+ 'rag_soc' => $this->anag_rag_soc,
|
|
|
|
|
+ 'vat' => $this->anag_vat,
|
|
|
|
|
+ 'sede_legale_town_id' => $this->anag_sede_legale_town_id,
|
|
|
|
|
+ 'sede_legale_prov_id' => $this->anag_sede_legale_prov_id,
|
|
|
|
|
+ 'sede_legale_address' => $this->anag_sede_legale_address,
|
|
|
|
|
+ 'sede_legale_cap' => $this->anag_sede_legale_cap,
|
|
|
|
|
+ 'phone' => $this->anag_phone,
|
|
|
|
|
+ 'anag_foreign_birth_country' => $this->anag_foreign_birth_country,
|
|
|
|
|
+ 'anag_foreign_birth_city' => $this->anag_foreign_birth_city,
|
|
|
|
|
+ 'anag_foreign_residence_country' => $this->anag_foreign_residence_country,
|
|
|
|
|
+ 'anag_foreign_residence_city' => $this->anag_foreign_residence_city
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ /*
|
|
|
|
|
+ if ($this->currentProprietario > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_proprietari, $this->getAnagrafica($this->data_proprietari), 'data_proprietari');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentPasseggero > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $set = true;
|
|
|
|
|
+ if ($this->currentPasseggero == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_0 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_0, $this->getAnagrafica($this->data_passeggero_0), 'data_passeggero_0');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentPasseggero == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_1 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_1, $this->getAnagrafica($this->data_passeggero_1), 'data_passeggero_1');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentPasseggero == 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_2 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_2, $this->getAnagrafica($this->data_passeggero_2), 'data_passeggero_2');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentPasseggero == 4)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_3 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_3, $this->getAnagrafica($this->data_passeggero_3), 'data_passeggero_3');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->currentInfortunato > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $set = true;
|
|
|
|
|
+ if ($this->currentInfortunato == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_infortunato_extra_0 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_infortunato_extra_0, $this->getAnagrafica($this->data_infortunato_extra_0), 'data_infortunato_extra_0');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentInfortunato == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_infortunato_extra_1 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_infortunato_extra_1, $this->getAnagrafica($this->data_infortunato_extra_1), 'data_infortunato_extra_1');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentInfortunato == 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_infortunato_extra_2 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_infortunato_extra_2, $this->getAnagrafica($this->data_infortunato_extra_2), 'data_infortunato_extra_2');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentInfortunato == 4)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_infortunato_extra_3 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_infortunato_extra_3, $this->getAnagrafica($this->data_infortunato_extra_3), 'data_infortunato_extra_3');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->currentConducente > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ //$this->emit('load-select-modal');
|
|
|
|
|
+ $this->emit('set-default-value', $this->data_conducenti, $this->getAnagrafica($this->data_conducenti), 'data_conducenti');
|
|
|
|
|
+ }*/
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ $anagrafica = \App\Models\Anagrafica::create([
|
|
|
|
|
+ 'type' => $this->anag_type,
|
|
|
|
|
+ 'firstname' => $this->anag_firstname,
|
|
|
|
|
+ 'lastname' => $this->anag_lastname,
|
|
|
|
|
+ 'gender' => $this->anag_gender,
|
|
|
|
|
+ 'birth_date' => $this->anag_birth_date,
|
|
|
|
|
+ 'birth_town_id' => $this->anag_birth_town_id,
|
|
|
|
|
+ 'birth_prov_id' => $this->anag_birth_prov_id,
|
|
|
|
|
+ 'residenza_town_id' => $this->anag_residenza_town_id,
|
|
|
|
|
+ 'residenza_prov_id' => $this->anag_residenza_prov_id,
|
|
|
|
|
+ 'residenza_address' => $this->anag_residenza_address,
|
|
|
|
|
+ 'residenza_cap' => $this->anag_residenza_cap,
|
|
|
|
|
+ 'mobile' => $this->anag_mobile,
|
|
|
|
|
+ 'sedicente' => $this->anag_sedicente,
|
|
|
|
|
+ 'documento_tipo' => $this->anag_documento_tipo,
|
|
|
|
|
+ 'documento_patente_cat' => $this->anag_documento_patente_cat,
|
|
|
|
|
+ 'documento_tipo_altro' => $this->anag_documento_tipo_altro,
|
|
|
|
|
+ 'documento_numero' => $this->anag_documento_numero,
|
|
|
|
|
+ 'documento_rilasciato_da' => $this->anag_documento_rilasciato_da,
|
|
|
|
|
+ 'documento_rilasciato_da_altro' => $this->anag_documento_rilasciato_da_altro,
|
|
|
|
|
+ 'foreign_country' => $this->anag_foreign_country,
|
|
|
|
|
+ 'documento_rilasciato_da_di_foreign_localita' => $this->anag_documento_rilasciato_da_di_foreign_localita,
|
|
|
|
|
+ 'documento_rilasciato_da_di_foreign_country' => $this->anag_documento_rilasciato_da_di_foreign_country,
|
|
|
|
|
+ 'documento_rilasciato_da_prov_id' => $this->anag_documento_rilasciato_da_prov_id,
|
|
|
|
|
+ 'documento_rilasciato_da_town_id' => $this->anag_documento_rilasciato_da_town_id,
|
|
|
|
|
+ 'documento_rilasciato_il' => $this->anag_documento_rilasciato_il,
|
|
|
|
|
+ 'documento_scadenza_il' => $this->anag_documento_scadenza_il,
|
|
|
|
|
+ 'state' => $this->anag_state,
|
|
|
|
|
+ 'nazionalita' => $this->anag_nazionalita,
|
|
|
|
|
+ 'nazione_straniera' => $this->anag_nazione_straniera,
|
|
|
|
|
+ 'localita_straniera' => $this->anag_localita_straniera,
|
|
|
|
|
+ 'rag_soc' => $this->anag_rag_soc,
|
|
|
|
|
+ 'vat' => $this->anag_vat,
|
|
|
|
|
+ 'sede_legale_town_id' => $this->anag_sede_legale_town_id,
|
|
|
|
|
+ 'sede_legale_prov_id' => $this->anag_sede_legale_prov_id,
|
|
|
|
|
+ 'sede_legale_address' => $this->anag_sede_legale_address,
|
|
|
|
|
+ 'sede_legale_cap' => $this->anag_sede_legale_cap,
|
|
|
|
|
+ 'phone' => $this->anag_phone
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ $set = false;
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->currentTeste > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $set = true;
|
|
|
|
|
+ if ($this->currentTeste == 1)
|
|
|
|
|
+ $this->data_testi_oculari_0 = $anagrafica->id;
|
|
|
|
|
+ if ($this->currentTeste == 2)
|
|
|
|
|
+ $this->data_testi_oculari_1 = $anagrafica->id;
|
|
|
|
|
+ if ($this->currentTeste == 3)
|
|
|
|
|
+ $this->data_testi_oculari_2 = $anagrafica->id;
|
|
|
|
|
+ if ($this->currentTeste == 4)
|
|
|
|
|
+ $this->data_testi_oculari_3 = $anagrafica->id;
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentProprietario > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $set = true;
|
|
|
|
|
+ $this->data_proprietari = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_proprietari, $this->getAnagrafica($this->data_proprietari), 'data_proprietari');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentCoproprietario > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $set = true;
|
|
|
|
|
+ $this->data_coproprietari = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_coproprietari, $this->getAnagrafica($this->data_coproprietari), 'data_coproprietari');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentPasseggero > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $set = true;
|
|
|
|
|
+ if ($this->currentPasseggero == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_0 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_0, $this->getAnagrafica($this->data_passeggero_0), 'data_passeggero_0');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentPasseggero == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_1 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_1, $this->getAnagrafica($this->data_passeggero_1), 'data_passeggero_1');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentPasseggero == 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_2 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_2, $this->getAnagrafica($this->data_passeggero_2), 'data_passeggero_2');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentPasseggero == 4)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_passeggero_3 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_passeggero_3, $this->getAnagrafica($this->data_passeggero_3), 'data_passeggero_3');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->currentInfortunato > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $set = true;
|
|
|
|
|
+ if ($this->currentInfortunato == 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_infortunato_extra_0 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_infortunato_extra_0, $this->getAnagrafica($this->data_infortunato_extra_0), 'data_infortunato_extra_0');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentInfortunato == 2)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_infortunato_extra_1 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_infortunato_extra_1, $this->getAnagrafica($this->data_infortunato_extra_1), 'data_infortunato_extra_1');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentInfortunato == 3)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_infortunato_extra_2 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_infortunato_extra_2, $this->getAnagrafica($this->data_infortunato_extra_2), 'data_infortunato_extra_2');
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->currentInfortunato == 4)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->data_infortunato_extra_3 = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_infortunato_extra_3, $this->getAnagrafica($this->data_infortunato_extra_3), 'data_infortunato_extra_3');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->currentConducente > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $set = true;
|
|
|
|
|
+ $this->data_conducenti = $anagrafica->id;
|
|
|
|
|
+ $this->emit('add-default-value', $this->data_conducenti, $this->getAnagrafica($this->data_conducenti), 'data_conducenti');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->currentProgressive > -1 && !$set)
|
|
|
|
|
+ $this->updateAnagraficaParteCoinvolta($anagrafica->id, $this->currentProgressive);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetAnagrafica();
|
|
|
|
|
+ $this->emit('close-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function accertatoreSave()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->currentAccertatore > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\User::whereId($this->currentAccertatore)->update([
|
|
|
|
|
+ 'firstname' => $this->accertatore_nome,
|
|
|
|
|
+ 'lastname' => $this->accertatore_cognome,
|
|
|
|
|
+ 'username' => $this->accertatore_username,
|
|
|
|
|
+ 'email' => $this->accertatore_email,
|
|
|
|
|
+ 'password' => $this->accertatore_password,
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ $accertatore = \App\Models\User::create([
|
|
|
|
|
+ 'firstname' => $this->accertatore_nome,
|
|
|
|
|
+ 'lastname' => $this->accertatore_cognome,
|
|
|
|
|
+ 'username' => $this->accertatore_username,
|
|
|
|
|
+ 'email' => $this->accertatore_email,
|
|
|
|
|
+ 'password' => bcrypt($this->accertatore_password),
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->currentAccertatoreNumero == 1)
|
|
|
|
|
+ $this->accertatore_1 = $accertatore->id;
|
|
|
|
|
+ if ($this->currentAccertatoreNumero == 2)
|
|
|
|
|
+ $this->accertatore_2 = $accertatore->id;
|
|
|
|
|
+ if ($this->currentAccertatoreNumero == 3)
|
|
|
|
|
+ $this->accertatore_3 = $accertatore->id;
|
|
|
|
|
+ if ($this->currentAccertatoreNumero == 4)
|
|
|
|
|
+ $this->accertatore_4 = $accertatore->id;
|
|
|
|
|
+ if ($this->currentAccertatoreNumero == 5)
|
|
|
|
|
+ $this->accertatore_5 = $accertatore->id;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetAccertatore();
|
|
|
|
|
+ $this->emit('close-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function veicoloSave()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->validate([
|
|
|
|
|
+ 'vei_tipo_id' => 'required',
|
|
|
|
|
+ 'vei_marca_id' => 'required',
|
|
|
|
|
+ 'vei_modello_id' => 'required',
|
|
|
|
|
+ 'vei_carta_circolazione_rilasciata_da' => 'required',
|
|
|
|
|
+ 'vei_foreign_country' => 'required',
|
|
|
|
|
+ 'vei_carta_circolazione_rilasciata_da_di' => 'required',
|
|
|
|
|
+ 'vei_destinazione_uso' => 'required',
|
|
|
|
|
+ ], [
|
|
|
|
|
+ 'vei_tipo_id.required' => 'Il campo "Tipo di veicolo" è obbligatorio.',
|
|
|
|
|
+ 'vei_marca_id.required' => 'Il campo "Marca" è obbligatorio.',
|
|
|
|
|
+ 'vei_modello_id.required' => 'Il campo "Modello" è obbligatorio.',
|
|
|
|
|
+ 'vei_carta_circolazione_rilasciata_da.required' => 'Il campo "Rilasciata da" è obbligatorio.',
|
|
|
|
|
+ 'vei_foreign_country.required' => 'Il campo "Paese di rilascio" è obbligatorio.',
|
|
|
|
|
+ 'vei_carta_circolazione_rilasciata_da_di.required' => 'Il campo "Località di rilascio" è obbligatorio.',
|
|
|
|
|
+ 'vei_destinazione_uso.required' => 'Il campo "Destinazione d\'uso" è obbligatorio.',
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->currentVeicolo > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ \App\Models\Vehicle::whereId($this->currentVeicolo)->update([
|
|
|
|
|
+ 'tipo_id' => $this->vei_tipo_id,
|
|
|
|
|
+ 'marca_id' => $this->vei_marca_id,
|
|
|
|
|
+ 'marca_altro' => $this->vei_marca_altro,
|
|
|
|
|
+ 'modello_id' => $this->vei_modello_id,
|
|
|
|
|
+ 'modello_altro' => $this->vei_modello_altro,
|
|
|
|
|
+ 'colore' => $this->vei_colore,
|
|
|
|
|
+ 'targa' => $this->vei_targa,
|
|
|
|
|
+ 'carta_circolazione' => $this->vei_carta_circolazione,
|
|
|
|
|
+ 'carta_circolazione_rilasciata_da' => $this->vei_carta_circolazione_rilasciata_da,
|
|
|
|
|
+ 'carta_circolazione_rilasciata_da_altro' => $this->vei_carta_circolazione_rilasciata_da_altro,
|
|
|
|
|
+ 'foreign_country' => $this->vei_foreign_country,
|
|
|
|
|
+ 'carta_circolazione_rilasciata_da_di_foreign_country' => $this->vei_carta_circolazione_rilasciata_da_di_foreign_country,
|
|
|
|
|
+ 'carta_circolazione_rilasciata_da_di_foreign_localita' => $this->vei_carta_circolazione_rilasciata_da_di_foreign_localita,
|
|
|
|
|
+ 'carta_circolazione_rilasciata_da_di' => $this->vei_carta_circolazione_rilasciata_da_di,
|
|
|
|
|
+ 'carta_circolazione_rilasciata_il' => $this->vei_carta_circolazione_rilasciata_il,
|
|
|
|
|
+ 'data_ultima_revisione' => $this->vei_data_ultima_revisione,
|
|
|
|
|
+ 'cilindrata' => $this->vei_cilindrata,
|
|
|
|
|
+ 'peso_complessivo' => $this->vei_peso_complessivo,
|
|
|
|
|
+ 'destinazione_uso' => $this->vei_destinazione_uso
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ $veicolo = \App\Models\Vehicle::create([
|
|
|
|
|
+ 'tipo_id' => $this->vei_tipo_id,
|
|
|
|
|
+ 'marca_id' => $this->vei_marca_id,
|
|
|
|
|
+ 'marca_altro' => $this->vei_marca_altro,
|
|
|
|
|
+ 'modello_id' => $this->vei_modello_id,
|
|
|
|
|
+ 'modello_altro' => $this->vei_modello_altro,
|
|
|
|
|
+ 'colore' => $this->vei_colore,
|
|
|
|
|
+ 'targa' => $this->vei_targa,
|
|
|
|
|
+ 'carta_circolazione' => $this->vei_carta_circolazione,
|
|
|
|
|
+ 'carta_circolazione_rilasciata_da' => $this->vei_carta_circolazione_rilasciata_da,
|
|
|
|
|
+ 'carta_circolazione_rilasciata_da_altro' => $this->vei_carta_circolazione_rilasciata_da_altro,
|
|
|
|
|
+ 'foreign_country' => $this->vei_foreign_country,
|
|
|
|
|
+ 'carta_circolazione_rilasciata_da_di_foreign_country' => $this->vei_carta_circolazione_rilasciata_da_di_foreign_country,
|
|
|
|
|
+ 'carta_circolazione_rilasciata_da_di_foreign_localita' => $this->vei_carta_circolazione_rilasciata_da_di_foreign_localita,
|
|
|
|
|
+ 'carta_circolazione_rilasciata_da_di' => $this->vei_carta_circolazione_rilasciata_da_di,
|
|
|
|
|
+ 'carta_circolazione_rilasciata_il' => $this->vei_carta_circolazione_rilasciata_il,
|
|
|
|
|
+ 'data_ultima_revisione' => $this->vei_data_ultima_revisione,
|
|
|
|
|
+ 'cilindrata' => $this->vei_cilindrata,
|
|
|
|
|
+ 'peso_complessivo' => $this->vei_peso_complessivo,
|
|
|
|
|
+ 'destinazione_uso' => $this->vei_destinazione_uso
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $this->updateVeicoloParteCoinvolta($veicolo->id, $this->currentProgressive);
|
|
|
|
|
+ }
|
|
|
|
|
+ $this->resetVeicolo();
|
|
|
|
|
+ $this->emit('close-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function pedoneSave()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportDataPedoni::where('progressive', $this->currentProgressive)->where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ try
|
|
|
|
|
+ {
|
|
|
|
|
+ $pedone = \App\Models\ReportDataPedoni::create([
|
|
|
|
|
+ 'progressive' => $this->currentProgressive,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'pedoni' => $this->currentPedone,
|
|
|
|
|
+ 'generalizzato' => $this->generalizzato,
|
|
|
|
|
+ 'generalizzato_altrove' => $this->generalizzato_altrove,
|
|
|
|
|
+ 'infortunato' => $this->infortunato,
|
|
|
|
|
+ 'infortunato_ospedale' => $this->infortunato_ospedale,
|
|
|
|
|
+ 'pedone_posizione' => $this->pedone_posizione,
|
|
|
|
|
+ 'pedone_posizione_desc' => $this->pedone_posizione_desc,
|
|
|
|
|
+ 'pedone_referto' => $this->pedone_referto,
|
|
|
|
|
+ 'pedone_prognosi' => $this->pedone_prognosi,
|
|
|
|
|
+ 'pedone_pioggia' => $this->pedone_pioggia,
|
|
|
|
|
+ 'pedone_ombrello' => $this->pedone_ombrello,
|
|
|
|
|
+ 'pedone_notte' => $this->pedone_notte,
|
|
|
|
|
+ 'pedone_abiti_scuri' => $this->pedone_abiti_scuri,
|
|
|
|
|
+ 'verbale_violazione_numero' => $this->verbale_violazione_numero,
|
|
|
|
|
+ 'articolo_violato' => $this->articolo_violato,
|
|
|
|
|
+ 'cds' => $this->cds
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ session()->flash('success','Record salvato');
|
|
|
|
|
+
|
|
|
|
|
+ } catch (\Exception $ex) {
|
|
|
|
|
+ session()->flash('error','Errore in fase di salvataggio (' . $ex->getMessage() . ')');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetPedoniData();
|
|
|
|
|
+ $this->emit('close-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addAccertatore($numero)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetAccertatore();
|
|
|
|
|
+ $this->currenAccertatoreNumero = $numero;
|
|
|
|
|
+ // $this->emit('load-anagrafica-modal');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function editAccertatore($utente)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetAccertatore();
|
|
|
|
|
+
|
|
|
|
|
+ $acc = \App\Models\User::where('id', $utente)->first();
|
|
|
|
|
+ if ($acc != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->currentAccertatore = $utente;
|
|
|
|
|
+ $this->accertatore_nome = $acc->firstname;
|
|
|
|
|
+ $this->accertatore_cognome = $acc->lastname;
|
|
|
|
|
+ // $this->accertatore_grado = 0;
|
|
|
|
|
+ $this->accertatore_username = $acc->username;
|
|
|
|
|
+ $this->accertatore_email = $acc->email;
|
|
|
|
|
+ $this->accertatore_password = '';
|
|
|
|
|
+ $this->accertatore_password_conferma = '';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function anagraficaDataParteComuneSave()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ // Elimino i vecchi record
|
|
|
|
|
+
|
|
|
|
|
+ \App\Models\ReportDataVeicoli::where('progressive', $this->currentProgressive)->where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ \App\Models\ReportDataInfortunati::where('progressive', $this->currentProgressive)->where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ \App\Models\ReportDataPasseggeri::where('progressive', $this->currentProgressive)->where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ \App\Models\ReportDataUsoDelCascoOmologazione::where('progressive', $this->currentProgressive)->where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ \App\Models\ReportDataUsoDelCasco::where('progressive', $this->currentProgressive)->where('report_id', $this->dataId)->delete();
|
|
|
|
|
+ \App\Models\ReportDataCintureSicurezza::where('progressive', $this->currentProgressive)->where('report_id', $this->dataId)->delete();
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ \App\Models\ReportDataVeicoli::create([
|
|
|
|
|
+ 'progressive' => $this->currentProgressive,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'veicolo' => $this->currentVeicolo,
|
|
|
|
|
+ 'chilometri_percorsi' => $this->data_chilometri_percorsi,
|
|
|
|
|
+ 'stato_veicolo' => $this->data_stato_veicolo,
|
|
|
|
|
+ 'polizze' => $this->data_polizze,
|
|
|
|
|
+ 'proprietari' => $this->data_proprietari,
|
|
|
|
|
+ 'coproprietari' => $this->data_coproprietari,
|
|
|
|
|
+ 'conducente_uguale_proprietario' => $this->data_conducente_uguale_proprietario,
|
|
|
|
|
+ 'conducenti' => $this->data_conducenti,
|
|
|
|
|
+ 'infortunato' => $this->data_infortunato,
|
|
|
|
|
+ 'infortunato_ospedale' => $this->data_infortunato_ospedale,
|
|
|
|
|
+ 'patente_al_seguito' => $this->data_patente_al_seguito,
|
|
|
|
|
+ 'generalizzato' => $this->data_generalizzato,
|
|
|
|
|
+ 'generalizzato_altrove' => $this->data_generalizzato_altrove,
|
|
|
|
|
+ 'posizione_statica_finale' => $this->data_posizione_statica_finale,
|
|
|
|
|
+ 'danni_visibili_riportati' => $this->data_danni_visibili_riportati,
|
|
|
|
|
+ 'danni_visibili_pre_esistenti' => $this->data_danni_visibili_pre_esistenti,
|
|
|
|
|
+ 'destinazione_veicolo' => $this->data_destinazione_veicolo,
|
|
|
|
|
+ 'destinazione_veicolo_affidato_a' => $this->data_destinazione_veicolo_affidato_a,
|
|
|
|
|
+ 'destinazione_veicolo_sequestro_num_art' => $this->data_destinazione_veicolo_sequestro_num_art,
|
|
|
|
|
+ 'destinazione_veicolo_amministrativo_num' => $this->data_destinazione_veicolo_amministrativo_num,
|
|
|
|
|
+ 'destinazione_veicolo_amministrativo_num_art_violato' => $this->data_destinazione_veicolo_amministrativo_num_art_violato,
|
|
|
|
|
+ 'destinazione_veicolo_amministrativo_cds' => $this->data_destinazione_veicolo_amministrativo_cds,
|
|
|
|
|
+ 'circostanze_presunte_incidente' => $this->data_circostanze_presunte_incidente,
|
|
|
|
|
+ 'stato_pneumatici' => $this->data_stato_pneumatici,
|
|
|
|
|
+ 'marca_pneumatici' => $this->data_marca_pneumatici,
|
|
|
|
|
+ 'misura_pneumatici' => $this->data_misura_pneumatici,
|
|
|
|
|
+ 'dispositivi_ottici' => $this->data_dispositivi_ottici,
|
|
|
|
|
+ 'tergicristalli' => $this->data_tergicristalli,
|
|
|
|
|
+ 'segnale_pericolo' => $this->data_segnale_pericolo,
|
|
|
|
|
+ 'abs' => $this->data_abs,
|
|
|
|
|
+ 'gps' => $this->data_gps,
|
|
|
|
|
+ 'marcia_inserita' => $this->data_marcia_inserita,
|
|
|
|
|
+ 'cristallo' => $this->data_cristallo,
|
|
|
|
|
+ 'cristallo_posizione' => $this->data_cristallo_posizione,
|
|
|
|
|
+ 'specchio_retrovisore' => $this->data_specchio_retrovisore,
|
|
|
|
|
+ 'specchio_lat_dx' => $this->data_specchio_lat_dx,
|
|
|
|
|
+ 'specchio_lat_sx' => $this->data_specchio_lat_sx,
|
|
|
|
|
+ 'attivazione_airbag' => $this->data_attivazione_airbag,
|
|
|
|
|
+ 'airbag_posizione' => $this->data_airbag_posizione,
|
|
|
|
|
+ 'alcool_test' => $this->data_alcool_test,
|
|
|
|
|
+ 'alcool_test_esito' => $this->data_alcool_test_esito,
|
|
|
|
|
+ 'drug_test' => $this->data_drug_test,
|
|
|
|
|
+ 'drug_test_esito' => $this->data_drug_test_esito,
|
|
|
|
|
+ 'sistema_ritenuta_minori' => $this->data_sistema_ritenuta_minori,
|
|
|
|
|
+ 'sistema_ritenuta_minori_omologazione' => $this->data_sistema_ritenuta_minori_omologazione,
|
|
|
|
|
+ 'verbale_violazione_numero_1' => $this->data_verbale_violazione_numero_1,
|
|
|
|
|
+ 'articolo_violato_1' => $this->data_articolo_violato_1,
|
|
|
|
|
+ 'cds_1' => $this->data_cds_1,
|
|
|
|
|
+ 'verbale_violazione_numero_2' => $this->data_verbale_violazione_numero_2,
|
|
|
|
|
+ 'articolo_violato_2' => $this->data_articolo_violato_2,
|
|
|
|
|
+ 'cds_2' => $this->data_cds_2,
|
|
|
|
|
+ 'verbale_violazione_numero_3' => $this->data_verbale_violazione_numero_3,
|
|
|
|
|
+ 'articolo_violato_3' => $this->data_articolo_violato_3,
|
|
|
|
|
+ 'cds_3' => $this->data_cds_3,
|
|
|
|
|
+ 'conducente_patente_numero' => $this->data_conducente_patente_numero,
|
|
|
|
|
+ 'conducente_patente_categoria' => $this->data_conducente_patente_categoria,
|
|
|
|
|
+ 'conducente_patente_rilasciata_da' => $this->data_conducente_patente_rilasciata_da,
|
|
|
|
|
+ 'conducente_patente_rilasciata_da_altro' => $this->data_conducente_patente_rilasciata_da_altro,
|
|
|
|
|
+ 'conducente_patente_rilasciata_il' => $this->data_conducente_patente_rilasciata_il,
|
|
|
|
|
+ 'conducente_patente_scadenza' => $this->data_conducente_patente_scadenza,
|
|
|
|
|
+ 'conducente_patente_prescrizioni' => $this->data_conducente_patente_prescrizioni,
|
|
|
|
|
+ 'conducente_patente_limitazioni_art_117_1' => $this->data_conducente_patente_limitazioni_art_117_1,
|
|
|
|
|
+ 'conducente_patente_limitazioni_art_117_2' => $this->data_conducente_patente_limitazioni_art_117_2,
|
|
|
|
|
+ 'conducente_patente_abilitazione' => $this->data_conducente_patente_abilitazione,
|
|
|
|
|
+ 'conducente_patente_abilitazione_numero' => $this->data_conducente_patente_abilitazione_numero,
|
|
|
|
|
+ 'conducente_patente_abilitazione_rilasciata_da' => $this->data_conducente_patente_abilitazione_rilasciata_da,
|
|
|
|
|
+ 'conducente_patente_abilitazione_rilasciata_il' => $this->data_conducente_patente_abilitazione_rilasciata_il,
|
|
|
|
|
+ 'conducente_documento' => $this->data_conducente_documento,
|
|
|
|
|
+ 'conducente_documento_numero' => $this->data_conducente_documento_numero,
|
|
|
|
|
+ 'conducente_sedicente' => $this->data_conducente_sedicente,
|
|
|
|
|
+ 'tipo_danno' => $this->data_tipo_danno > 0 ? $this->data_tipo_danno : null,
|
|
|
|
|
+ 'entita_danno' => $this->data_entita_danno > 0 ? $this->data_entita_danno : null,
|
|
|
|
|
+ 'effetto_danno' => $this->data_effetto_danno > 0 ? $this->data_effetto_danno : null,
|
|
|
|
|
+ 'parte_macchina' => $this->data_parte_macchina > 0 ? $this->data_parte_macchina : null,
|
|
|
|
|
+ 'tipo_danno_2' => $this->data_tipo_danno_2 > 0 ? $this->data_tipo_danno_2 : null,
|
|
|
|
|
+ 'entita_danno_2' => $this->data_entita_danno_2 > 0 ? $this->data_entita_danno_2 : null,
|
|
|
|
|
+ 'effetto_danno_2' => $this->data_effetto_danno_2 > 0 ? $this->data_effetto_danno_2 : null,
|
|
|
|
|
+ 'parte_macchina_2' => $this->data_parte_macchina_2 > 0 ? $this->data_parte_macchina_2 : null,
|
|
|
|
|
+ 'tipo_danno_3' => $this->data_tipo_danno_3 > 0 ? $this->data_tipo_danno_3 : null,
|
|
|
|
|
+ 'entita_danno_3' => $this->data_entita_danno_3 > 0 ? $this->data_entita_danno_3 : null,
|
|
|
|
|
+ 'effetto_danno_3' => $this->data_effetto_danno_3 > 0 ? $this->data_effetto_danno_3 : null,
|
|
|
|
|
+ 'parte_macchina_3' => $this->data_parte_macchina_3 > 0 ? $this->data_parte_macchina_3 : null,
|
|
|
|
|
+ 'tipo_danno_4' => $this->data_tipo_danno_4 > 0 ? $this->data_tipo_danno_4 : null,
|
|
|
|
|
+ 'entita_danno_4' => $this->data_entita_danno_4 > 0 ? $this->data_entita_danno_4 : null,
|
|
|
|
|
+ 'effetto_danno_4' => $this->data_effetto_danno_4 > 0 ? $this->data_effetto_danno_4 : null,
|
|
|
|
|
+ 'parte_macchina_4' => $this->data_parte_macchina_4 > 0 ? $this->data_parte_macchina_4 : null
|
|
|
|
|
+ ]);
|
|
|
|
|
+ session()->flash('success','Record creato');
|
|
|
|
|
+
|
|
|
|
|
+ } catch (\Exception $ex) {
|
|
|
|
|
+ session()->flash('error','Errore in fase di salvataggio (' . $ex->getMessage() . ')');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ \App\Models\ReportDataCintureSicurezza::create([
|
|
|
|
|
+ 'progressive' => $this->currentProgressive,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'conducente' => $this->data_cinture_conducente,
|
|
|
|
|
+ 'passeggeri_0' => $this->data_cinture_passeggeri_0,
|
|
|
|
|
+ 'passeggeri_1' => $this->data_cinture_passeggeri_1,
|
|
|
|
|
+ 'passeggeri_2' => $this->data_cinture_passeggeri_2,
|
|
|
|
|
+ 'passeggeri_3' => $this->data_cinture_passeggeri_3
|
|
|
|
|
+ ]);
|
|
|
|
|
+ // session()->flash('success','Record creato');
|
|
|
|
|
+ } catch (\Exception $ex) {
|
|
|
|
|
+ session()->flash('error','Errore in fase di salvataggio (' . $ex->getMessage() . ')');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ \App\Models\ReportDataUsoDelCasco::create([
|
|
|
|
|
+ 'progressive' => $this->currentProgressive,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'conducente' => $this->data_casco_conducente,
|
|
|
|
|
+ 'passeggeri' => $this->data_casco_passeggero
|
|
|
|
|
+ ]);
|
|
|
|
|
+ // session()->flash('success','Record creato');
|
|
|
|
|
+ } catch (\Exception $ex) {
|
|
|
|
|
+ session()->flash('error','Errore in fase di salvataggio (' . $ex->getMessage() . ')');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ \App\Models\ReportDataUsoDelCascoOmologazione::create([
|
|
|
|
|
+ 'progressive' => $this->currentProgressive,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'conducente' => $this->data_casco_omologazione_conducente,
|
|
|
|
|
+ 'passeggeri' => $this->data_casco_omologazione_passeggero
|
|
|
|
|
+ ]);
|
|
|
|
|
+ // session()->flash('success','Record creato');
|
|
|
|
|
+ } catch (\Exception $ex) {
|
|
|
|
|
+ session()->flash('error','Errore in fase di salvataggio (' . $ex->getMessage() . ')');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ \App\Models\ReportDataPasseggeri::create([
|
|
|
|
|
+ 'progressive' => $this->currentProgressive,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'passeggero' => $this->data_passeggero_0,
|
|
|
|
|
+ 'infortunato' => $this->data_infortunato_0,
|
|
|
|
|
+ 'infortunato_ospedale' => $this->data_infortunato_ospedale_0
|
|
|
|
|
+ ]);
|
|
|
|
|
+ \App\Models\ReportDataPasseggeri::create([
|
|
|
|
|
+ 'progressive' => $this->currentProgressive,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'passeggero' => $this->data_passeggero_1,
|
|
|
|
|
+ 'infortunato' => $this->data_infortunato_1,
|
|
|
|
|
+ 'infortunato_ospedale' => $this->data_infortunato_ospedale_1
|
|
|
|
|
+ ]);
|
|
|
|
|
+ \App\Models\ReportDataPasseggeri::create([
|
|
|
|
|
+ 'progressive' => $this->currentProgressive,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'passeggero' => $this->data_passeggero_2,
|
|
|
|
|
+ 'infortunato' => $this->data_infortunato_2,
|
|
|
|
|
+ 'infortunato_ospedale' => $this->data_infortunato_ospedale_2
|
|
|
|
|
+ ]);
|
|
|
|
|
+ \App\Models\ReportDataPasseggeri::create([
|
|
|
|
|
+ 'progressive' => $this->currentProgressive,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'passeggero' => $this->data_passeggero_3,
|
|
|
|
|
+ 'infortunato' => $this->data_infortunato_3,
|
|
|
|
|
+ 'infortunato_ospedale' => $this->data_infortunato_ospedale_3
|
|
|
|
|
+ ]);
|
|
|
|
|
+ // session()->flash('success','Record creato');
|
|
|
|
|
+ } catch (\Exception $ex) {
|
|
|
|
|
+ session()->flash('error','Errore in fase di salvataggio (' . $ex->getMessage() . ')');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ \App\Models\ReportDataInfortunati::create([
|
|
|
|
|
+ 'progressive' => $this->currentProgressive,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'infortunato' => $this->data_infortunato_extra_0
|
|
|
|
|
+ ]);
|
|
|
|
|
+ \App\Models\ReportDataInfortunati::create([
|
|
|
|
|
+ 'progressive' => $this->currentProgressive,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'infortunato' => $this->data_infortunato_extra_1
|
|
|
|
|
+ ]);
|
|
|
|
|
+ \App\Models\ReportDataInfortunati::create([
|
|
|
|
|
+ 'progressive' => $this->currentProgressive,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'infortunato' => $this->data_infortunato_extra_2
|
|
|
|
|
+ ]);
|
|
|
|
|
+ \App\Models\ReportDataInfortunati::create([
|
|
|
|
|
+ 'progressive' => $this->currentProgressive,
|
|
|
|
|
+ 'report_id' => $this->dataId,
|
|
|
|
|
+ 'infortunato' => $this->data_infortunato_extra_3
|
|
|
|
|
+ ]);
|
|
|
|
|
+ } catch (\Exception $ex) {
|
|
|
|
|
+ session()->flash('error','Errore in fase di salvataggio (' . $ex->getMessage() . ')');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $this->resetVeicoloData();
|
|
|
|
|
+ $this->emit('close-modal-parte-comune');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function dateToNull()
|
|
|
|
|
+ {
|
|
|
|
|
+ return "0000-00-00";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function getLocalita($localita)
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($localita > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $ret = \App\Models\LocationTown::where('id', $localita)->first();
|
|
|
|
|
+ if ($ret)
|
|
|
|
|
+ return $ret->title;
|
|
|
|
|
+ else
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function getStradario($stradario)
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($stradario > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $ret = \App\Models\Stradario::findOrFail($stradario);
|
|
|
|
|
+ return $ret->TOPONIMO . " " . $ret->DESCRIZIONE;
|
|
|
|
|
+ }
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function getAnagrafica($anagrafica)
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($anagrafica > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $ret = \App\Models\Anagrafica::findOrFail($anagrafica);
|
|
|
|
|
+ if($ret->type == 0)
|
|
|
|
|
+ return $ret->lastname . " " . $ret->firstname;
|
|
|
|
|
+ else
|
|
|
|
|
+ return $ret->rag_soc;
|
|
|
|
|
+ }
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function getAllegatoType($type)
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($type > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $ret = \App\Models\AllegatiGalleryType::findOrFail($type);
|
|
|
|
|
+ return $ret->name;
|
|
|
|
|
+ }
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function getAccertatore($accertatore)
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($accertatore > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $ret = \DB::table('fcf_users')->where('id', $accertatore)->first();
|
|
|
|
|
+ return @$ret->lastname . " " . @$ret->firstname;
|
|
|
|
|
+ }
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function getVeicolo($veicolo)
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($veicolo > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $ret = \App\Models\Vehicle::findOrFail($veicolo);
|
|
|
|
|
+ return ($ret->marca ? $ret->marca->name : '') . " " . ($ret->modello ? $ret->modello->name : '') . " " . $ret->targa;
|
|
|
|
|
+ }
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function getPolizza($polizza)
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($polizza > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ $ret = \App\Models\Polizza::with('compagnia')->with('anagrafica')->findOrFail($polizza);
|
|
|
|
|
+ return $ret->agenzia . " " . ($ret->compagnia ? $ret->compagnia->name : '') . " " . ($ret->anagrafica ? ($ret->anagrafica->lastname . " " . $ret->anagrafica->firstname) : '');
|
|
|
|
|
+ }
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function getByTarga()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->vei_targa != '')
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $targa = $this->vei_targa;
|
|
|
|
|
+
|
|
|
|
|
+ try
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $wd = "dettaglioAutoveicoloBase";
|
|
|
|
|
+
|
|
|
|
|
+ $wd = "datiCartaCircolazioneAutoveicoloProprietario";
|
|
|
|
|
+
|
|
|
|
|
+ $url = env('MCTC_URL', 'https://e-servizicoll.dtt.ilportaledellautomobilista.it/Info-ws-sh/services');
|
|
|
|
|
+ $client = new \SoapClient($url . '/' . $wd . '/' . $wd . '.wsdl', array(
|
|
|
|
|
+ 'stream_context' => stream_context_create(array(
|
|
|
|
|
+ 'ssl' => array(
|
|
|
|
|
+ 'verify_peer' => false,
|
|
|
|
|
+ 'verify_peer_name' => false,
|
|
|
|
|
+ 'allow_self_signed' => true
|
|
|
|
|
+ )
|
|
|
|
|
+ )),
|
|
|
|
|
+ 'trace'=>1
|
|
|
|
|
+ ));
|
|
|
|
|
+
|
|
|
|
|
+ $utente = env('MCTC_USER', '');
|
|
|
|
|
+ $password = env('MCTC_PASSWORD', '');
|
|
|
|
|
+
|
|
|
|
|
+ $xml = '<wsse:Security
|
|
|
|
|
+ xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
|
|
|
|
|
+ SOAP-ENV:mustUnderstand="1">
|
|
|
|
|
+ <wsse:UsernameToken
|
|
|
|
|
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
|
|
|
|
|
+ wsu:Id="XWSSGID-1253605895203984534550">
|
|
|
|
|
+ <wsse:Username>' . $utente . '</wsse:Username>
|
|
|
|
|
+ <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $password . '</wsse:Password>
|
|
|
|
|
+ </wsse:UsernameToken>
|
|
|
|
|
+ </wsse:Security>';
|
|
|
|
|
+
|
|
|
|
|
+ $header = new \SoapHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd',
|
|
|
|
|
+ 'Security',
|
|
|
|
|
+ new \SoapVar($xml, XSD_ANYXML),
|
|
|
|
|
+ true
|
|
|
|
|
+ );
|
|
|
|
|
+ $client->__setSoapHeaders($header);
|
|
|
|
|
+
|
|
|
|
|
+ $classe = "dettaglioAutoveicoloBase";
|
|
|
|
|
+
|
|
|
|
|
+ $classe = "dettaglioCartaCircolazioneProprietarioAutoveicolo";
|
|
|
|
|
+
|
|
|
|
|
+ try
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->loadTarga = "OK";
|
|
|
|
|
+ // Run the function
|
|
|
|
|
+ $obj = $client->__soapCall($classe, array(
|
|
|
|
|
+ $classe . "Request" => array(
|
|
|
|
|
+ "login" => array(
|
|
|
|
|
+
|
|
|
|
|
+ ),
|
|
|
|
|
+ //"dettaglioAutoveicoloBaseInput" => array(
|
|
|
|
|
+ "targa" => array("numeroTarga" => $targa),
|
|
|
|
|
+ //),
|
|
|
|
|
+ "pdf" => false
|
|
|
|
|
+ )
|
|
|
|
|
+ ));
|
|
|
|
|
+
|
|
|
|
|
+ \Log::debug(print_r($obj, true));
|
|
|
|
|
+
|
|
|
|
|
+ $this->vei_data_ultima_revisione = @$obj->DatiUltimaRevisione->dataUltimaRevisione;
|
|
|
|
|
+
|
|
|
|
|
+ $this->vei_carta_circolazione = @$obj->DatiAmministrativiVeicolo[0]->NumeroCartaCircolazione;
|
|
|
|
|
+
|
|
|
|
|
+ $this->vei_carta_circolazione_rilasciata_il = @$obj->DatiAmministrativiVeicolo[0]->DataEmissioneDocumento;
|
|
|
|
|
+
|
|
|
|
|
+ //$this->vei_data_ultima_revisione = @$obj->DatiUltimaRevisione->dataUltimaRevisione;
|
|
|
|
|
+
|
|
|
|
|
+ $this->vei_cilindrata = @$obj->DatiTecniciVeicolo->CilindrataInCentimetriCubi;
|
|
|
|
|
+
|
|
|
|
|
+ $this->vei_peso_complessivo = @$obj->DatiTecniciVeicolo->TaraInKG;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ catch(\SoapFault $fault)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->loadTarga = $fault->getMessage();
|
|
|
|
|
+ // <xmp> tag displays xml output in html
|
|
|
|
|
+ //echo 'Request : <br/><xmp>',
|
|
|
|
|
+ //$client->__getLastRequest(),
|
|
|
|
|
+ //'</xmp><br/><br/> Error Message : <br/>',
|
|
|
|
|
+ //$fault->getMessage();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ catch(Exception $ex)
|
|
|
|
|
+ {
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $this->emit('hideLoading', 'btTarga');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function getByPatente()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->anag_documento_numero != '')
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ // $this->emit('showLoading', 'btPatente');
|
|
|
|
|
+
|
|
|
|
|
+ $patente = $this->anag_documento_numero;
|
|
|
|
|
+
|
|
|
|
|
+ try{
|
|
|
|
|
+
|
|
|
|
|
+ $wd = "dettaglioPatenteBase";
|
|
|
|
|
+
|
|
|
|
|
+ $url = env('MCTC_URL', 'https://e-servizicoll.dtt.ilportaledellautomobilista.it/Info-ws-sh/services');
|
|
|
|
|
+ $client = new \SoapClient($url . '/' . $wd . '/' . $wd . '.wsdl', array(
|
|
|
|
|
+ 'stream_context' => stream_context_create(array(
|
|
|
|
|
+ 'ssl' => array(
|
|
|
|
|
+ 'verify_peer' => false,
|
|
|
|
|
+ 'verify_peer_name' => false,
|
|
|
|
|
+ 'allow_self_signed' => true
|
|
|
|
|
+ )
|
|
|
|
|
+ )),
|
|
|
|
|
+ 'trace'=>1
|
|
|
|
|
+ ));
|
|
|
|
|
+
|
|
|
|
|
+ $utente = env('MCTC_USER', '');
|
|
|
|
|
+ $password = env('MCTC_PASSWORD', '');
|
|
|
|
|
+
|
|
|
|
|
+ $xml = '<wsse:Security
|
|
|
|
|
+ xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
|
|
|
|
|
+ SOAP-ENV:mustUnderstand="1">
|
|
|
|
|
+ <wsse:UsernameToken
|
|
|
|
|
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
|
|
|
|
|
+ wsu:Id="XWSSGID-1253605895203984534550">
|
|
|
|
|
+ <wsse:Username>' . $utente . '</wsse:Username>
|
|
|
|
|
+ <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $password . '</wsse:Password>
|
|
|
|
|
+ </wsse:UsernameToken>
|
|
|
|
|
+ </wsse:Security>';
|
|
|
|
|
+
|
|
|
|
|
+ $header = new \SoapHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd',
|
|
|
|
|
+ 'Security',
|
|
|
|
|
+ new \SoapVar($xml, XSD_ANYXML),
|
|
|
|
|
+ true
|
|
|
|
|
+ );
|
|
|
|
|
+ $client->__setSoapHeaders($header);
|
|
|
|
|
+
|
|
|
|
|
+ $classe = "dettaglioPatente";
|
|
|
|
|
+
|
|
|
|
|
+ // $classe = "dettaglioCartaCircolazioneProprietarioAutoveicolo";
|
|
|
|
|
+ try{
|
|
|
|
|
+ $obj = $client->__soapCall($classe, array(
|
|
|
|
|
+ $classe . "Request" => array(
|
|
|
|
|
+ "login" => array(
|
|
|
|
|
+
|
|
|
|
|
+ ),
|
|
|
|
|
+ "ambitoPatenteBase" => array(
|
|
|
|
|
+ "patente" => array("numeroPatente" => $patente),
|
|
|
|
|
+ ),
|
|
|
|
|
+ "pdf" => false,
|
|
|
|
|
+ "pdfAnteprimaPatente" => false
|
|
|
|
|
+ )
|
|
|
|
|
+ ));
|
|
|
|
|
+
|
|
|
|
|
+ \Log::debug(print_r($obj, true));
|
|
|
|
|
+
|
|
|
|
|
+ $this->anag_firstname = @$obj->dettaglioPatenteBaseOutput->anagrafica->nome;
|
|
|
|
|
+
|
|
|
|
|
+ $this->anag_lastname = @$obj->dettaglioPatenteBaseOutput->anagrafica->cognome;
|
|
|
|
|
+
|
|
|
|
|
+ $this->anag_birth_date = @$obj->dettaglioPatenteBaseOutput->anagrafica->dataNascita;
|
|
|
|
|
+
|
|
|
|
|
+ // $output["comuneNascita"] = @$obj->dettaglioPatenteBaseOutput->anagrafica->luogoNascita->luogoItaliano->descrizioneComune;
|
|
|
|
|
+
|
|
|
|
|
+ // $output["codiceFiscale"] = @$obj->dettaglioPatenteBaseOutput->anagrafica->codiceFiscale;
|
|
|
|
|
+
|
|
|
|
|
+ $this->anag_residenza_address = @$obj->dettaglioPatenteBaseOutput->datiResidenza->indirizzoResidenza;
|
|
|
|
|
+
|
|
|
|
|
+ // $output["comuneResidenza"] = @$obj->dettaglioPatenteBaseOutput->datiResidenza->comuneResidenza;
|
|
|
|
|
+
|
|
|
|
|
+ // $output["luogoNascita"] = @$obj->dettaglioPatenteBaseOutput->anagrafica->luogoNascita->luogoItaliano->descrizioneComune;
|
|
|
|
|
+
|
|
|
|
|
+ // $output["provinciaResidenza"] = @$obj->dettaglioPatenteBaseOutput->datiResidenza->provinciaResidenza;
|
|
|
|
|
+
|
|
|
|
|
+ $this->anag_documento_scadenza_il = @$obj->dettaglioPatenteBaseOutput->datiPatente->dataScadenza;
|
|
|
|
|
+
|
|
|
|
|
+ $this->anag_documento_rilasciato_il = @$obj->dettaglioPatenteBaseOutput->datiPatente->dataEmissione;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ catch(\SoapFault $fault)
|
|
|
|
|
+ {
|
|
|
|
|
+ // <xmp> tag displays xml output in html
|
|
|
|
|
+ echo 'Request : <br/><xmp>',
|
|
|
|
|
+ $client->__getLastRequest(),
|
|
|
|
|
+ '</xmp><br/><br/> Error Message : <br/>',
|
|
|
|
|
+ $fault->getMessage();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ catch(\SoapFault $ex)
|
|
|
|
|
+ {
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $this->emit('hideLoading', 'btPatente');
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function print($id)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $record = \App\Models\Report::findOrFail($id);
|
|
|
|
|
+ $parti_coinvolte = \App\Models\ReportDataPartiCoinvolte::where('report_id', $id)->get();
|
|
|
|
|
+
|
|
|
|
|
+ $datiVeicolo = array();
|
|
|
|
|
+ $datiInfortunati = array();
|
|
|
|
|
+ $datiPasseggeri = array();
|
|
|
|
|
+ $datiPedoni = array();
|
|
|
|
|
+ $datiCascoOmologazione = array();
|
|
|
|
|
+ $datiCasco = array();
|
|
|
|
|
+ $datiCintureSicurezza = array();
|
|
|
|
|
+ foreach($parti_coinvolte as $pr)
|
|
|
|
|
+ {
|
|
|
|
|
+ $datiVeicolo[$pr->progressive] = \App\Models\ReportDataVeicoli::where('progressive', $pr->progressive)->where('report_id', $id)->first();
|
|
|
|
|
+ $datiPedoni[$pr->progressive] = \App\Models\ReportDataPedoni::where('progressive', $pr->progressive)->where('report_id', $id)->get();
|
|
|
|
|
+ $datiInfortunati[$pr->progressive] = \App\Models\ReportDataInfortunati::where('progressive', $this->currentProgressive)->where('report_id', $id)->get();
|
|
|
|
|
+ $datiPasseggeri[$pr->progressive] = \App\Models\ReportDataPasseggeri::where('progressive', $this->currentProgressive)->where('report_id', $id)->get();
|
|
|
|
|
+ $datiCascoOmologazione[$pr->progressive] = \App\Models\ReportDataUsoDelCascoOmologazione::where('progressive', $this->currentProgressive)->where('report_id', $id)->get();
|
|
|
|
|
+ $datiCasco[$pr->progressive] = \App\Models\ReportDataUsoDelCasco::where('progressive', $this->currentProgressive)->where('report_id', $id)->get();
|
|
|
|
|
+ $datiCintureSicurezza[$pr->progressive] = \App\Models\ReportDataCintureSicurezza::where('progressive', $this->currentProgressive)->where('report_id', $id)->get();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $testi_oculari = \App\Models\ReportDataTestimoniOculari::where('report_id', $id)->get();
|
|
|
|
|
+ $tipo_urto = \App\Models\ReportTipoUrto::where('report_id', $id)->get();
|
|
|
|
|
+ $tipo_segnalazione = \App\Models\ReportTipoSegnalazione::where('report_id', $id)->get();
|
|
|
|
|
+ $segnalazione_pervenuta_da = \App\Models\ReportSegnalazionePervenutaDa::where('report_id', $id)->get();
|
|
|
|
|
+ $ausilio_altri_enti = \App\Models\ReportAusilioAltriEnti::where('report_id', $id)->get();
|
|
|
|
|
+ $materiale_recuperato = \App\Models\ReportMaterialeRecuperato::where('report_id', $id)->get();
|
|
|
|
|
+ $condizioni_luce = \App\Models\ReportCondizioniLuce::where('report_id', $id)->get();
|
|
|
|
|
+ $tipo_strada = \App\Models\ReportTipoStrada::where('report_id', $id)->get();
|
|
|
|
|
+ $segnaletica_verticale_1 = \App\Models\ReportSegnaleticaVerticale1::where('report_id', $id)->get();
|
|
|
|
|
+ $segnaletica_verticale_2 = \App\Models\ReportSegnaleticaVerticale2::where('report_id', $id)->get();
|
|
|
|
|
+ $segnaletica_verticale_3 = \App\Models\ReportSegnaleticaVerticale3::where('report_id', $id)->get();
|
|
|
|
|
+ $segnaletica_verticale_4 = \App\Models\ReportSegnaleticaVerticale4::where('report_id', $id)->get();
|
|
|
|
|
+ $segnaletica_orizzontale_1 = \App\Models\ReportSegnaleticaOrizzontale1::where('report_id', $id)->get();
|
|
|
|
|
+ $segnaletica_orizzontale_2 = \App\Models\ReportSegnaleticaOrizzontale2::where('report_id', $id)->get();
|
|
|
|
|
+ $segnaletica_orizzontale_3 = \App\Models\ReportSegnaleticaOrizzontale3::where('report_id', $id)->get();
|
|
|
|
|
+ $segnaletica_orizzontale_4 = \App\Models\ReportSegnaleticaOrizzontale4::where('report_id', $id)->get();
|
|
|
|
|
+ $allegati = \App\Models\ReportAllegatiGallery::where('report_id', $id)->get();
|
|
|
|
|
+ $data = array('record' => $record, 'parti_coinvolte' => $parti_coinvolte, 'tipo_urto' => $tipo_urto,
|
|
|
|
|
+ 'tipo_segnalazione' => $tipo_segnalazione, 'segnalazione_pervenuta_da' => $segnalazione_pervenuta_da,
|
|
|
|
|
+ 'ausilio_altri_enti' => $ausilio_altri_enti,
|
|
|
|
|
+ 'materiale_recuperato' => $materiale_recuperato,
|
|
|
|
|
+ 'condizioni_luce' => $condizioni_luce, 'tipo_strada' => $tipo_strada,
|
|
|
|
|
+ 'segnaletica_orizzontale_1' => $segnaletica_orizzontale_1, 'segnaletica_orizzontale_2' => $segnaletica_orizzontale_2,
|
|
|
|
|
+ 'segnaletica_orizzontale_3' => $segnaletica_orizzontale_3, 'segnaletica_orizzontale_4' => $segnaletica_orizzontale_4,
|
|
|
|
|
+ 'segnaletica_verticale_1' => $segnaletica_verticale_1, 'segnaletica_verticale_2' => $segnaletica_verticale_2,
|
|
|
|
|
+ 'segnaletica_verticale_3' => $segnaletica_verticale_3, 'segnaletica_verticale_4' => $segnaletica_verticale_4,
|
|
|
|
|
+ 'datiPedoni' => $datiPedoni,
|
|
|
|
|
+ 'datiVeicolo' => $datiVeicolo, 'datiInfortunati' => $datiInfortunati, 'datiPasseggeri' => $datiPasseggeri,
|
|
|
|
|
+ 'datiCascoOmologazione' => $datiCascoOmologazione,
|
|
|
|
|
+ 'datiCasco' => $datiCasco, 'datiCintureSicurezza' => $datiCintureSicurezza, 'testi_oculari' => $testi_oculari,'allegati' => $allegati);
|
|
|
|
|
+
|
|
|
|
|
+ $pdf = Pdf::loadView('pdf.verbale', array('data' => $data));
|
|
|
|
|
+ $pdf->render();
|
|
|
|
|
+ $pageCount = $pdf->getDomPDF()->getCanvas()->get_page_count();
|
|
|
|
|
+ $data['total_pages'] = $pageCount;
|
|
|
|
|
+ $pdf = Pdf::loadView('pdf.verbale', array('data' => $data));
|
|
|
|
|
+ $pdfName = "verbale_" . $record->protocollo_num . '_' . $record->protocollo_anno . ".pdf";
|
|
|
|
|
+ $pdfContent = $pdf->output();
|
|
|
|
|
+ return $pdf->stream($pdfName, $pdfContent);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function updated($property, $value){
|
|
|
|
|
+ if ($property === 'verificatosi_in_data' && !preg_match('/^\d{4}-\d{2}-\d{2}$/', $value)) {
|
|
|
|
|
+ $this->verificatosi_in_data = null;
|
|
|
|
|
+ $this->addError('verificatosi_in_data', 'Il campo Verificatosi in data deve essere aggiornato solo dal selettore.');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|