@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>
@elseif(Session::has('error'))
    <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>
        {!! Session::get('error') !!}
    </div>
@elseif(isset($errorMsg))
    <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>
        {!! $errorMsg !!}
    </div>
@endif

<div class="card-body">
    <div class="row">
        {{-- 駐輪車室ID --}}
        <div class="form-group col-3">
            <label>{{ __('駐輪車室ID') }}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{ $pplace_id ?? '' }}" placeholder="{{ __('駐輪車室ID') }}"
                       name="pplace_id" class="form-control form-control-lg" readonly />
            </div>
        </div>

        {{-- 番号 --}}
        <div class="form-group col-3">
            <label class="required">{{ __('駐輪車室番号') }}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{ $pplace_number ?? '' }}" placeholder="{{ __('駐輪車室番号') }}"
                       name="pplace_number" class="form-control form-control-lg">
            </div>
        </div>

        {{-- 備考 --}}
        <div class="form-group col-3">
            <label>{{ __('備考') }}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{ $pplace_remarks ?? '' }}" placeholder="{{ __('備考') }}"
                       name="pplace_remarks" class="form-control form-control-lg" @if(!empty($isEdit))@endif />
            </div>
        </div>

        <!-- {{-- オペレーター --}}
        <div class="form-group col-3">
            <label>{{ __('更新オペレータID') }}</label>
        </div>
        <div class="form-group col-9">
            <select name="operator_id" class="form-control form-control-lg" @if(!empty($isEdit)) disabled @endif>
                <option value="">{{ __('選択してください') }}</option>
                @foreach($operators ?? [] as $id => $name)
                    <option value="{{ $id }}" @if(($operator_id ?? '') == $id) selected @endif>{{ $name }}</option>
                @endforeach
            </select>
        </div> -->
    </div>

    <!-- <div class="text-center"> -->
    {{-- 登録ボタン --}}
    <button type="submit" class="btn btn-lg btn-success mr-2">{{ __('登録') }}</button>

    {{-- 削除ボタン（編集画面のみ表示） --}}
    @if(!empty($pplace_id))
    </form>
        <form method="POST" action="{{ route('pplace_delete') }}" 
            onsubmit="return confirm('本当に削除しますか？')" class="d-inline-block mr-2">
            @csrf
            <input type="hidden" name="pk" value="{{ $pplace_id }}">
            <button type="submit" class="btn btn-lg btn-danger mr-2">{{ __('削除') }}</button>
        </form>
    @endif
    <!-- </div> -->
</div>
