@extends('base.base')
@section('base')

    <style>
        .card .card-body {
            padding: 0.5rem 0.5rem;
        }
    </style>
    <!-- 内容区域 -->
    <div class="main-panel">
        <div class="content-wrapper">
            <div>
{{--                <span>{{ __('auto.玩家ID：') }}{{$info->GameID}}</span>--}}
{{--                <span style="margin-left: 150px">{{ __('auto.玩家名字：') }}{{$info->NickName}}</span>--}}
            </div>

            <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.风险评估等级：') }}{{$gear}}
                    <a href="/admin/global/winloser?UserID={{$info->GameID}}&id_list=1"
                                         class="btn btn-sm btn-gradient-success">{{ __('auto.战绩搜索') }}</a>
                </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">

                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>{{ __('auto.会员') }}ID</th>
                                    <th>{{$info->GameID}}</th>
                                    <th>{{ __('auto.昵称') }}</th>
                                    <th>{{$info->NickName}}</th>
                                    <th>{{ __('auto.历史彩金') }} / {{ __('auto.今日') }}</th>
                                    <th>{{$info->total->Handsel ?? 0}} / {{$info->today->Handsel ?? 0}}</th>
                                    <th>{{ __('auto.历史提现') }} / {{ __('auto.今日') }}</th>
                                    <th>{{$info->total->Withdraw ?? 0}} / {{$info->today->Withdraw ?? 0}}</th>
                                </tr>
                                </thead>
                                <thead>
                                <tr>
                                    <th>{{ __('auto.注册日期') }}</th>
                                    <th>{{$info->RegisterDate}}</th>
                                    <th>{{ __('auto.历史总盈利') }} / {{ __('auto.今日') }}</th>
                                    <th>{{$info->total->Score ?? 0}} / {{$info->today->Score ?? 0}}</th>
                                    <th>{{ __('auto.历史咖啡') }} / {{ __('auto.今日') }}</th>
                                    <th>{{$info->total->Recharge ?? 0}} / {{$info->today->Recharge ?? 0}}</th>
                                    <th></th>
                                    <th></th>
                                </tr>
                                </thead>
                            </table>

                            <br>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>{{ __('auto.评估选项') }}</th>
                                    <th>{{ __('auto.具体数值') }}</th>
                                    <th>{{ __('auto.评估选项') }}2</th>
                                    <th>{{ __('auto.具体数值') }}</th>
                                </tr>
                                </thead>
                                <tbody class="search_checkbox">

                                <tr>
                                    <td>{{ __('auto.累计对局数') }}</td>
                                    <td>{{$info->playerNum}}</td>
                                    <td>{{ __('auto.已领取/可领取佣金') }}</td>
                                    <td>{{$info->commission}} / {{$info->waitCommission}}</td>
                                </tr>
{{--                                <tr>--}}
{{--                                    <td>rummy{{ __('auto.累计对局数') }}</td>--}}
{{--                                    <td>{{$info->rummy}}</td>--}}
{{--                                    <td>{{ __('auto.上次提现成功时间') }}</td>--}}
{{--                                    <td>{{$info->finalTime}}</td>--}}
{{--                                </tr>--}}
{{--                                <tr>--}}
{{--                                    <td>teenPatti{{ __('auto.累计对局数') }}</td>--}}
{{--                                    <td>{{$info->teenPatti}}</td>--}}
{{--                                    <td>{{ __('auto.注册IP查重') }} IP{{ __('auto.号：') }}{{$info->RegisterIP}}</td>--}}
{{--                                    <td>--}}
{{--                                        @if ($info->count > 1)--}}
{{--                                            <span style="color: red">{{ __('auto.有重复用户') }}IP--}}
{{--                                                <a href="/admin/withdrawal/duplicate_checking?type=RegisterIP&val={{$info->RegisterIP}}"> {{$info->count}}{{ __('auto.个') }}</a>--}}
{{--                                            </span>--}}
{{--                                        @else--}}
{{--                                            {{ __('auto.无重复用户') }}IP--}}
{{--                                        @endif--}}

