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

    <!-- 内容区域 -->
    <style type="text/css">
        .table th {
            padding: 0.8375rem;
            vertical-align: top;
            border-top: 1px solid #ebedf2;
        }


        element.style {
            position: absolute;
            left: 136px;
            top: 0px;
            width: 300px;
            height: 400px;
            user-select: none;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            padding: 0px;
            margin: 0px;
            border-width: 0px;
        }

        canvas {
            width: 100%;
            margin-top: 48px;
            height: 150%;
            margin-left: 20px;
        }
    </style>
    <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="col-lg-12 grid-margin stretch-card">
                <div class="card">
                    <div class="card-body">
                        <div>
                            @if ($OpenPage == 1)
                                <a href="#" onClick="closeFunc()">{{ __('auto.返回上一页') }}</a>
                            @else
                                <a href="#" onClick="javascript :history.back(-1);">{{ __('auto.返回上一页') }}</a>
                            @endif


                            <a href="/admin/global/winloser?UserID={{$userInfo->GameID}}&id_list=1"
                               class="btn btn-sm btn-gradient-success">{{ __('auto.战绩搜索') }}</a>
                            <a href="/admin/global/join?id=5&UserID={{$userInfo->UserID}}"
                               class="btn btn-sm btn-gradient-success">{{ __('auto.登录ip记录') }}</a>
                            <button class="btn btn-sm btn-gradient-dark" onclick="bindPhone({{ $userInfo->UserID }})">{{ __('auto.绑定手机号') }}</button>
                            @if($userInfo->blacklist)
                                <a class="btn btn-sm btn-gradient-success layer-switch"  data-remind="{{ __('auto.你确定要解除吗？') }}"
                                   href="/admin/blacklist/remove/{{$userInfo->UserID}}">{{ __('auto.解除黑名单') }}</a>
                            @else
                                <a class="btn btn-sm btn-gradient-dark layer-switch" data-remind="{{ __('auto.你确定要添加吗？') }}"
                                   href="/admin/blacklist/add/{{$userInfo->UserID}}">{{ __('auto.添加黑名单') }}</a>
                            @endif

                        </div>
                        <table class="table table-bordered" style="margin-left:5px;width: 20%;float: left">

                            <tr>
                                <td width="5%" colspan="2">{{ __('auto.基本信息') }}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.会员') }}ID</td>
                                <td>{{$userInfo->GameID}}</td>
                            </tr>

                            <tr>
                                <td>GlobalUID</td>
                                <td>{{$userInfo->GlobalUID??""}}</td>
                            </tr>

                            <tr>
                                <td>{{ __('auto.昵称') }}</td>
                                <td>{{$userInfo->NickName}}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.手机号') }}</td>
                                <td>{{$userInfo->phone}} <a  target="_blank"
                                                            href="https://api.whatsapp.com/send?phone=55{{$userInfo->phone}}">what's app</a></td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.上次离线时间') }}</td>
                                <td>{{$userInfo->LastLogonDate}}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.当前所在房间') }}</td>
                                <td>
                                    @if($userInfo->getUserOnLine == null)
                                        {{ __('auto.离线') }}
                                    @else
                                        {{ __('auto.在线（') }}{{$userInfo->getUserOnLine}}）
                                    @endif
                                </td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.当前手机包') }}</td>
                                <td>{{ $userInfo->PackgeName }}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.税收') }}</td>
                                <td>{{$data['revenue']}}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.游戏时长') }}</td>
                                <td>{{ $userInfo->PlayTimeCount }}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.用户来源') }}</td>
                                <td>{{ $userSource }}</td>
                            </tr>
                        </table>
                        <table class="table table-bordered" style="margin-left:5px;width: 20%;float: left">

                            <tr>
                                <td width="5%" colspan="2">{{ __('auto.金豆信息') }}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.当前金豆') }}</td>
                                <td>{{ $data['score'] }}</td>
                            </tr>

                            <tr>
                                <td>{{ __('auto.最高分') }}</td>
                                <td>{{ $userInfo->gameScoreInfo->MaxScore/100 }}</td>
                            </tr>

                            <tr>
                                <td>{{ __('auto.最多赢分') }}</td>
                                <td>{{ $userInfo->gameScoreInfo->MaxWinScore/100 }}</td>
                            </tr>

                            <tr>
                                <td>{{ __('auto.最多可提现') }}</td>
                                <td>{{ $data['MaxDrawBase'] }}</td>
                            </tr>



                            <tr>
                                <td>{{ __('auto.历史充值/今日') }}</td>
                                <td>{{$data['total_cz']}} / {{$data['today_cz']}}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.历史茶叶/今日') }}({{ __('auto.含手续费') }})</td>
                                <td>{{$data['withdraw']}} / {{$data['today_withdraw']}}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.历史茶叶手续费') }}</td>
                                <td>{{$data['serviceFee']}}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.历史彩金/今日') }}</td>
                                <td>{{$data['total_cellData']}} / {{$data['today_cellData']}}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.历史总输赢/今日') }}</td>
                                <td>{{$data['total_profit']}} / {{$data['today_profit']}}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.历史充减提/今日') }}</td>
                                <td>{{$data['total_realpay']}} / {{$data['today_realpay']}}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.月卡已买') }}/ {{ __('auto.已领') }}</td>
                                <td>{{$data['buyMonthCard']}} / {{$data['getMonthCard']}}</td>
                            </tr>


                            <tr>
                                <td>{{ __('auto.推广赚金充值奖金已领') }} / {{ __('auto.可领') }}</td>
                                <td>{{$data['rechargeReward']}} / {{$data['rechargeLastReward']}}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.推广赚金邀请注册奖金已领') }} / {{ __('auto.可领') }}</td>
                                <td>{{$data['shareReward']}} / {{$data['shareLastReward']}} </td>
                            </tr>
                        </table>
                        <table class="table table-bordered" style="margin-left:5px;width: 20%;float: left">

                            <tr>
                                <td width="5%" colspan="2">{{ __('auto.来源信息') }}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.注册日期（当地）') }}</td>
                                <td>{{ date('Y-m-d H:i:s',strtotime($userInfo->RegisterDate))}}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.注册日期（中国）') }}</td>
                                <td>{{ dateConvert($userInfo->RegisterDate) }}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.注册') }}IP</td>
                                <td>{{$userInfo->RegisterIP}}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.渠道来源') }}</td>
                                <td>
                                    {{$userInfo->Channel}}
                                </td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.上级') }}ID</td>
                                <td>{{$userInfo->spreaderID}}</td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.手机型号') }}</td>
                                <td>
                                    {{ __('auto.安卓') }}
                                </td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.关联注册') }}IP</td>
                                <td>
                                    @if ($userInfo->sameIpCount > 1)
                                        <a href="/admin/global/join?id=1&RegisterIP={{$userInfo->RegisterIP}}">{{ __('auto.关联IP【') }} {{$userInfo->sameIpCount}}
                                            】</a>
                                    @else
                                        {{ __('auto.关联IP【') }}0】
                                    @endif

                                </td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.关联登录') }}IP</td>
                                <td>

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

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

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

                                </td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.关联手机号') }}</td>
                                <td>
                                    @if (isset($userInfo->samePhoneCount) && $userInfo->samePhoneCount > 1)
                                        <a href="/admin/global/join?id=3&Phone={{$userInfo->phone ?? ''}}">{{ __('auto.关联手机号【') }} {{$userInfo->samePhoneCount ?? ''}}
                                            】</a>
                                    @else
                                        {{ __('auto.关联手机号【0】') }}
                                    @endif

                                </td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.关联设备') }}</td>
                                <td>
                                    @if (isset($userInfo->sameMac) && $userInfo->sameMac > 1)
                                    <a href="/admin/global/join?id=2&UserID={{$userInfo->UserID}}">{{ __('auto.关联设备【') }}{{$userInfo->sameMac}}】</a>
                                    @else
                                        {{ __('auto.关联设备【0】') }}
                                    @endif
                                </td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.未领取邮件金币') }}</td>
                                <td>{{$data['waitGetEmailScore']}} </td>
                            </tr>
                            <tr>
                                <td>{{ __('auto.可茶叶金额') }}</td>
                                <td>{{$data['remainingBalance']}} </td>
                            </tr>
                        </table>
                        <table class="table table-bordered" style="margin-left:5px;width: 20%;float: left">

                            <tr>
                                <td width="5%" colspan="2">{{ __('auto.用户游戏对局数') }}</td>
                            </tr>
                            <tr>
                                <th>{{ __('auto.游戏') }}</th>
                                <th>{{ __('auto.对局数') }}</th>
                            </tr>
                            @foreach($gameCount as $key => $value)
                            <tr>
                                <td>{{ $key }}</td>
                                <td>{{ $value }} </td>
                            </tr>
                            @endforeach
                        </table>

                        <table class="table table-bordered" style="margin-left:5px;width: 20%;float: left">

                            <tr>
                                <td width="5%" colspan="2">三方数据信息</td>
                            </tr>
                            <tr>
                                <th>平台</th>
                                <th>输赢（当天/总）</th>
                            </tr>
                            @foreach($platformData as $key => $value)
                                <tr>
                                    <td>{{ $key }}</td>
                                    <td>{{ $value['today'] }} / {{ $value['total'] }}</td>
                                </tr>
                            @endforeach
                        </table>


                    </div>

                    <div>{{ __('auto.用户控制：') }}
                        @if(hidden() != 'customer_service2')
                            <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text"
                                    onclick="update({{$userInfo->UserID}})">
                                {{ __('auto.点击修改') }}
                            </button>
                        @endif
                        &nbsp;&nbsp;{{ __('auto.解除禁止茶叶状态：') }}
                        <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text"
                                onclick="relieve({{$userInfo->UserID}})">
                            {{ __('auto.点击解除') }}
                        </button>&nbsp;&nbsp;


                        {{ __('auto.卡房间：') }}
                        <button class="btn btn-sm btn-gradient-dark" onclick="deleteRoom({{$userInfo->UserID}})">{{ __('auto.点击清除') }}
                        </button>
                        <button class="btn btn-sm btn-success" onclick="add_draw_base({{ $userInfo->UserID }})">{{ __('auto.增加可提额度') }}
                        </button>

                        <button class="btn btn-sm btn-success" onclick="add_tax({{ $userInfo->UserID }})">{{ __('auto.操作税收') }}
                        </button>
                        &nbsp;&nbsp;{{ __('auto.裂变领取限制开关：') }}
                        @if ($registerInviteSwitches == 1)
                            {{ __('auto.被限制') }}
                            <button class="btn-sm btn-gradient-dark"
                                    onclick="register_invite_switches({{ $userInfo->UserID }},0)">{{ __('auto.解除') }}
                            </button>
                        @else
                            <button class="btn-sm btn-gradient-dark"
                                    onclick="register_invite_switches({{ $userInfo->UserID }},1)">{{ __('auto.限制') }}
                            </button>
                        @endif

                    </div>

                </div>

            </div>
        </div>

    </div>


    <!-- 引入 ECharts 文件 -->
    <script src="/assets/js/echarts.min.js"></script>
    <script type="text/javascript">

        function closeFunc() {
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index); //再执行关闭

        }

        var switch_over = true;

        function deleteRoom(userID) {
            myConfirm("{{ __('auto.是否继续') }}?", function () {
                myRequest("/admin/global/deleteRoom/" + userID, "post", {}, function (res) {
                    layer.msg(res.msg)
                    setTimeout(function () {
                        window.location.reload();
                    }, 1500)
                });
            });
        }

        // 推广限制开关
        function register_invite_switches(UserID,Value) {

            myRequest("/admin/global/register_invite_switches/" + UserID, "post", {Value}, function (res) {
                layer.msg(res.msg)
                setTimeout(function () {
                    window.location.reload();
                }, 1500)
            });

        }


        function relieve(id) {
            myConfirm("{{ __('auto.是否继续') }}?", function () {
                myRequest("/admin/global/relieve/" + id, "post", {}, function (res) {
                    layer.msg(res.msg)
                    setTimeout(function () {
                        window.location.reload();
                    }, 1500)
                });
            });
        }

        function update(id) {
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.修改配置') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['70%', '90%'],
                content: '/admin/global/dk_userlist_edit?UserID=' + id
            });
        }

        function add_draw_base(userid) {
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.增加可提额度') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['40%', '50%'],
                content: '/admin/global/add_draw_base/' + userid
            });
        }


        function add_tax(userid) {
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.调整税收（') }}+{{ __('auto.加') }}-{{ __('auto.减）') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['40%', '50%'],
                content: '/admin/global/add_tax/' + userid
            });
        }

        function bindPhone(UserID) {
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.绑定手机号') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['40%', '50%'],
                content: '/admin/code/bind_phone/' + UserID
            });
        }




    </script>
@endsection
