@if($showModal)
        <div class="modal fade show d-block" tabindex="-1" role="dialog" wire:keydown.escape="closeModal">
            <div class="modal-dialog modal-xl modal-dialog-scrollable" role="document">
                <div class="modal-content">
                    <div class="modal-header bg-light sticky-top">
                        <h5 class="modal-title">
                            <i class="fas fa-file-alt mr-2"></i>Nuovo Verbale
                        </h5>
                        <button type="button" class="close" wire:click="closeModal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <form wire:submit.prevent="add">
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="form-group">
                                            <label>Località</label>
                                            <select class="form-control select2 localita_uno" wire:model="localita_uno"
                                                style="width:100%">
                                                <option value="{{ $localita_uno }}">
                                                    {{ $this->getLocalita($localita_uno) }}
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>Indirizzo</label>
                                        <select class="form-control select2 localita_due" wire:model="localita_due"
                                            style="width:100%">
                                            <option value="{{ $localita_due }}">
                                                {{ $this->getStradario($localita_due) }}
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label>Verificatosi in data</label>
                                        <input class="form-control" type="date" wire:model="verificatosi_in_data">
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="form-group">
                                        <label>Seleziona ora</label>
                                        <select class="form-control" wire:model="verificatosi_in_data_ora">
                                            <option value="">-- Seleziona ora --
                                            </option>
                                            @for ($hour = 0; $hour <= 23; $hour++)
                                                <option value="{{ str_pad($hour, 2, '0', STR_PAD_LEFT) }}">
                                                    {{ str_pad($hour, 2, '0', STR_PAD_LEFT) }}
                                                </option>
                                            @endfor
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="form-group">
                                        <label>Seleziona minuti</label>
                                        <select class="form-control" wire:model="verificatosi_in_data_minuti">
                                            <option value="">-- Seleziona minuti --
                                            </option>
                                            @for ($minute = 0; $minute <= 59; $minute++)
                                                <option value="{{ str_pad($minute, 2, '0', STR_PAD_LEFT) }}">
                                                    {{ str_pad($minute, 2, '0', STR_PAD_LEFT) }}
                                                </option>
                                            @endfor
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6 col-md-6">
                                    <div class="form-group">
                                        <label>Data segnalazione</label>
                                        <input class="form-control" type="date" wire:model="segnalazione_data">
                                    </div>
                                </div>
                                <div class="col-sm-3 col-md-3">
                                    <div class="form-group">
                                        <label>Seleziona ora</label>
                                        <select class="form-control" wire:model="segnalazione_ora">
                                            <option value="">-- Seleziona ora --</option>
                                            @for ($hour = 0; $hour <= 23; $hour++)
                                                <option value="{{ str_pad($hour, 2, '0', STR_PAD_LEFT) }}">
                                                    {{ str_pad($hour, 2, '0', STR_PAD_LEFT) }}
                                            @endfor
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-3 col-md-3">
                                    <div class="form-group">
                                        <label>Seleziona minuti</label>
                                        <select class="form-control" wire:model="segnalazione_minuti">
                                            <option value="">-- Seleziona minuti --</option>
                                            @for ($minute = 0; $minute <= 59; $minute++)
                                                <option value="{{ str_pad($minute, 2, '0', STR_PAD_LEFT) }}">
                                                    {{ str_pad($minute, 2, '0', STR_PAD_LEFT) }}
                                            @endfor
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3">
                                    <div class="form-group">
                                        <label>Ora intervento</label>
                                        <select class="form-control" wire:model="sinistro_ora">
                                            <option value="">-- Seleziona ora --</option>
                                            @for ($hour = 0; $hour <= 23; $hour++)
                                                <option value="{{ str_pad($hour, 2, '0', STR_PAD_LEFT) }}">
                                                    {{ str_pad($hour, 2, '0', STR_PAD_LEFT) }}
                                            @endfor
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="form-group">
                                        <label>Minuti intervento</label>
                                        <select class="form-control" wire:model="sinistro_minuti">
                                            <option value="">-- Seleziona minuti --</option>
                                            @for ($minute = 0; $minute <= 59; $minute++)
                                                <option value="{{ str_pad($minute, 2, '0', STR_PAD_LEFT) }}">
                                                    {{ str_pad($minute, 2, '0', STR_PAD_LEFT) }}
                                            @endfor
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-4">
                                    <div class="form-group">
                                        <label>Tipo di rilievo</label>
                                        <select class="form-control" wire:model="rilievi_id" style="width:100%">
                                            <option value="">
                                                @foreach ($rilievi as $r)
                                                    <option value="{{ $r->id }}">{{ $r->name }}
                                                @endforeach
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-4">
                                    <div class="form-group">
                                        <label>Localizzazione dell'incidente</label>
                                        <select class="form-control" wire:model="localizzazione_incidente"
                                            style="width:100%">
                                            <option value="">
                                            <option value="1">NELL'ABITATO
                                            <option value="2">FUORI DELL'ABITATO
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-4">
                                    <div class="form-group">
                                        <label>Nomenclatura strada</label>
                                        <select class="form-control" wire:model="nomenclatura_strada" style="width:100%">
                                            <option value="">
                                                @foreach ($nomenclature as $t)
                                                    <option value="{{ $t->id }}">{{ $t->name }}
                                                @endforeach
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-4">
                                    <div class="form-group">
                                        <label>Condizioni atmosferiche</label>
                                        <select class="form-control" wire:model="condizioni_atmosferiche"
                                            style="width:100%">
                                            <option value="">
                                                @foreach ($condizioni_atmosferiche_array as $t)
                                                    <option value="{{ $t->id }}">{{ $t->name }}
                                                @endforeach
                                        </select>
                                    </div>
                                </div>

                                <div class="col-sm-4">
                                    <div class="form-group">
                                        <label>Visibilità</label>
                                        <select class="form-control" wire:model="visibilita"
                                            style="width:100%">
                                            <option value="">
                                            <option value="1">BUONA
                                            <option value="2">LIMITATA
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-4">
                                    <div class="form-group">
                                        <label>Pavimentazione strada</label>
                                        <select class="form-control" wire:model="pavimentazione"
                                            style="width:100%">
                                            <option value="">
                                                @foreach ($pavimentazioni as $t)
                                                    <option value="{{ $t->id }}">{{ $t->name }}
                                                @endforeach
                                        </select>
                                    </div>
                                </div>

                            </div>
                            <div class="row">
                                <div class="col-sm-4">
                                    <div class="form-group">
                                        <label>Fondo stradale</label>
                                        <select class="form-control" wire:model="fondo_stradale"
                                            style="width:100%">
                                            <option value="">
                                                @foreach ($fondi_stradali as $t)
                                                    <option value="{{ $t->id }}">{{ $t->name }}
                                                @endforeach
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-4">
                                    <div class="form-group">
                                        <label>Particolarità strada</label>
                                        <select class="form-control"
                                            wire:model="particolarita_strada" style="width:100%">
                                            <option value="">
                                                @foreach ($particolarita_strade as $t)
                                                    <option value="{{ $t->id }}">{{ $t->name }}
                                                @endforeach
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-4">
                                    <div class="form-group">
                                        <label>Condizione strada</label>
                                        <select class="form-control" wire:model="condizione_strada"
                                            style="width:100%">
                                            <option value="">
                                                @foreach ($condizioni_strada as $t)
                                                    <option value="{{ $t->id }}">{{ $t->name }}
                                                @endforeach
                                        </select>
                                    </div>
                                </div>
                            </div>

                            <div class="modal-footer">
                                <button type="button" class="btn btn-secondary" wire:click="closeModal">Chiudi</button>
                                <button type="submit" class="btn btn-primary">Crea</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    @endif
