@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('manager_add')}}" class="btn btn-lg btn-success">{{__('登録')}}</a>
        <a href="{{route('manager_edit',['id'=>$manager_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($isInfo || $isEdit)
        <!-- 駐車場管理者ID -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.manager_id')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$manager_id}}" placeholder="{{__('validation.attributes.manager_id')}}"
                       class="form-control form-control-lg" readonly/>
            </div>
        </div>
        @endif
        <!-- 駐車場管理者名 -->
        <!-- 駐車場管理者ID -->
        <div class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.manager_name')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$manager_name}}" placeholder="{{__('validation.attributes.manager_name')}}"
                       name="manager_name"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>

        <!-- 種別 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.manager_type')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$manager_type}}" placeholder="{{__('validation.attributes.manager_type')}}"
                       name="manager_type"
                       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.park_name')}}</label>
        </div>
        <div class="form-group col-9">
            <select class="form-control form-control-lg mb10" name="park_name" @if($isInfo) disabled @endif>
                <option value="">{{__('validation.attributes.park_name')}}</option>
                @foreach($parks as $key => $val)
                    <option value="{{$key}}" @if($manager_parkid == $key)selected @endif>{{$val}}</option>
                @endforeach
            </select>
        </div>

        <!-- 管理デバイス1_ID -->
        <div class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.manager_device1')}}</label>
        </div>
        <div class="form-group col-9">
            <select class="form-control form-control-lg mb10" name="manager_device1" @if($isInfo) disabled @endif>
                <option value="">{{__('validation.attributes.manager_device1')}}</option>
                @foreach($devices as $key => $val)
                    <option value="{{$key}}" @if($manager_device1 == $key)selected @endif>{{$val}}</option>
                @endforeach
            </select>
        </div>
        <!-- /.form group - 管理デバイス1_ID -->

        <!-- 管理デバイス2_ID -->
        <div class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.manager_device2')}}</label>
        </div>
        <div class="form-group col-9">
            <select class="form-control form-control-lg mb10" name="manager_device2" @if($isInfo) disabled @endif>
                <option value="">{{__('validation.attributes.manager_device2')}}</option>
                @foreach($devices as $key => $val)
                    <option value="{{$key}}" @if($manager_device2 == $key)selected @endif>{{$val}}</option>
                @endforeach
            </select>
        </div>
        <!-- /.form group - 管理デバイス2_ID -->

        <!-- メールアドレス -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.manager_mail')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$manager_mail}}" placeholder="{{__('validation.attributes.manager_mail')}}"
                       name="manager_mail"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - メールアドレス -->

        <!-- 電話番号 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.manager_tel')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$manager_tel}}" placeholder="{{__('validation.attributes.manager_tel')}}"
                       name="manager_tel"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - 電話番号 -->

        <!-- アラート1送信 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.manager_alert1')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$manager_alert1}}" placeholder="{{__('validation.attributes.manager_alert1')}}"
                       name="manager_alert1"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - アラート1送信 -->

        <!-- アラート2送信 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.manager_alert2')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$manager_alert2}}"
                       placeholder="{{__('validation.attributes.manager_alert2')}}" name="manager_alert2"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - アラート2送信 -->

        <!-- 退職フラグ -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.manager_quit_flag')}}</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="manager_quit_flag" @if($isInfo) disabled @endif
                           value="1" {{$manager_quit_flag? 'checked':''}}>
                    <label class="form-check-label">{{__("退職")}}</label>
                </div>
                <div class="col-3 form-check">
                    <input type="radio" class="minimal"
                           name="manager_quit_flag" @if($isInfo) disabled @endif
                           value="0" {{!$manager_quit_flag? 'checked':''}}>
                    <label class="form-check-label">{{__("退職しない")}}</label>
                </div>
            </div>
        </div>
        <!-- /.form group - 退職フラグ -->

        <!-- 退職日 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.manager_quitday')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="date" value="{{$manager_quitday}}"
                       placeholder="{{__('validation.attributes.manager_quitday')}}" name="manager_quitday"
                       class="form-control form-control-lg" @if($isInfo) readonly @endif/>
            </div>
        </div>
        <!-- /.form group - 退職日 -->
    </div>
    @if($isInfo)
        <a href="{{route('manager_add')}}" class="btn btn-lg btn-success">{{__('登録')}}</a>
        <a href="{{route('manager_edit',['id'=>$manager_id])}}" class="btn btn-lg btn-danger">{{__('編集')}}</a>
    @else
        <button type="submit" class="btn btn-lg btn-danger register" >{{__('保存')}}</button>
    @endIf
</div>

