@extends('vip.layouts')
@section('content')
    <style>
        .layui-laydate-range {
            width: auto;
        }

        .layui-form-switch em {
            width: auto;
        }

        .layui-form-switch {
            width: 44px;
            line-height: 23px;
        }

        .layui-form-item .checkbox {
            width: auto;
        }
    </style>

	<script type="text/html" id="selectip">
	  <a href="/admin/log/logipDetail?ip=@{{d.ip}}">@{{ d.ip}}</a>
	</script>
	<script type="text/html" id="selectregistip">
	  <a href="/admin/log/registipDetail?register_ip=@{{d.register_ip}}">@{{ d.register_ip}}</a>
	</script>
	<script type="text/html" id="selecturl">
	  <a href="/admin/log/logurlDetail?url=@{{d.url}}">@{{ d.url}}</a>
	</script>
    <div class="layui-row">

        <div class="layui-col-xs12">

            <form class="layui-form rewrite" action="" eventType=eventForm>
                <div class="layui-form-item">
                    <div class="layui-inline">
						<label class="layui-form-label">{{ trans('user.account') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="account" id="form_account" lay-verify="required" autocomplete="off" class="layui-input" eventType=event-query  value="{{ $account }}">
						</div>
						<div class="layui-input-inline checkbox">
                            <input type="checkbox" name="sureblur" id="form_sureblur" lay-skin="switch" lay-text="精确|模糊"checked eventType=event-query>
                        </div>
                    </div>
                    <div class="layui-inline">
						<label class="layui-form-label">{{ trans('user.type') }}</label>
						<div class="layui-input-inline" style="width: 200px">
							<select name="type"  id="form_type"  lay-verify="" autocomplete="off" class="layui-input"  eventType=event-query>
								<option value="">{{ trans('user.select_replytype') }}</option>
								@foreach(trans('status.logfile.type') as $k=>$v):
									@if($type==$v))
										<option value="{{$v}}" selected="selected">{{$v}}</option>
									@else
										<option value="{{$v}}">{{$v}}</option>
									@endif
								@endforeach
							</select>
						</div>
                    </div>
                    <div class="layui-inline">
						<label class="layui-form-label">{{ trans('user.register_ip') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="register_ip"  id="form_register_ip"  lay-verify="" autocomplete="off" class="layui-input" eventType=event-query  value="{{ $register_ip }}">
						</div>
                    </div>
                    <div class="layui-inline">
						<label class="layui-form-label">{{ trans('user.url') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="url"  id="form_url"  lay-verify="" autocomplete="off" class="layui-input" eventType=event-query  value="{{ $url }}">
						</div>
                    </div>
                    <div class="layui-inline">
						<label class="layui-form-label">{{ trans('user.last_ip') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="last_ip"  id="form_last_ip"  lay-verify="" autocomplete="off" class="layui-input" eventType=event-query  value="{{ $last_ip }}">
						</div>

					</div>

					<div class="layui-inline">

						<label class="layui-form-label">{{ trans('user.log_startime') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="log_startime"  id="form_log_startime" placeholder=" - "  lay-verify="" autocomplete="off" class="layui-input test-item" eventType=event-query  value="{{ $log_startime }}">
						</div>
                    </div>
                    <div class="layui-inline">
						<label class="layui-form-label">{{ trans('user.log_endtime') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="log_endtime"  id="form_log_endtime" placeholder=" - "  lay-verify="" autocomplete="off" class="layui-input test-item" eventType=event-query  value="{{ $log_endtime }}">
						</div>

				   </div>

					<div class="layui-inline">
					<a class="layui-btn layui-btn-sm lay-btn-diy"   data-type="reload" style="opacity: 1; pointer-events: auto;" eventType=event-query-submit>提交</a>
					<a  class="layui-btn   layui-btn-sm  layui-btn-normal reset" data-type="reload" style="opacity: 1; pointer-events: auto;">重置</a>
                    <a class="layui-btn layui-btn-sm layui-btn-green  set" data-type="reload" style="opacity: 1; pointer-events: auto;"><i class="layui-icon">ဂ</i></a>
				   </div>

                </div>
            </form>
        </div>
    </div>
@push('dataTableJS')
/*var active = {
    reload: function(){
      //执行重载
      table.reload('{{ $dataId }}', {
        page: {
          curr: 1 //重新从第 1 页开始
        }
        ,where: {
            account:$("#form_account").val(),
            type:$('#form_type').val(),
            register_ip:$('#form_register_ip').val(),
            last_ip:$('#form_last_ip').val(),
            url:$('#form_url').val(),
            log_startime:$('#form_log_startime').val(),
            log_endtime:$('#form_log_endtime').val(),
			sureblur:$('.layui-form-switch').text(),
        }
      });
    }
  };
$('.lay-btn-diy').on('click', function(){
    var type = $(this).data('type');
    active[type] ? active[type].call(this) : '';
  });*/

  //重置表单
  $('.reset').on('click',function(){
      $('input').val('');
      $('#form_status').val('');
      $('#form_type').val('');
	  //var type = $(this).data('type');
	  //active[type] ? active[type].call(this) : '';
  });

  //刷新表单
    $('.set').on('click',function(){
    //var type = $(this).data('type');
    //active[type] ? active[type].call(this) : '';
    });

@endpush

    @include('vip.datatable')
@endsection
