@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('operator_que_add')}}" class="btn btn-lg btn-success">{{__('登録')}}</a>
        <a href="{{route('operator_que_edit',['id'=>$que_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.que_id')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="{{$que_id}}" placeholder="{{__('validation.attributes.que_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.user_name')}}</label>
        </div>
        <div class="form-group col-9">
            <select class="form-control form-control-lg" id="select_user" name="user_name" @if($isInfo) disabled @endif>
                <option value="">{{__('validation.attributes.user_name')}}</option>
                @foreach($users as $item)
                    <option value="{{$item->user_seq}}" mobile="{{$item->user_mobile}}" homePhone="{{$item->user_homephone}}" @if($item->user_seq == $user_id) selected @endif>{{$item->user_name}}</option>
                @endforeach
            </select>
        </div>


        <!-- 携帯電話番号 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.user_mobile')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="" id="mobile" placeholder="{{__('validation.attributes.user_mobile')}}"
                       class="form-control form-control-lg" readonly/>
            </div>
        </div>

        <!-- 自宅電話番号 -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.user_homephone')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <input type="text" value="" id="homephone" placeholder="{{__('validation.attributes.user_homephone')}}"
                       class="form-control form-control-lg" readonly/>
            </div>
        </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">
            <select class="form-control form-control-lg" name="park_name" @if($isInfo) 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 class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.que_class')}}</label>
        </div>
        <div class="form-group col-9">
            <select class="form-control form-control-lg" name="que_class" @if($isInfo) disabled @endif>
                <option value="">{{__('validation.attributes.que_class')}}</option>
                @foreach(\App\OperatorQue::QueClass as $key => $item)
                    <option value="{{$key}}" @if($key == $que_class) selected @endif>{{$item}}</option>
                @endforeach
            </select>
        </div>

        <!-- キューコメント -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.que_comment')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <textarea class="form-control form-control-lg" @if($isInfo) readonly @endif  rows="5"
                          placeholder="{{__('validation.attributes.que_comment')}}"
                          name="que_comment">{{$que_comment}}</textarea>
            </div>
        </div>
        <!-- /.form group - キューコメント -->

        <!-- キューステータス -->
        <div class="form-group col-3">
            <label @if(!$isInfo) class="required" @endif>{{__('validation.attributes.que_status')}}</label>
        </div>
        <div class="form-group col-9">
            <select class="form-control form-control-lg" name="que_status" @if($isInfo) disabled @endif>
                <option value="">{{__('validation.attributes.que_status')}}</option>
                @foreach(\App\OperatorQue::QueStatus as $key => $item)
                    <option value="{{$key}}" @if($key == $que_status) selected @endif>{{$item}}</option>
                @endforeach
            </select>
        </div>

        <!-- キューステータスコメント -->
        <div class="form-group col-3">
            <label>{{__('validation.attributes.que_status_comment')}}</label>
        </div>
        <div class="form-group col-9">
            <div class="input-group">
                <textarea class="form-control form-control-lg" @if($isInfo) readonly @endif  rows="5"
                          placeholder="{{__('validation.attributes.que_status_comment')}}"
                          name="que_status_comment">{{$que_status_comment}}</textarea>

            </div>
        </div>
    </div>
    @if($isInfo)
        <a href="{{route('operator_que_add')}}" class="btn btn-lg btn-success">{{__('登録')}}</a>
        <a href="{{route('operator_que_edit',['id'=>$que_id])}}" class="btn btn-lg btn-danger">{{__('編集')}}</a>
    @else
        <button type="submit" class="btn btn-lg btn-danger register" >{{__('保存')}}</button>
    @endIf
</div>

