@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('price_add')}}" class="btn btn-lg btn-success">{{__('登録')}}</a>
        <a href="{{route('price_edit',['id'=>$price_parkplaceid])}}" class="btn btn-lg btn-danger">{{__('編集')}}</a>
    @else
        <button type="submit" class="btn btn-lg btn-danger register" >{{__('保存')}}</button>
    @endIf
</div>
<div class="card-body">
    <div class="row">
    @if($isEdit || $isInfo)
        <!-- 駐車場所ID -->
            <div class="form-group col-3">
                <label>{{__('validation.attributes.price_parkplaceid')}}</label>
            </div>
            <div class="form-group col-9">
                <div class="input-group">
                    <input type="text" value="{{$price_parkplaceid}}"
                           @if(!$isInfo) placeholder="{{__('validation.attributes.price_parkplaceid')}}" @endif
                           class="form-control form-control-lg" readonly/>
                </div>
            </div>
    @endIf
    <!-- 商品名 -->
        <div class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.prine_name')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$prine_name}}" @if(!$isInfo) placeholder="{{__('validation.attributes.prine_name')}}" @endif
                       name="prine_name"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - 商品名 -->

        <!-- 期間 -->
        <div class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.price_month')}}</label>
        </div>

        <div class="form-group col-9">
            <div class="input-group">
                <select name="price_month" class="form-control form-control-lg" @if($isInfo)  disabled @endif>
                    <option value="">{{__('validation.attributes.price_month')}}</option>
                    @foreach(\App\Price::PRICE_MONTH as $key => $item)
                        <option value="{{$key}}"
                                @if($key == $price_month) selected @endif>{{$item}}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <!-- /.form group - 期間 -->

        <!-- 駐輪場ID -->
        <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">
                <select name="park_name" class="form-control form-control-lg" @if($isInfo ||$isEdit)  disabled @endif>
                    <option value="">{{__('validation.attributes.park_name')}}</option>
                    @foreach($parks as $key => $item)
                        <option value="{{$key}}" @if($key == $park_id) selected @endif>{{$item}}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <!-- /.form group - 駐輪場ID -->

        <!-- 車種区分ID -->
        <div class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.psection_subject')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <select name="psection_subject" class="form-control form-control-lg" @if($isInfo ||$isEdit)  disabled @endif>
                    <option value="">{{__('validation.attributes.psection_subject')}}</option>
                    @foreach($psections as $key => $item)
                        <option value="{{$key}}" @if($key == $psection_id) selected @endif>{{$item}}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <!-- /.form group - 車種区分ID -->

        <!-- 駐輪分類ID -->
        <div class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.ptype_subject')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <select name="ptype_subject" class="form-control form-control-lg" @if($isInfo ||$isEdit)  disabled @endif>
                    <option value="">{{__('validation.attributes.ptype_subject')}}</option>
                    @foreach($ptypes as $key => $item)
                        <option value="{{$key}}" @if($key == $price_ptypeid) selected @endif>{{$item}}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <!-- /.form group - 駐輪分類ID -->

        <!-- 利用者分類ID -->
        <div class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.user_category_name')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <select name="user_category_name" class="form-control form-control-lg" @if($isInfo ||$isEdit)  disabled @endif>
                    <option value="">{{__('validation.attributes.user_category_name')}}</option>
                    @foreach($userTypes as $key => $item)
                        <option value="{{$key}}" @if($key == $user_categoryid) selected @endif>{{$item}}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <!-- /.form group - 利用者分類ID -->

        <!-- 駐車車室ID -->

        <div class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.pplace_id')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$pplace_id}}" @if(!$isInfo) placeholder="{{__('validation.attributes.price')}}" @endif
                       name="pplace_id"
                       class="form-control form-control-lg" @if($isInfo ||$isEdit) readonly @endif/>
            </div>
        </div>

        <!-- 駐輪料金（税込） -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.price')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$price}}" @if(!$isInfo) placeholder="{{__('validation.attributes.price')}}" @endif name="price"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - 駐輪料金（税込） -->
    </div>
    @if($isInfo)
        <a href="{{route('price_add')}}" class="btn btn-lg btn-success">{{__('登録')}}</a>
        <a href="{{route('price_edit',['id'=>$price_parkplaceid])}}" class="btn btn-lg btn-danger">{{__('編集')}}</a>
    @else
        <button type="submit" class="btn btn-lg btn-danger register" >{{__('保存')}}</button>
    @endIf
</div>

