<div id="full-width-modal2" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="fullWidthModalLabel"
    aria-hidden="true">
    <form action="{{ route('Devis.updatedossier', $dossier->id) }}" method="post">
        @csrf
        @method('PUT')
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="fullWidthModalLabel">Modifier Dossier :</h4>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-hidden="true"></button>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-12">
                            <div class="card">
                                <div class="card-body">
                                    <div class="row">
                                        <h5 class="text-primary">Valeurs :</h5>
                                        <hr>
                                        <div class="mb-2">
                                            <label class="form-label">Mode :</label>
                                            <select name="mode"
                                                class="form-control @error('mode') is-invalid @enderror" id="">
                                                @if (!empty($dossier->mode->id))
                                                    <option selected value="{{ $dossier->mode->id }}">
                                                        {{ $dossier->mode->mode ?? null }}</option>
                                                @endif
                                                @foreach ($modes as $mode)
                                                    @if ($dossier->mode_id != $mode->id)
                                                        <option value="{{ $mode->id ?? null }}">
                                                            {{ $mode->mode ?? null }}</option>
                                                    @endif
                                                @endforeach
                                            </select>
                                            @error('mode')
                                                <span class="invalid-feedback" role="alert">
                                                    <strong>{{ $message }}</strong>
                                                </span>
                                            @enderror
                                        </div>
                                        <div class="col-6">
                                            <!-- Mode field -->
                                            <div class="mb-2">
                                                <label class="form-label">Valeur A Neuf HT:</label>
                                                <input type="number" name="valeurneuf"
                                                    class="form-control @error('valeurneuf') is-invalid @enderror "
                                                    value="{{ $dossier->valeurneuf ?? null }}" id="valeurneuf">
                                                @error('valeurneuf')
                                                    <span class="invalid-feedback" role="alert">
                                                        <strong>{{ $message }}</strong>
                                                    </span>
                                                @enderror
                                            </div>
                                            <!-- Valeur Epave field -->
                                            <div class="mb-2">
                                                <label class="form-label">Valeur Epave HT:</label>
                                                <input type="number" name="valeurepave"
                                                    class="form-control @error('valeurepave') is-invalid @enderror "
                                                    value="{{ $dossier->valeurepave ?? null }}" id="valeurepave">
                                                @error('valeurepave')
                                                    <span class="invalid-feedback" role="alert">
                                                        <strong>{{ $message }}</strong>
                                                    </span>
                                                @enderror
                                            </div>
                                            <div class="mb-2">
                                                <label class="form-label">Hors Sinistre HT:</label>
                                                <input type="number" name="horssinistre"
                                                    class="form-control @error('horssinistre') is-invalid @enderror "
                                                    value="{{ $dossier->horssinistre ?? null }}" id="horssinistre">
                                                @error('horssinistre')
                                                    <span class="invalid-feedback" role="alert">
                                                        <strong>{{ $message }}</strong>
                                                    </span>
                                                @enderror
                                            </div>
                                            <!-- Valeur Vénale field -->
                                            <div class="mb-2">
                                                <label class="form-label">Valeur Vénale HT:</label>
                                                <input type="number" name="valeurvenale"
                                                    class="form-control @error('valeurvenale') is-invalid @enderror "
                                                    value="{{ $dossier->valeurvenale ?? null }}" id="valeurvenale">
                                                @error('valeurvenale')
                                                    <span class="invalid-feedback" role="alert">
                                                        <strong>{{ $message }}</strong>
                                                    </span>
                                                @enderror
                                            </div>
                                            <!-- Valeur Définitive field -->
                                            <div class="mb-2">
                                                <label class="form-label">Valeur Définitive HT:</label>
                                                <input type="number" name=""
                                                    class="form-control @error('valeuradire') is-invalid @enderror "
                                                    readonly value="{{ $dossier->valeuradire ?? null }}"
                                                    id="">
                                            </div>
                                        </div>
                                        <div class="col-6">
                                            <div class="mb-2">
                                                <label class="form-label">Valeur A Neuf TTC:</label>
                                                <input type="number" name="valeurneuf_ttc"
                                                    class="form-control @error('valeurneuf_ttc') is-invalid @enderror "
                                                    value="{{ $dossier->valeurneuf_ttc ?? null }}" id="valeurneuf_ttc">
                                                @error('valeurneuf_ttc')
                                                    <span class="invalid-feedback" role="alert">
                                                        <strong>{{ $message }}</strong>
                                                    </span>
                                                @enderror
                                            </div>
                                            <!-- Valeur Epave field -->
                                            <div class="mb-2">
                                                <label class="form-label">Valeur Epave TTC:</label>
                                                <input type="number" name="valeurepave_ttc"
                                                    class="form-control @error('valeurepave_ttc') is-invalid @enderror "
                                                    value="{{ $dossier->valeurepave_ttc ?? null }}" id="valeurepave_ttc">
                                                @error('valeurepave_ttc')
                                                    <span class="invalid-feedback" role="alert">
                                                        <strong>{{ $message }}</strong>
                                                    </span>
                                                @enderror
                                            </div>
                                            <div class="mb-2">
                                                <label class="form-label">Hors Sinistre TTC:</label>
                                                <input type="number" name="horssinistre_ttc"
                                                    class="form-control @error('horssinistre_ttc') is-invalid @enderror "
                                                    value="{{ $dossier->horssinistre_ttc ?? null }}" id="horssinistre_ttc">
                                                @error('horssinistre_ttc')
                                                    <span class="invalid-feedback" role="alert">
                                                        <strong>{{ $message }}</strong>
                                                    </span>
                                                @enderror
                                            </div>
                                            <!-- Valeur Vénale field -->
                                            <div class="mb-2">
                                                <label class="form-label">Valeur Vénale TTC:</label>
                                                <input type="number" name="valeurvenale_ttc"
                                                    class="form-control @error('valeurvenale_ttc') is-invalid @enderror "
                                                    value="{{ $dossier->valeurvenale_ttc ?? null }}" id="valeurvenale_ttc">
                                                @error('valeurvenale_ttc')
                                                    <span class="invalid-feedback" role="alert">
                                                        <strong>{{ $message }}</strong>
                                                    </span>
                                                @enderror
                                            </div>
                                            <!-- Valeur Définitive field -->
                                            <div class="mb-2">
                                                <label class="form-label">Valeur Définitive TTC:</label>
                                                <input type="number" name=""
                                                    class="form-control @error('valeuradire_ttc') is-invalid @enderror "
                                                    readonly value="{{ $dossier->valeuradire_ttc ?? null }}"
                                                    id="">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-light" data-bs-dismiss="modal">Close</button>
                            @if (Auth::user()->role_id == 4 ||
                                    $devis->devis_status_id == 4 ||
                                    $devis->devis_status_id == 3 ||
                                    $devis->devis_status_id == 5)
                                <button type="submit" class="btn btn-success">Modifier</button>
                            @endif
                        </div>
                    </div>
                </div>

            </div><!-- /.modal-dialog -->
        </div>
    </form>
</div>
