@extends('layouts.admin')
@section('content')

<div class="card">
    <div class="card-header">
        {{ trans('global.edit') }} {{ trans('cruds.checklistReport.title_singular') }}
    </div>

    <div class="card-body">
        <form method="POST" action="{{ route("admin.checklist-reports.update", [$checklistReport->id]) }}" enctype="multipart/form-data">
            @method('PUT')
            @csrf
            <div class="form-group">
                <label class="required" for="complaint_id">{{ trans('cruds.checklistReport.fields.complaint') }}</label>
                <select class="form-control select2 {{ $errors->has('complaint') ? 'is-invalid' : '' }}" name="complaint_id" id="complaint_id" required>
                    @foreach($complaints as $id => $entry)
                        <option value="{{ $id }}" {{ (old('complaint_id') ? old('complaint_id') : $checklistReport->complaint->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option>
                    @endforeach
                </select>
                @if($errors->has('complaint'))
                    <div class="invalid-feedback">
                        {{ $errors->first('complaint') }}
                    </div>
                @endif
                <span class="help-block">{{ trans('cruds.checklistReport.fields.complaint_helper') }}</span>
            </div>
            <div class="form-group">
                <label class="required" for="checklist_name_id">{{ trans('cruds.checklistReport.fields.checklist_name') }}</label>
                <select class="form-control select2 {{ $errors->has('checklist_name') ? 'is-invalid' : '' }}" name="checklist_name_id" id="checklist_name_id" required>
                    @foreach($checklist_names as $id => $entry)
                        <option value="{{ $id }}" {{ (old('checklist_name_id') ? old('checklist_name_id') : $checklistReport->checklist_name->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option>
                    @endforeach
                </select>
                @if($errors->has('checklist_name'))
                    <div class="invalid-feedback">
                        {{ $errors->first('checklist_name') }}
                    </div>
                @endif
                <span class="help-block">{{ trans('cruds.checklistReport.fields.checklist_name_helper') }}</span>
            </div>
            <div class="form-group">
                <label for="checklist_status">{{ trans('cruds.checklistReport.fields.checklist_status') }}</label>
                <input class="form-control {{ $errors->has('checklist_status') ? 'is-invalid' : '' }}" type="text" name="checklist_status" id="checklist_status" value="{{ old('checklist_status', $checklistReport->checklist_status) }}">
                @if($errors->has('checklist_status'))
                    <div class="invalid-feedback">
                        {{ $errors->first('checklist_status') }}
                    </div>
                @endif
                <span class="help-block">{{ trans('cruds.checklistReport.fields.checklist_status_helper') }}</span>
            </div>
            <div class="form-group">
                <label for="checklist_value_text_1">{{ trans('cruds.checklistReport.fields.checklist_value_text_1') }}</label>
                <input class="form-control {{ $errors->has('checklist_value_text_1') ? 'is-invalid' : '' }}" type="text" name="checklist_value_text_1" id="checklist_value_text_1" value="{{ old('checklist_value_text_1', $checklistReport->checklist_value_text_1) }}">
                @if($errors->has('checklist_value_text_1'))
                    <div class="invalid-feedback">
                        {{ $errors->first('checklist_value_text_1') }}
                    </div>
                @endif
                <span class="help-block">{{ trans('cruds.checklistReport.fields.checklist_value_text_1_helper') }}</span>
            </div>
            <div class="form-group">
                <label for="checklist_value_text_2">{{ trans('cruds.checklistReport.fields.checklist_value_text_2') }}</label>
                <input class="form-control {{ $errors->has('checklist_value_text_2') ? 'is-invalid' : '' }}" type="text" name="checklist_value_text_2" id="checklist_value_text_2" value="{{ old('checklist_value_text_2', $checklistReport->checklist_value_text_2) }}">
                @if($errors->has('checklist_value_text_2'))
                    <div class="invalid-feedback">
                        {{ $errors->first('checklist_value_text_2') }}
                    </div>
                @endif
                <span class="help-block">{{ trans('cruds.checklistReport.fields.checklist_value_text_2_helper') }}</span>
            </div>
            <div class="form-group">
                <label for="checklist_status_fusion_types_1_id">{{ trans('cruds.checklistReport.fields.checklist_status_fusion_types_1') }}</label>
                <select class="form-control select2 {{ $errors->has('checklist_status_fusion_types_1') ? 'is-invalid' : '' }}" name="checklist_status_fusion_types_1_id" id="checklist_status_fusion_types_1_id">
                    @foreach($checklist_status_fusion_types_1s as $id => $entry)
                        <option value="{{ $id }}" {{ (old('checklist_status_fusion_types_1_id') ? old('checklist_status_fusion_types_1_id') : $checklistReport->checklist_status_fusion_types_1->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option>
                    @endforeach
                </select>
                @if($errors->has('checklist_status_fusion_types_1'))
                    <div class="invalid-feedback">
                        {{ $errors->first('checklist_status_fusion_types_1') }}
                    </div>
                @endif
                <span class="help-block">{{ trans('cruds.checklistReport.fields.checklist_status_fusion_types_1_helper') }}</span>
            </div>
            <div class="form-group">
                <label for="checklist_status_fusion_types_2_id">{{ trans('cruds.checklistReport.fields.checklist_status_fusion_types_2') }}</label>
                <select class="form-control select2 {{ $errors->has('checklist_status_fusion_types_2') ? 'is-invalid' : '' }}" name="checklist_status_fusion_types_2_id" id="checklist_status_fusion_types_2_id">
                    @foreach($checklist_status_fusion_types_2s as $id => $entry)
                        <option value="{{ $id }}" {{ (old('checklist_status_fusion_types_2_id') ? old('checklist_status_fusion_types_2_id') : $checklistReport->checklist_status_fusion_types_2->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option>
                    @endforeach
                </select>
                @if($errors->has('checklist_status_fusion_types_2'))
                    <div class="invalid-feedback">
                        {{ $errors->first('checklist_status_fusion_types_2') }}
                    </div>
                @endif
                <span class="help-block">{{ trans('cruds.checklistReport.fields.checklist_status_fusion_types_2_helper') }}</span>
            </div>
            <div class="form-group">
                <button class="btn btn-danger" type="submit">
                    {{ trans('global.save') }}
                </button>
            </div>
        </form>
    </div>
</div>



@endsection