@extends('base.base')
@section('base')
    <!-- 内容区域 -->
    <div class="main-panel">
        <div class="content-wrapper">
            <div class="page-header">
                <h3 class="page-title">
                     <span class="page-title-icon bg-gradient-primary text-white mr-2">
                        <i class="mdi mdi-settings"></i>
                    </span>
                    {{ __('auto.流失用户查询') }}
                </h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">{{ __('auto.用户管理') }}</a></li>
                        <li class="breadcrumb-item active" aria-current="page">{{ __('auto.用户查询') }}</li>
                    </ol>
                </nav>
            </div>
            <div class="row">
                <div class="col-lg-12 grid-margin stretch-card">
                    <div class="card">
                        <div class="card-body">
                            <h4 class="card-title">{{ __('auto.用户查询') }}</h4>
                            <form class="well form-inline margin-top-20" method="get" action='/admin/user/lost'>
                                <div>
                                    <spen style="padding-left: 10px" >{{ __('auto.注册时间：') }}</spen>
                                    <input type="date"  step="01" name="start_time" class="form-control" value="{{$start_time}}" />
                                    <input type="date"  step="01" name="end_time" class="form-control" value="{{$end_time}}" />
                                </div>
                                <div>
                                   <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="{{ __('auto.搜索') }}"/>
                                    <a href="/admin/user/lost" class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.清空') }}</a>
                                    <a href="/admin/user/lost?excel=1&start_time={{$start_time}}&end_time={{$end_time}}&goldmin={{$goldmin}}&goldmax={{$goldmax}}&cardmin={{$cardmin}}&cardmax={{$cardmax}}" class="btn btn-sm btn-gradient-light btn-icon-text">{{ __('auto.导出') }}</a>
                                    @if($url)
                                    <a href="{{$url}}" class="btn btn-sm btn-gradient-info btn-icon-text">{{ __('auto.返回') }}</a>
                                    @else
                                    @endif
                                </div>
                            </form>
                            <table class="table table-bordered">
                                @foreach($list as $k=>$item)
                                <thead>
                                <div>
                                    <div style="padding-bottom: 3%;padding-top: 3%">
                                        <div style="width: 30%;float:left;">{{ __('auto.用户昵称：') }}{{$item->NickName}}</div>
                                        <div style="width: 30%;float:left;">{{ __('auto.充值总额：') }}{{$item->Recharge}}</div>
                                        <div style="width: 40%;float:left;">{{ __('auto.最后登录时间：') }}{{$item->LastLogonDate}}</div>
                                    </div>
                                    <div style="padding-bottom: 3%">
                                        <div style="width: 30%;float:left;">{{ __('auto.游戏ID：') }}{{$item->GameID}}</div>
                                        {{--<div style="width: 40%;float:left;">VIP{{ __('auto.过期时间：') }}{{$item->MemberOverDate}}</div>--}}
                                        {{--<div style="width: 30%;float:left;">VIP{{ __('auto.等级：') }}{{$item->MemberOrder}}</div>--}}
                                        <div style="width: 40%;float:left;">{{ __('auto.注册时间：') }}{{$item->RegisterDate}}</div>
                                    </div>
                                    <div style="padding-bottom: 3%">
                                        <div style="width: 30%;float:left;">{{ __('auto.用户编号：') }}{{$item->UserID}}</div>
                                        <div style="width: 30%;float:left;">{{ __('auto.携带金豆：') }}{{$item->Score}}</div>
                                    </div>
                                    <div style="padding-bottom: 3%">
                                        <div style="width: 30%;float:left;">{{ __('auto.手机号：') }}{{$item->PhoneNum}}</div>
                                        {{--<div style="width: 30%;float:left;">{{ __('auto.银行金豆：') }}{{$item->BankScore}}</div>--}}
                                        <div style="width: 40%;float:left;">{{ __('auto.推荐渠道：') }}{{$item->Channel}}</div>
                                    </div>
                                    <div style="padding-bottom: 3%">
                                        <div style="width: 30%;float:left;">{{ __('auto.身份证号：') }}{{$item->PassPortID}}</div>
                                        {{--<div style="width: 30%;float:left;">{{ __('auto.房卡：') }}{{$item->InsureScore}}</div>--}}
                                        <div style="width: 40%;float:left;">{{ __('auto.推荐人昵称：') }}{{$item->SpreaderName}}</div>
                                    </div>
                                    <div style="padding-bottom: 3%">
                                        <div style="width: 30%;float:left;">{{ __('auto.姓名：') }}{{$item->Compellation}}</div>
                                        {{--<div style="width: 30%;float:left;">{{ __('auto.福卡：') }}{{$item->Revenue}}</div>--}}
                                        <div style="width: 40%;float:left;">{{ __('auto.推荐人ID：') }}{{$item->SpreaderGameID}}</div>
                                    </div>
                                    <div style="padding-bottom: 3%">
                                        <div style="width: 30%;float:left;">{{ __('auto.操作系统：') }}{{$item->LastLogonMobile}}</div>
                                        <div style="width: 30%;float:left;">{{ __('auto.游戏时长：') }}{{$item->Experience}}</div>
                                        <div style="width: 40%;float:left;">{{ __('auto.推荐人编号：') }}{{$item->SpreaderUserID}}</div>
                                    </div>

                                </div>
                                <div style="border-bottom:1px solid #000">
                                    <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="purchase({{$item->UserID}})">{{ __('auto.购买记录') }}</button>
                                    <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="game({{$item->UserID}})">{{ __('auto.游戏记录') }}</button>
                                    <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="score({{$item->UserID}})">{{ __('auto.金豆记录') }}</button>
                                   {{-- <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="dhjl({{$item->UserID}})">{{ __('auto.兑换记录') }}</button>--}}
                                    {{--<button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="card({{$item->UserID}})">{{ __('auto.福卡记录') }}</button>--}}
                                    @if($item->Nullity == 1)
                                        <input type="hidden" id="nullity{{ $item->UserID }}" value="0" />
                                        <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="update({{ $item->UserID }})">
                                            {{ __('auto.解冻') }}
                                        </button>
                                    @else
                                        <input type="hidden" id="nullity{{ $item->UserID }}" value="1" />
                                        <button type="button" class="btn btn-sm btn-gradient-info btn-icon-text" onclick="update({{ $item->UserID }})">
                                            {{ __('auto.冻结') }}
                                        </button>
                                    @endif
                                </div>
                                </thead>
                                @endforeach
                            </table>
                            <div class="box-footer clearfix">
                                {{ __('auto.总共') }} <b>{{ $list->appends(['user_id'=>$user_id,'game_id'=>$game_id,'nickname'=>$nickname,'mobile'=>$mobile,'start_time'=>$start_time,'end_time'=>$end_time,'goldmin'=>$goldmin,'goldmax'=>$goldmax,'cardmin'=>$cardmin,'cardmax'=>$cardmax])->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
                                {!! $list->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        function update(id){
            myConfirm("{{ __('auto.是否继续') }}?",function(){
                var nullity= document.getElementById('nullity'+id).value;
                myRequest("/admin/user/freeze/"+id,"post",{nullity:nullity},function(res){
                    layer.msg(res.msg)
                    setTimeout(function(){
                        window.location.reload();
                    },1500)
                });
            });
        }
        function purchase(id){
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.购买记录') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['100%', '100%'],
                content: '/admin/user/purchase/'+id
            });
        }
        function game(id){
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.游戏记录') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['100%', '100%'],
                content: '/admin/user/game/'+id
            });
        }
        function score(id){
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.金豆记录') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['100%', '100%'],
                content: '/admin/user/score/'+id
            });
        }
        function dhjl(id){
           /* var page = layer.open({
                type: 2,
                title: '{{ __('auto.金豆记录') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['100%', '100%'],
                content: '/admin/user/score/'+id
            });*/
        }
        function card(id){
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.福卡记录') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['100%', '100%'],
                content: '/admin/user/card/'+id
            });
        }
    </script>
@endsection
