{{-- アラート --}}
@if(Session::has('success'))
    <div class="alert alert-success alert-dismissible" role="alert">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
        {{ Session::get('success') }}
    </div>
@endif

@if($errors->any())
    <div class="alert alert-danger alert-dismissible">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
        <h4><i class="icon fa fa-ban"></i> {{ __('入力内容に不備があります:') }}</h4>
        <ul>
            @foreach($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif

<div class="card-body">
    {{-- ▼ 駐輪分類ID（編集時のみ表示） --}}
    @if($isEdit && isset($record->ptype_id))
    <div class="form-group row">
        <label class="col-sm-2 col-form-label">駐輪分類ID</label>
        <div class="col-sm-10">
            <input type="text"
                name="ptype_id"
                class="form-control form-control-lg"
                value="{{ $record->ptype_id }}"
                readonly>
        </div>
    </div>
    @endif

    {{-- ▼ 駐輪分類名 --}}
    <div class="form-group row">
        <label class="col-sm-2 col-form-label">
            駐輪分類名<span class="text-danger">*</span>
        </label>
        <div class="col-sm-10">
            <input type="text"
                name="ptype_subject"
                class="form-control form-control-lg"
                value="{{ $isEdit ? old('ptype_subject', $record->ptype_subject ?? '') : '' }}"
                placeholder="{{ __('validation.attributes.psection_subject') }}"
                required>
        </div>
    </div>

    {{-- ▼ 階数ソート順 --}}
    <div class="form-group row">
        <label class="col-sm-2 col-form-label">階数ソート順</label>
        <div class="col-sm-10">
            <input type="text"
                name="floor_sort"
                class="form-control form-control-lg"
                value="{{ $isEdit ? old('floor_sort', $record->floor_sort ?? '') : '' }}"
                placeholder="{{ __('validation.attributes.floor_sort') }}">
        </div>
    </div>

    {{-- ▼ 備考 --}}
    <div class="form-group row">
        <label class="col-sm-2 col-form-label">備考</label>
        <div class="col-sm-10">
            <input type="text"
                name="ptype_remarks"
                class="form-control form-control-lg"
                value="{{ $isEdit ? old('ptype_remarks', $record->ptype_remarks ?? '') : '' }}"
                placeholder="{{ $isEdit ? '' : __('validation.attributes.ptype_remarks') }}">
        </div>
    </div>

    {{-- ▼ 下部ボタン --}}
    <div class="row mt-4">
        <div class="form-group col-md-10 d-flex align-items-center gap-2 justify-content-start">

            {{-- 登録ボタン --}}
            @if($isEdit)
                <button type="button" id="register_edit" class="btn btn-lg btn-success mr-2">
                    {{ __('登録') }}
                </button>
            @else
                <button type="button" id="register" class="btn btn-lg btn-success mr-2 register">
                    {{ __('登録') }}
                </button>
            @endif

            {{-- 削除ボタン（編集時のみ表示） --}}
            @if($isEdit)
                <button type="button" id="delete_edit" class="btn btn-lg btn-danger">
                    {{ __('削除') }}
                </button>
            @endif

        </div>
    </div>

</div>