{{--                                    </td>--}}
{{--                                </tr>--}}

                                <tr>

                                    <td>{{ __('auto.银行卡绑定信息评估') }} {{ __('auto.卡号：') }}{{$info->BankNO->BankNo ?? 0}}</td>
                                    <td>
                                        @if ($info->BankNO->count ?? 0 > 1)
                                            <span style="color: red">{{ __('auto.有重复用户绑定') }}
                                                <a href="/admin/withdrawal/duplicate_checking?type=BankNo&val={{$info->BankNO->BankNo ?? 0}}"> {{$info->BankNO->count ?? 0}}{{ __('auto.个') }}</a>
                                            </span>
                                        @else
                                            {{ __('auto.无重复用户绑定') }}
                                        @endif

                                    </td>
                                    <td>{{$userTab}}</td>
                                    <td>

                                    </td>
                                </tr>
                                <tr>
                                    <td>{{ __('auto.关联提现姓名') }}</td>
                                    <td>
                                        @if (isset($info->sameWithDrawName->count) && $info->sameWithDrawName->count > 1)
                                            <a href="/admin/global/join?id=4&BankUserName={{$info->sameWithDrawName->BankUserName ?? ''}}">{{ __('auto.关联姓名【') }} {{$info->sameWithDrawName->count ?? ''}}
                                                】</a>
                                        @else
                                            {{ __('auto.关联姓名【0】') }}
                                        @endif

                                    </td>
                                    <td>{{ __('auto.关联提现') }}Email</td>
                                    <td>
                                        @if (isset($info->sameWithDrawMail->count) && $info->sameWithDrawMail->count > 1)
                                            <a href="/admin/global/join?id=5&EmailAddress={{$info->sameWithDrawMail->EmailAddress ?? ''}}">{{ __('auto.关联Email【') }} {{$info->sameWithDrawMail->count ?? ''}}
                                                】</a>
                                        @else
                                            {{ __('auto.关联Email【') }}0】
                                        @endif

                                    </td>
                                    <td>{{ __('auto.关联') }}CPF</td>
                                    <td>
                                        @if (isset($info->sameCpfCount) && $info->sameCpfCount > 1)
                                            <a href="/admin/global/join?id=8&UserID={{$info->UserID?? ''}}">{{ __('auto.关联CPF【') }} {{$info->sameCpfCount ?? ''}}
                                                】</a>
                                        @else
                                            {{ __('auto.关联CPF【') }}0】
                                        @endif

                                    </td>
                                </tr>

                                @foreach($gameCount as $gameid=>$num)
                                <tr>
                                    <td>{{ $gameName[$gameid] }}{{ __('auto.对局数') }}</td>
                                    <td>{{ $num }}</td>
                                </tr>
                                @endforeach

                                </tbody>
                            </table>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>


        function checkbox() {
            var num = document.getElementsByName('checkbox');
            for (var i = 0; i < num.length; i++) {
                if (num[i].checked) {
                    num[i].checked = false;
                } else {
                    num[i].checked = true;
                }
            }
        }

        function duplicate_checking(type, val) {

            var page = layer.open({
                type: 2,
                title: '{{ __('auto.查重') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['90%', '80%'],
                content: '/admin/withdrawal/duplicate_checking?type=' + type + '&val=' + val
            });
        }

        function commit() {

            var str = '';
            var ids = ''

            // 获取单个值
            var only = $('.only_one').val()
            // 获取代付方值
            var agent = $("input[type='radio']:checked").val()

            if (only !== undefined) {
                ids = only;
                console.log(ids)
            } else {
                // 获取多选框选中的值
                var num = document.getElementsByName('checkbox');

                for (var i = 0; i < num.length; i++) {
                    if (num[i].checked) {
                        str = str + num[i].id + ',';
                    }
                }
                if (str === '') {
                    alert('{{ __('auto.请选择要操作的数据') }}');
                    return false;
                }
                ids = str.substr(0, str.length - 1);

            }

            var data = {
                'ids': ids,
                'agent': agent,
                'agree': true,
            }
            myConfirm("{{ __('auto.是否继续') }}?", function () {
                myRequest("/admin/withdrawal/verify", "post", data, function (res) {
                    layer.msg(res.msg)
                    if (res.code === 200) {
                        setTimeout(function () {
                            //window.location.href="/admin/withdrawal/verify?type=agree&ids="+str;
                            parent.location.reload();
                        }, 1500)
                    }
                });
            });

        }


        function ban(ban) {
            //1封号 2解封
            var num = document.getElementsByName('checkbox');

            var str = '';
            for (var i = 0; i < num.length; i++) {
                if (num[i].checked) {
                    str = str + num[i].id + ',';
                }
            }

            if (str == '') {
                alert('{{ __('auto.请选择要操作的数据') }}');
                return false;
            }
            var id = str.substr(0, str.length - 1);
            console.log(id)
            // myConfirm("是否继续账户操作?",function(){
            //     myRequest("/admin/global/ban","post",{id:id,ban:ban},function(res){
            //         layer.msg(res.msg)
            //         setTimeout(function(){
            //             window.location.reload();
            //         },1500)
            //     });
            // });
            return false;
        }
    </script>
@endsection
