@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('parking_regulations_list', ['park_id' => $park->park_id]) }}">駐輪規定マスタ</a></li>
                        <li class="breadcrumb-item active">編集</li>
                    </ol>
                </div>
            </div>
        </div>
    </div>

    <section class="content">
        <div class="container-fluid">
            @if ($errors->any())
                <div class="alert alert-danger">@foreach($errors->all() as $e) <div>{{ $e }}</div> @endforeach</div>
            @endif

            <div class="card">
                <div class="card-body">
                    <!-- 登録フォーム -->
                    <form id="form_edit" method="POST" action="{{ route('parking_regulations_update', ['seq' => $record->parking_regulations_seq]) }}">
                        @csrf
                        @include('admin.parking_regulations._form', ['psections' => $psections, 'ptypes' => $ptypes, 'parkId' => $park->park_id, 'record' => $record])

                        <div class="text-end">
                            <button type="button" id="register_edit" class="btn btn-success">登録</button>
                    </form>

                    <!-- 削除フォーム -->
                    <form id="form_delete" method="POST" action="{{ route('parking_regulations_delete') }}" style="display:inline">
                        @csrf
                        <input type="hidden" name="parking_regulations_seq" value="{{ $record->parking_regulations_seq }}">
                            <button type="button" id="delete_edit" class="btn btn-danger">削除</button>
                    </form>

                    <a href="{{ route('parking_regulations_list', ['park_id' => $park->park_id]) }}" class="btn btn-secondary">戻る</a>

                        </div>
                </div>
            </div>
        </div>
    </section>
@endsection
