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

@section('content')
<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('reserves.index') }}">定期予約マスタ</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">

                    {{-- 編集フォーム --}}
                    <form id="form_edit"
                          action="{{ route('reserves.update', ['reserve_id' => $record->reserve_id]) }}"
                          method="POST">
                        @csrf

                        @include('admin.reserves._form', [
                            'isEdit'        => true,
                            'record'        => $record,
                            'userTypes'     => $userTypes ?? [],
                            'parks'         => $parks ?? [],
                            'priceOptions'  => $priceOptions ?? [],
                            'prices'        => $prices ?? [],
                            'psections'     => $psections ?? [],
                            'ptypes'        => $ptypes ?? [],
                        ])
                    </form>

                    {{-- 削除フォーム（非表示） --}}
                    <form id="form_delete"
                          action="{{ route('reserves.destroy') }}"
                          method="POST"
                          style="display:none;">
                        @csrf
                        {{-- 複数削除仕様に合わせて pk[] --}}
                        <input type="hidden" name="pk[]" value="{{ $record->reserve_id }}">
                    </form>

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

    </div>
</section>
<!-- /.content -->


@endsection
