@csrf
<div class="form-group row">
    <label class="col-lg-2 col-form-label">ゾーン名ID<span class="text-danger">※</span></label>
    <div class="col-lg-6">
        <input type="text" name="zone_id" class="form-control"
            value="{{ old('zone_id', $zone->zone_id ?? '') }}" required>
        @error('zone_id')
            <span class="text-danger">{{ $message }}</span>
        @enderror
    </div>
</div>

<div class="form-group row">
    <label class="col-lg-2 col-form-label">駐輪場ID<span class="text-danger">※</span></label>
    <div class="col-lg-6">
        <input type="number" name="park_id" class="form-control"
            value="{{ old('park_id', $zone->park_id ?? '') }}" required>
        @error('park_id')
            <span class="text-danger">{{ $message }}</span>
        @enderror
    </div>
</div>

<div class="form-group row">
    <label class="col-lg-2 col-form-label">駐輪分類ID</label>
    <div class="col-lg-6">
        <input type="number" name="ptype_id" class="form-control"
            value="{{ old('ptype_id', $zone->ptype_id ?? '') }}">
    </div>
</div>

<div class="form-group row">
    <label class="col-lg-2 col-form-label">車種区分ID</label>
    <div class="col-lg-6">
        <input type="number" name="psection_id" class="form-control"
            value="{{ old('psection_id', $zone->psection_id ?? '') }}">
    </div>
</div>

<div class="form-group row">
    <label class="col-lg-2 col-form-label">ゾーン名<span class="text-danger">※</span></label>
    <div class="col-lg-6">
        <input type="text" name="zone_name" class="form-control"
            value="{{ old('zone_name', $zone->zone_name ?? '') }}" required>
        @error('zone_name')
            <span class="text-danger">{{ $message }}</span>
        @enderror
    </div>
</div>

<div class="form-group row">
    <label class="col-lg-2 col-form-label">ゾーン内現在契約台数</label>
    <div class="col-lg-6">
        <input type="number" name="zone_number" class="form-control"
            value="{{ old('zone_number', $zone->zone_number ?? '') }}">
    </div>
</div>

<div class="form-group row">
    <label class="col-lg-2 col-form-label">ゾーン内標準台数</label>
    <div class="col-lg-6">
        <input type="number" name="zone_standard" class="form-control"
            value="{{ old('zone_standard', $zone->zone_standard ?? '') }}">
    </div>
</div>

<div class="form-group row">
    <label class="col-lg-2 col-form-label">ゾーン内許容台数</label>
    <div class="col-lg-6">
        <input type="number" name="zone_tolerance" class="form-control"
            value="{{ old('zone_tolerance', $zone->zone_tolerance ?? '') }}">
    </div>
</div>

<div class="form-group row">
    <label class="col-lg-2 col-form-label">ゾーン順</label>
    <div class="col-lg-6">
        <input type="number" name="zone_sort" class="form-control form-control-lg"
            value="{{ old('zone_sort', $zone->zone_sort ?? '') }}">
    </div>
</div>

<div class="form-group col-12 text-left">
    @if(isset($zone) && $zone->zone_id)
        {{-- 編集画面 --}}
        <button type="submit" class="btn btn-success">登録</button>
        <a href="{{ route('zones') }}" class="btn btn-secondary">削除</a>
    @else
        {{-- 新規画面 --}}
        <button type="submit" class="btn btn-success">登録</button>

    @endif
</div>
