@php
    $isEdit = $mode === 'edit';
    $isInfo = $mode === 'info';
@endphp

@if($isEdit || $isInfo)
    <!-- 契約許容市区ID -->
    <div class="form-group col-3">
        <label>{{ __('validation.attributes.contract_allowable_city_id') }}</label>
    </div>
    <div class="form-group col-9">
        <input type="text" class="form-control form-control-lg" readonly
               value="{{ $record->contract_allowable_city_id ?? '' }}">
    </div>
@endif

<!-- 市区ID -->
<div class="form-group col-3">
    <label @if(!$isInfo) class="required" @endif>{{ __('validation.attributes.city_id') }}</label>
</div>
<div class="form-group col-9">
    <select class="form-control form-control-lg" name="city_id" @if($isInfo) disabled @endif>
        <option value="">{{ __('validation.attributes.city_id') }}</option>
        @foreach($cityList as $key => $item)
            <option value="{{ $key }}" @if($key == old('city_id', $record->city_id ?? '')) selected @endif>{{ $item }}</option>
        @endforeach
    </select>
</div>

<!-- 許容市区名 -->
<div class="form-group col-3">
    <label @if(!$isInfo) class="required" @endif>{{ __('validation.attributes.contract_allowable_city_name') }}</label>
</div>
<div class="form-group col-9">
    <input type="text" class="form-control form-control-lg"
           name="contract_allowable_city_name"
           value="{{ old('contract_allowable_city_name', $record->contract_allowable_city_name ?? '') }}"
           placeholder="{{ __('validation.attributes.contract_allowable_city_name') }}"
           @if($isInfo) readonly @endif>
</div>

<!-- 駐輪場 -->
<div class="form-group col-3">
    <label @if(!$isInfo) class="required" @endif>{{ __('validation.attributes.park_id') }}</label>
</div>
<div class="form-group col-9">
    <select class="form-control form-control-lg" name="park_id" @if($isInfo) disabled @endif>
        <option value="">{{ __('validation.attributes.park_id') }}</option>
        @foreach($parkList as $key => $item)
            <option value="{{ $key }}" @if($key == old('park_id', $record->park_id ?? '')) selected @endif>{{ $item }}</option>
        @endforeach
    </select>
</div>

<!-- 隣接区フラグ -->
<div class="form-group col-3">
    <label @if(!$isInfo) class="required" @endif>{{ __('validation.attributes.same_district_flag') }}</label>
</div>
<div class="form-group col-9">
    <select class="form-control form-control-lg" name="same_district_flag" @if($isInfo) disabled @endif>
        <option value="">{{ __('validation.attributes.same_district_flag') }}</option>
        <option value="0" @if(old('same_district_flag', $record->same_district_flag ?? '') == 0) selected @endif>隣接市</option>
        <option value="1" @if(old('same_district_flag', $record->same_district_flag ?? '') == 1) selected @endif>その他</option>
    </select>
</div>

@if($isInfo)
    <!-- 更新オペレータ -->
    <div class="form-group col-3">
        <label>{{ __('validation.attributes.operator_id') }}</label>
    </div>
    <div class="form-group col-9">
        <input type="text" class="form-control form-control-lg" readonly
               value="{{ $record->operator_id ?? '' }}">
    </div>

    <!-- 登録日時 -->
    <div class="form-group col-3">
        <label>{{ __('validation.attributes.created_at') }}</label>
    </div>
    <div class="form-group col-9">
        <input type="text" class="form-control form-control-lg" readonly
               value="{{ $record->created_at ?? '' }}">
    </div>

    <!-- 更新日時 -->
    <div class="form-group col-3">
        <label>{{ __('validation.attributes.updated_at') }}</label>
    </div>
    <div class="form-group col-9">
        <input type="text" class="form-control form-control-lg" readonly
               value="{{ $record->updated_at ?? '' }}">
    </div>
@endif
