@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('regular_type_add')}}" class="btn btn-lg btn-success">{{__('登録')}}</a>
        <a href="{{route('regular_type_edit',['id'=>$regular_type_id])}}" 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.regular_type_id')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$regular_type_id}}"
                       placeholder="{{__('validation.attributes.regular_type_id')}}"
                       class="form-control form-control-lg" readonly/>
            </div>
        </div>
        <!-- /.form group - 定期種別ID -->
    @endIf

        <!-- 市区名 -->
        <div class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.city_name')}}</label>
        </div>
        <div class="form-group col-9">
            <select class="form-control form-control-lg mb10" name="city_name" @if($isInfo) disabled @endif>
                <option value="">{{__('validation.attributes.city_name')}}</option>
                @foreach($cities as $key => $val)
                    <option value="{{$key}}" @if($city_id == $key) selected @endif>{{$val}}</option>
                @endforeach
            </select>
        </div>
        <!-- 定期種別1 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.regular_class_1')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="row">
                <div class="col-2 offset-1 form-check">
                    <input type="radio" class="minimal"
                           name="regular_class_1" @if($isInfo) disabled @endif
                           value="1" {{$regular_class_1? 'checked':''}}>
                    <label class="form-check-label">{{__("有効")}}</label>
                </div>
                <div class="col-2 form-check">
                    <input type="radio" class="minimal"
                           name="regular_class_1" @if($isInfo) disabled @endif
                           value="0" {{!$regular_class_1? 'checked':''}}>
                    <label class="form-check-label">{{__("無効")}}</label>
                </div>
            </div>
        </div>
        <!-- /.form group - 定期種別1 -->

        <!-- 定期種別2 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.regular_class_2')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="row">
                <div class="col-2 offset-1 form-check">
                    <input type="radio" class="minimal"
                           name="regular_class_2" @if($isInfo) disabled @endif
                           value="1" {{$regular_class_2? 'checked':''}}>
                    <label class="form-check-label">{{__("有効")}}</label>
                </div>
                <div class="col-2 form-check">
                    <input type="radio" class="minimal"
                           name="regular_class_2" @if($isInfo) disabled @endif
                           value="0" {{!$regular_class_2? 'checked':''}}>
                    <label class="form-check-label">{{__("無効")}}</label>
                </div>
            </div>
        </div>
        <!-- /.form group - 定期種別2 -->

        <!-- 定期種別3 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.regular_class_3')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="row">
                <div class="col-2 offset-1 form-check">
                    <input type="radio" class="minimal"
                           name="regular_class_3" @if($isInfo) disabled @endif
                           value="1" {{$regular_class_3? 'checked':''}}>
                    <label class="form-check-label">{{__("有効")}}</label>
                </div>
                <div class="col-2 form-check">
                    <input type="radio" class="minimal"
                           name="regular_class_3" @if($isInfo) disabled @endif
                           value="0" {{!$regular_class_3? 'checked':''}}>
                    <label class="form-check-label">{{__("無効")}}</label>
                </div>
            </div>
        </div>
        <!-- /.form group - 定期種別3 -->

        <!-- 定期種別6 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.regular_class_6')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="row">
                <div class="col-2 offset-1 form-check">
                    <input type="radio" class="minimal"
                           name="regular_class_6" @if($isInfo) disabled @endif
                           value="1" {{$regular_class_6? 'checked':''}}>
                    <label class="form-check-label">{{__("有効")}}</label>
                </div>
                <div class="col-2 form-check">
                    <input type="radio" class="minimal"
                           name="regular_class_6" @if($isInfo) disabled @endif
                           value="0" {{!$regular_class_6? 'checked':''}}>
                    <label class="form-check-label">{{__("無効")}}</label>
                </div>
            </div>
        </div>

        <!-- 定期種別12 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.regular_class_12')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="row">
                <div class="col-2 offset-1 form-check">
                    <input type="radio" class="minimal"
                           name="regular_class_12" @if($isInfo) disabled @endif
                           value="1" {{$regular_class_12? 'checked':''}}>
                    <label class="form-check-label">{{__("有効")}}</label>
                </div>
                <div class="col-2 form-check">
                    <input type="radio" class="minimal"
                           name="regular_class_12" @if($isInfo) disabled @endif
                           value="0" {{!$regular_class_12? 'checked':''}}>
                    <label class="form-check-label">{{__("無効")}}</label>
                </div>
            </div>
        </div>
        <div class="form-group col-3">
            <label>{{__('validation.attributes.memo')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <textarea class="form-control form-control-lg" rows="5" placeholder="{{__('validation.attributes.memo')}}"
                          name="memo" @if($isInfo) readonly @endif>{{$memo}}</textarea>
            </div>
        </div>
    </div>
    @if($isInfo)
        <a href="{{route('regular_type_add')}}" class="btn btn-lg btn-success">{{__('登録')}}</a>
        <a href="{{route('regular_type_edit',['id'=>$regular_type_id])}}" class="btn btn-lg btn-danger">{{__('編集')}}</a>
    @else
        <button type="submit" class="btn btn-lg btn-danger register" >{{__('保存')}}</button>
    @endIf
</div>

