@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-header">
    @if($isInfo)
        <a href="{{route('park_add')}}" class="btn btn-lg btn-success">{{__('登録')}}</a>
        <a href="{{route('park_edit',['id'=>$park_id])}}" class="btn btn-lg btn-danger">{{__('編集')}}</a>
    @else($isEdit)
        <button type="submit" class="btn btn-lg btn-danger register" >{{__('保存')}}</button>
    @endIf
</div>
<div class="card-body">
    <div class="row">
    @if($isInfo || $isEdit)
                                    <!--駐輪場ID -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.park_id')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$park_id}}" placeholder="{{__('validation.attributes.park_id')}}"
                       class="form-control form-control-lg" readonly/>
            </div>
        </div>
    @endIf
                                    <!-- 市区 -->
        <div class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.city_id')}}</label>
        </div>
        <div class="form-group col-9">
            <select class="form-control form-control-lg mb10" name="city_id" @if($isInfo) disabled @endif>
                <option value="" >{{__('都市を選択')}}</option>
                @foreach($cities as $val)
                    <option value="{{$val}}" @if($city_id == $val)selected @endif>{{$val}}</option>
                @endforeach
            </select>
        </div>

                                    
        <!-- 駐輪場名 -->
        <div class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.park_name')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$park_name}}" placeholder="{{__('validation.attributes.park_name')}}" name="park_name"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - 駐輪場名 -->
                                    
        <!-- 駐輪場ふりがな -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.park_ruby')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$park_ruby}}" placeholder="{{__('validation.attributes.park_ruby')}}" name="park_ruby"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - 駐輪場ふりがな -->
                                    
        <!-- 駐輪場五十音 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.park_syllabary')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$park_syllabary}}" placeholder="{{__('validation.attributes.park_syllabary')}}" name="park_syllabary"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - 駐輪場五十音 -->
                                    
        <!-- 住所 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.park_adrs')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$park_adrs}}" placeholder="{{__('validation.attributes.park_adrs')}}" name="park_adrs"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - 住所 -->
                                    
        <!-- 閉設フラグ -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.park_close_flag')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$park_close_flag}}" placeholder="{{__('validation.attributes.park_close_flag')}}" name="park_close_flag"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - 閉設フラグ -->
                                    
        <!-- 閉設日 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.park_day')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="date" value="{{$park_day}}" placeholder="{{__('validation.attributes.park_day')}}" name="park_day"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - 閉設日 -->

        <!-- 残警告チェックフラグ -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.alert_flag')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$alert_flag}}" placeholder="{{__('validation.attributes.alert_flag')}}" name="alert_flag"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - 残警告チェックフラグ -->
                                    
        <!-- 印字数 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.print_number')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$print_number}}" placeholder="{{__('validation.attributes.print_number')}}" name="print_number"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - 印字数 -->
                                    
        <!-- 最新キープアライブ -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.keep_alive')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="date" value="@if($keep_alive){{date('Y-m-d',strtotime($keep_alive))}}@endif" placeholder="{{__('validation.attributes.keep_alive')}}" name="keep_alive"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - 最新キープアライブ -->
    </div>
    @if($isInfo)
        <a href="{{route('park_add')}}" class="btn btn-lg btn-success">{{__('登録')}}</a>
        <a href="{{route('park_edit',['id'=>$park_id])}}" class="btn btn-lg btn-danger">{{__('編集')}}</a>
    @else($isEdit)
        <button type="submit" class="btn btn-lg btn-danger register" >{{__('保存')}}</button>
    @endIf
</div>

