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

    <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="account" lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">{{ trans('user.name') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="name" id="name" lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">{{ trans('user.grade') }}</label>
						<div class="layui-input-inline">
                            <select name="grade" id="grade" lay-verify="" autocomplete="off" class="layui-input">
                                <option value="">{{ trans('user.select_grade') }}</option>
                                @foreach(trans('status.account_detailed.grade') as $k=>$v):
                                <option value="{{$k}}">{{$v}}</option>
                                @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="register_ip"  lay-verify="" autocomplete="off" class="layui-input">
						</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="last_ip"  lay-verify="" autocomplete="off" class="layui-input">
						</div>

					</div>
					<div class="layui-inline">

						<label class="layui-form-label">{{ trans('user.regist_startime') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="regist_startime"  id="regist_startime" placeholder=" - "  lay-verify="" autocomplete="off" class="layui-input test-item">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">{{ trans('user.regist_endtime') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="regist_endtime"  id="regist_endtime" placeholder=" - "  lay-verify="" autocomplete="off" class="layui-input test-item">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">{{ trans('user.statuss') }}</label>
						<div class="layui-input-inline">
							<select name="statuss"  id="statuss"  lay-verify="" autocomplete="off" class="layui-input" >
								<option value="">{{ trans('user.select_statuss') }}</option>
								@foreach(trans('status.account_detailed.statuss') as $k=>$v):
									<option value="{{$k}}">{{$v}}</option>
								@endforeach
							</select>
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">{{ trans('user.phone') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="phone"  id="phone"  lay-verify="" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">{{ trans('user.email') }}</label>
						<div class="layui-input-inline">
							<input type="text" name="email"  id="email"  lay-verify="" autocomplete="off" class="layui-input">
						</div>

					</div>

					<div class="layui-inline">
						<label class="layui-form-label">{{ trans('user.cash_area') }}</label>
						<div class="layui-input-inline" style="width: 100px;">
							<input type="text" name="cash_small" id="cash_small" placeholder="￥0" autocomplete="off" class="layui-input">
						</div>
						<div class="layui-form-mid">-</div>
						<div class="layui-input-inline" style="width: 100px;">
							<input type="text" name="cash_big" id="cash_big" placeholder="￥100" autocomplete="off" class="layui-input">
						</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;">提交</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 class="layui-inline"><a href="javascript:delWin('/admin/user/delete?id=');" class="layui-btn layui-btn-sm  layui-btn-danger">删除</a></div>
                </div>
            </form>
        </div>
    </div>
            <script>
                $(function () {
                    $('body').on('click','a[eventtype="event-delete"]',function () {
                        alert('2312312');
                        var span=$(this).prev();
                        var id=span.attr('data-id');

                    })
                })
            </script>
@push('dataTableJS')
var active = {
    reload: function(){
      //执行重载
      table.reload('{{ $dataId }}', {
        page: {
          curr: 1 //重新从第 1 页开始
        }
        ,where: {
            account:$("#account").val(),
            name:$('#name').val(),
            grade:$('#grade').val(),
            register_ip:$('#register_ip').val(),
            last_ip:$('#last_ip').val(),
            regist_startime:$('#regist_startime').val(),
            regist_endtime:$('#regist_endtime').val(),
            statuss:$('#statuss').val(),
            phone:$('#phone').val(),
            email:$('#email').val(),
            cash_small:$('#cash_small').val(),
            cash_big:$('#cash_big').val(),
        }
      });
    }
  };
$('.lay-btn-diy').on('click', function(){
    var type = $(this).data('type');
    active[type] ? active[type].call(this) : '';
  });

  //重置表单
  $('.reset').on('click',function(){
	  $('input').val('');
	  $('#statuss').val('');
	  $('#grade').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
