@extends('layouts.app')
@section('title', '編集')

@section('content')
    <!-- Content Header -->
    <div class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-lg-6">
                    <h1 class="m-0 text-dark">編集</h1>
                </div>
                <div class="col-lg-6">
                    <ol class="breadcrumb float-sm-right text-sm">
                        <li class="breadcrumb-item">
                            <a href="{{ route('home') }}">ホーム</a>
                        </li>
                        <li class="breadcrumb-item">
                            <a href="{{ route('parks') }}">駐輪場マスタ</a>
                        </li>
                        <li class="breadcrumb-item active">編集</li>
                    </ol>
                </div>
            </div>
        </div>
    </div>

    <!-- Main content -->
    <section class="content">
        <div class="container-fluid">

            <div class="row">
                <div class="col-lg-12">

                    <div class="card">
                        {{-- ▼ 上部ボタン --}}
                        <div class="card-header">
                            {{-- 減免マスタ --}}
                            <button type="button"
                                    id="btn_reduction_master"
                                    class="btn btn-default mr-2">
                                減免マスタ
                            </button>

                            {{-- 駐輪規定マスタ --}}
                            <button type="button"
                                    id="btn_parking_regulation"
                                    class="btn btn-default mr-2">
                                駐輪規定マスタ
                            </button>
                        </div>

                        {{-- 編集フォーム --}}
                        <form id="form_edit"
                              method="POST"
                              action="{{ route('parks.update', ['id' => $record->park_id]) }}?back={{ urlencode(request()->get('back', request()->fullUrl())) }}"
                              enctype="multipart/form-data">
                            @csrf
                            @method('PUT')

                            @include('admin.parks._form', [
                                'isEdit' => true,
                                'record' => $record,
                                'cities' => $cities ?? [],
                            ])
                        </form>

                        {{-- 単体削除（編集画面） --}}
                        <form id="form_delete" method="POST" action="{{ route('parks.delete') }}">
                            @csrf
                            <input type="hidden" name="pk[]" value="{{ $record->park_id }}">
                        </form>

                    </div>
                </div>
            </div>

        </div>
    </section>
@endsection
