@extends('base.base')
@section('base')
    <style>
        .fill {
            fill: #070700;
        }

        .infoWin {
            position: fixed;
            right: 1px;
            bottom: 10px;
            height: 80%;
            width: 40px;
        }

        .shuli {
            width: 46px;
            /*border: 1px solid #fe6500;*/
            height: 200px;
            margin-top: -1px;
            line-height: 70px;
            padding-top: 25px;
            word-wrap: break-word; /*英文的时候需要加上这句，自动换行*/
            text-align: center;
            cursor: pointer;
        }
    </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="row">
                <div class="col-lg-12 grid-margin stretch-card">
                    <div class="card">
                        <div class="infoWin">
                            <a onclick="dk_refresh()" class="shuli btn btn-sm btn-gradient-success"
                               href="javascript:void(0);">{{ __('auto.刷') }} <br> {{ __('auto.新') }}</a>

                        </div>
                        <div class="card-body">
                            <h4 class="card-title">{{ __('auto.用户单控系统实时数据') }}</h4>
                            <form class="well form-inline margin-top-20" method="post"
                                  action='/admin/global/dk_userlist'>
                                <div>
                                    @csrf
                                    <spen style="padding-left: 10px">{{ __('auto.会员ID：') }}</spen>
                                    <input class="form-control" type="text" name="GameID"
                                           placeholder="{{ __('auto.请输入数字') }}" style="width: 10%; " value="{{$GameID}}">
                                    <spen style="padding-left: 10px">{{ __('auto.上级ID：') }}</spen>
                                    <input class="form-control" type="text" name="SpreaderID" id="SpreaderID"
                                           placeholder="{{ __('auto.请输入数字') }}" style="width: 10%; " value="{{$SpreaderID}}">
                                    <spen style="padding-left: 10px">{{ __('auto.昵称：') }}</spen>
                                    <input class="form-control" type="text" name="NickName" id="Compellation"
                                           style="width: 10%; " value="{{$NickName}}">
                                    <spen style="padding-left: 10px">{{ __('auto.注册时间：') }}</spen>
                                    <input type="datetime-local" step="01" name="start_time" id="start_time"
                                           class="form-control" value="{{$start_time}}" onclick="start_times()"/>
                                    <input type="datetime-local" step="01" name="end_time" id='end_time'
                                           class="form-control" value="{{$end_time}}" onclick="end_times()"/><br>

                                    <select class="form-control" name="is_line" value="" style="color: black">
                                        <option value="">{{ __('auto.当前在线状态') }}</option>
                                        <option value="1" @if(1 == $is_line) selected @endif>{{ __('auto.游戏中') }}</option>
                                        <option value="2" @if(2 == $is_line) selected @endif>{{ __('auto.离线') }}</option>
                                    </select>
                                    <select class="form-control" name="game_room" value="" style="color: black">
                                        <option value="">{{ __('auto.当前游戏房间') }}</option>
                                        @foreach($game_room_line as $item)
                                            <option value="{{$item->ServerID}}"
                                                    @if($item->ServerID == $game_room) selected @endif>{{$item->ServerName}}</option>
                                        @endforeach
                                    </select>
                                    <select class="form-control" name="Channel" value="" style="color: black">
                                        <option value="">{{ __('auto.渠道搜索') }}</option>
                                        @foreach($allChannel as $key=>$val)
                                            <option value="{{$val}}"
                                                    @if($val == $Channel) selected @endif>{{$val}}</option>
                                        @endforeach

                                    </select>

                                    <select class="form-control" name="UserScoreControl" value="" style="color: black">
                                        <option value="">{{ __('auto.受控制状态') }}</option>
                                        <option value="1" @if(1 == $UserScoreControl)selected @endif>{{ __('auto.受控制用户') }}</option>
                                        <option value="2" @if(2 == $UserScoreControl)selected @endif>{{ __('auto.未受控制用户') }}</option>
                                        <option value="3" @if(3 == $UserScoreControl)selected @endif>{{ __('auto.自动控制') }}+{{ __('auto.单控中') }}</option>
                                        <option value="4" @if(4 == $UserScoreControl)selected @endif>{{ __('auto.自动控制中') }}</option>
                                    </select>
                                    <input type="hidden" name="Score" value="{{$ScoreSort}}">
                                    <input type="hidden" name="amount" value="{{$amountSort}}">
                                    <input type="hidden" name="sort_tx" value="{{$sort_tx}}">
                                    <input type="hidden" name="sort_date" value="{{$sort_date}}">
                                    <input type="hidden" name="ChangeScore" value="{{$ChangeScoreSort}}">
                                    <input type="hidden" name="label_sort" value="{{$label_sort}}">
                                    <input type="hidden" name="ServerNameSort" value="{{$ServerNameSort}}">


                                    <input type="submit" class="btn btn-sm btn-gradient-primary btn-icon-text"
                                           value="{{ __('auto.搜索') }}"/>&nbsp;&nbsp;
                                    <a href="/admin/global/dk_userlist" style="color: white">
                                        <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text">
                                            {{ __('auto.重置') }}
                                        </button>
                                    </a>
                                </div>


                            </form>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>{{ __('auto.状态') }}</th>
                                    <th>
                                        <div class="userLabel">
                                            {{ __('auto.会员') }}ID
                                            {!! sortHtml('userLabel') !!}
                                        </div>
                                    </th>
                                    <th>{{ __('auto.渠道') }}</th>
                                    <th width="4%">{{ __('auto.用户标签') }}</th>
                                    <th>
                                        <div class="sort_money">
                                            {{ __('auto.金币余额') }}
                                            {!! sortHtml('sort_money_func') !!}
                                        </div>

                                    </th>
                                    <th>
                                        <div class="ChangeScore">
                                            {{ __('auto.历史/今日总盈利') }}
                                            {!! sortHtml('ChangeScore_func') !!}
                                        </div>
                                    </th>

                                    <th>

                                        <div class="sort_cz">
                                            {{ __('auto.历史/今日充值') }}
                                            <svg t="1611284352657" class="icon2" onclick="sort_cz_func(this,'asc')"
                                                 viewBox="0 0 1024 1024" version="1.1"
                                                 xmlns="http://www.w3.org/2000/svg" p-id="4118" width="14">
                                                <path
                                                    d="M541.866667 285.866667l345.6 345.6c17.066667 17.066667 17.066667 42.666667 0 59.733333-8.533333 8.533333-19.2 12.8-29.866667 12.8H168.533333c-23.466667 0-42.666667-19.2-42.666666-42.666667 0-10.666667 4.266667-21.333333 12.8-29.866666l343.466666-345.6c17.066667-17.066667 42.666667-17.066667 59.733334 0z"
                                                    p-id="4119" fill="#707072">

                                                </path>
                                            </svg>

                                            <svg t="1611283709864" class="icon1" onclick="sort_cz_func(this,'desc')"
                                                 viewBox="0 0 1024 1024" version="1.1"
                                                 xmlns="http://www.w3.org/2000/svg" p-id="3148" width="14">
                                                <path
                                                    d="M482.133333 738.133333L136.533333 392.533333c-17.066667-17.066667-17.066667-42.666667 0-59.733333 8.533333-8.533333 19.2-12.8 29.866667-12.8h689.066667c23.466667 0 42.666667 19.2 42.666666 42.666667 0 10.666667-4.266667 21.333333-12.8 29.866666L541.866667 738.133333c-17.066667 17.066667-42.666667 17.066667-59.733334 0z"
                                                    p-id="3149" fill="#707071">

                                                </path>
                                            </svg>
                                        </div>

                                    </th>
                                    <th>
                                        <div class="sort_tx">
                                            {{ __('auto.历史/今日茶叶') }}
                                            <svg t="1611284352657" class="icon2" onclick="sort_tx_func(this,'asc')"
                                                 viewBox="0 0 1024 1024" version="1.1"
                                                 xmlns="http://www.w3.org/2000/svg" p-id="4118" width="14">
                                                <path
                                                    d="M541.866667 285.866667l345.6 345.6c17.066667 17.066667 17.066667 42.666667 0 59.733333-8.533333 8.533333-19.2 12.8-29.866667 12.8H168.533333c-23.466667 0-42.666667-19.2-42.666666-42.666667 0-10.666667 4.266667-21.333333 12.8-29.866666l343.466666-345.6c17.066667-17.066667 42.666667-17.066667 59.733334 0z"
                                                    p-id="4119" fill="#707072">

                                                </path>
                                            </svg>

                                            <svg t="1611283709864" class="icon1" onclick="sort_tx_func(this,'desc')"
                                                 viewBox="0 0 1024 1024" version="1.1"
                                                 xmlns="http://www.w3.org/2000/svg" p-id="3148" width="14">
                                                <path
                                                    d="M482.133333 738.133333L136.533333 392.533333c-17.066667-17.066667-17.066667-42.666667 0-59.733333 8.533333-8.533333 19.2-12.8 29.866667-12.8h689.066667c23.466667 0 42.666667 19.2 42.666666 42.666667 0 10.666667-4.266667 21.333333-12.8 29.866666L541.866667 738.133333c-17.066667 17.066667-42.666667 17.066667-59.733334 0z"
                                                    p-id="3149" fill="#707071">

                                                </path>
                                            </svg>
                                        </div>

                                    </th>
                                    <th>
                                        <div class="Handsel">
                                            {{ __('auto.历史/今日彩金') }}
                                            {!! sortHtml('Handsel_func') !!}
                                        </div>
                                    </th>
                                    <th>
                                        <div class="sort_date">
                                            {{ __('auto.注册时间') }}
                                            {!! sortHtml('sort_date_func') !!}
                                        </div>
                                    </th>
                                    <th>{{ __('auto.未领邮件金币') }}</th>
                                    <th>{{ __('auto.可茶叶') }}</th>
                                    <th width="8%">{{ __('auto.控制状态') }}</th>
                                    <th width="8%">{{ __('auto.捕鱼控制') }}</th>
                                    <th>{{ __('auto.单控记录') }}</th>
                                    <th>{{ __('auto.关联') }}IP</th>
                                    <th>{{ __('auto.备注') }}</th>
                                    <th>{{ __('auto.用户控制') }}</th>
                                </tr>
                                </thead>

                                <tbody>
                                @foreach($list as $item)
                                    <tr>
                                        <td>
                                            @if(!empty($item->ServerName) )
                                                <span style="color: green">{{ __('auto.游戏中') }}({{$item->ServerName ?? ''}})</span>
                                            @else
                                                {{ __('auto.离线') }}
                                            @endif
                                        </td>
                                        <td>
                                            <a href="/admin/global/id_find?UserID={{$item->UserID}}">
                                                @if (!isset($item->IDColor) || $item->IDColor == 0)
                                                    <span style="color: red">{{$item->GameID}}</span>
                                                @elseif($item->IDColor == 1)
                                                    <span style="color: blue">{{$item->GameID}}</span>
                                                @else
                                                    <span style="color: black">{{$item->GameID}}</span>
                                                @endif
                                            </a>
                                        </td>
                                        <td>{{ $item->Channel }}</td>
                                        <td onclick="update_label({{$item->UserID}})">{{$item->user_label ?? __('auto.普通会员')}}</td>
                                        <td>{{$item->Score}}</td>
                                        <td>{{ $item->todayScore ?? 0 }}/{{$item->totalScore ?? 0}}</td>
                                        <td onclick="Recharge(1,{{$item->GameID}})">
                                            <span
                                                onclick="Recharge(1,{{$item->GameID}})">{{$item->totalRecharge ?? 0}}</span>
                                            /
                                            <span
                                                onclick="Recharge(2,{{$item->GameID}})">{{$item->todayRecharge ?? 0}}</span>
                                        </td>
                                        <td>
                                            <span
                                                onclick="Cash(1,{{$item->GameID}})">{{$item->totalWithdraw ?? 0}}</span>
                                            /
                                            <span
                                                onclick="Cash(2,{{$item->GameID}})">{{$item->todayWithdraw ?? 0}}</span>
                                        </td>
                                        <td>
                                            {{$item->historyHandsel ?? 0}}/{{$item->todayHandsel ?? 0}}
                                        </td>
                                        <td>{{$item->RegisterDate}}</td>
                                        <td>{{$item->notReceived}}</td>
                                        <td>{{ $item->CashAble }}</td>
                                        <td>
                                            @if ($item->RecordRechargeControl == 1)
                                                {{ __('auto.自动控制') }} <br>
                                            @endif

                                            @empty($item->ControlScore)
                                                {{ __('auto.无') }}
                                            @elseif ($item->ControlScore < 0)
                                                {{ __('auto.单控中') }} {{$item->EffectiveScore}} / {{$item->ControlScore}}
                                                / {{$item->control_record}} {{ __('auto.输') }}
                                            @elseif ($item->ControlScore > 0)

                                                {{ __('auto.单控中') }}  {{ __('auto.赢') }}{{$item->EffectiveScore}} / {{$item->ControlScore}}
                                                {{$item->control_record}}

                                            @endempty
                                        </td>
                                        <td>{{$item->fishControl ?? ''}}</td>
                                        <td>
                                            <button class="btn btn-sm btn-gradient-danger"
                                                    onclick="show_control_log('{{$item->GameID}}')">{{ __('auto.查看') }}
                                            </button>
                                        </td>

                                        <td>
                                            @if ($item->LoginIpCount > 0)
                                                <a href="/admin/global/join?id=4&UserID={{$item->UserID}}">
                                                    {{$item->LoginIpCount}}
                                                </a>
                                            @else
                                                {{$item->LoginIpCount}}
                                            @endif

                                        </td>
                                        <td contentEditable="true"
                                            onblur="remarks(this,{{$item->UserID}})">{{$item->Remarks}}</td>
                                        <td>

                                            <button type="button" data-method="offset" data-type="auto"
                                                    class="btn btn-sm btn-gradient-dark btn-icon-text"
                                                    onclick="update({{$item->UserID ?? ""}})">
                                                {{ __('auto.修改') }}
                                                <i class="mdi mdi-file-check btn-icon-append"></i>
                                            </button>

                                            <button class="btn btn-sm btn-gradient-dark" id="fish"
                                                    onclick="fishFunc({{$item->UserID}});return false;">{{ __('auto.捕鱼控制') }}
                                            </button>
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            <div class="box-footer clearfix" id="pages">
                                {{ __('auto.总共') }} <b>{{ $list->appends([
                                                'list'=>$list,
                                                'GameID'=>$GameID,
                                                'SpreaderID'=>$SpreaderID,
                                                'NickName'=>$NickName,
                                                'start_time'=>$start_time,
                                                'end_time'=>$end_time,
                                                'is_line' => $is_line,
                                                'game_room' => $game_room,
                                                'label' => $user_label,
                                                'Score' => $ScoreSort,
                                                'amount' => $amountSort,
                                                'sort_tx' => $sort_tx,
                                                'sort_date' => $sort_date,
                                                'ChangeScore' => $ChangeScoreSort,
                                                'UserScoreControl' => $UserScoreControl,
                                                'Channel' => $Channel,
                                                'label_sort' => $label_sort,
                                                'ServerNameSort' => $ServerNameSort

                            ])->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
                                {!! $list->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>

        <script>


            data_obj = {
                'GameID': "{{$GameID}}",
                'SpreaderID': "{{$SpreaderID}}",
                'NickName': "{{$NickName}}",
                'start_time': "{{$start_time}}",
                'end_time': "{{$end_time}}",
                'is_line': "{{$is_line}}",
                'game_room': "{{$game_room}}",
                'label': "{{$user_label}}",
                'Score': "{{$ScoreSort}}",
                'amount': "{{$amountSort}}",
                'sort_tx': "{{$sort_tx}}",
                'sort_date': "{{$sort_date}}",
                'ChangeScore': "{{$ChangeScoreSort}}",
                'UserScoreControl': "{{$UserScoreControl}}",
                'Channel': "{{$Channel}}",
                'label_sort': "{{$label_sort}}",
                'page':{{$page}},
                'ServerNameSort':"{{$ServerNameSort}}"

            };

            function fishFunc(UserID) {
                var page = layer.open({
                    type: 2,
                    title: '{{ __('auto.捕鱼配置') }}',
                    shadeClose: true,
                    shade: 0.8,
                    area: ['70%', '80%'],
                    content: '/admin/Control/fish_add/'+UserID,
                });
            }

            function Recharge(type, GameID) {
                if (type == 1) {
                    var page = layer.open({
                        type: 2,
                        title: '{{ __('auto.总充值') }}',
                        shadeClose: true,
                        offset: 't',
                        shade: 0.8,
                        area: ['60%', '80%'],
                        content: "/admin/recharge/list?UserID=" + GameID + "&recharge_type=1&isEmpty=1",
                    })
                } else {
                    var page = layer.open({
                        type: 2,
                        title: '{{ __('auto.今日充值') }}',
                        shadeClose: true,
                        shade: 0.8,
                        offset: 't',
                        area: ['70%', '80%'],
                        content: "/admin/recharge/list?UserID=" + GameID + "&recharge_type=1&isEmpty=2",
                    })

                }
            }

            function Cash(type, GameID) {

                if (type == 1) {

                    var page = layer.open({
                        type: 2,
                        title: '{{ __('auto.总茶叶') }}',
                        shadeClose: true,
                        offset: 't',
                        shade: 0.8,
                        area: ['70%', '80%'],
                        content: "/admin/withdrawal/list?GameID=" + GameID + "&state=2&isEmpty=1",
                    })

                } else {
                    var page = layer.open({
                        type: 2,
                        title: '{{ __('auto.今日茶叶') }}',
                        shadeClose: true,
                        offset: 't',
                        shade: 0.8,
                        area: ['70%', '80%'],
                        content: "/admin/withdrawal/list?GameID=" + GameID + "&state=2&isEmpty=2",
                    })
                }
            }

            function logonIp(IP) {
                var page = layer.open({
                    type: 2,
                    title: '{{ __('auto.关联登录') }}IP',
                    shadeClose: true,
                    offset: 't',
                    shade: 0.8,
                    area: ['70%', '80%'],
                    content: "/admin/global/join?id=4&LastLogonIP=" + IP,
                })
            }

            function dk_refresh() {

                $.ajax({
                    type: "post",
                    url: "/admin/global/dk_userlist",
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    data: that.data_obj,
                    success: function (msg) {

                        if (msg) {
                            $(".main-panel").html(msg)

                        }
                    }
                })

            }


            function onlcick_hidden1(val, obj) {
                obj.style.display = "none";
                console.log(val)
                var aDiv = document.getElementsByClassName("hidden_td" + val);

                for (var i = 0; i < aDiv.length; i++) {
                    //遍历 aDiv的中所有元素并且将所有class为“test”的元素的字体颜色设置为“red”
                    aDiv[i].style.display = "none";
                }
                ;
            }

            function show_control_log(id) {
                var page = layer.open({
                    type: 2,
                    title: '{{ __('auto.单控记录') }}',
                    shadeClose: true,
                    shade: 0.8,
                    area: ['60%', '70%'],
                    content: '/admin/control/show_control_log/' + id,
                });
            }

            function update_label(id) {
                var page = layer.open({
                    type: 2,
                    title: '{{ __('auto.修改标签') }}',
                    shadeClose: true,
                    shade: 0.8,
                    area: ['40%', '70%'],
                    content: '/admin/global/update_label/' + id,
                    end: function (layero, index) {
                        window.location.href = "/admin/global/dk_userlist?GameID={{$GameID}}&Channel={{$Channel}}&UserScoreControl={{$UserScoreControl}}&SpreaderID={{$SpreaderID}}&label={{$user_label}}&NickName={{$NickName}}&game_room={{$game_room}}&is_line={{$is_line}}&start_time={{$start_time}}&end_time={{$end_time}}&ChangeScore={{$ChangeScoreSort}}&sort_tx={{$sort_tx}}&sort_date={{$sort_date}}&label_sort={{$label_sort}}&amount={{$amountSort}}&Score={{$ScoreSort}}&page={{$page}}";
                        $.ajax({
                            type: "post",
                            url: "/admin/global/dk_userlist",
                            headers: {
                                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                            },
                            data: that.data_obj,
                            success: function (msg) {

                                if (msg) {
                                    $(".main-panel").html(msg)

                                }
                            }
                        })
                    },
                });
            }


            function remarks(obj, id) {
                remark = $(obj).html();
                myRequest("/admin/global/remarks/" + id, "post", {remark}, function (res) {
                    layer.msg(res.msg)

                });
            }

            function start_times() {

                getFormat('00', '00', '00');

                document.getElementById("start_time").value = format
            }

            function end_times() {
                getFormat('23', '59', '59');
                document.getElementById("end_time").value = format
            }

            function refreshArea(_formWin){
                var _formWinObj = $("#layui-layer"+_formWin);
                var w = _formWinObj.outerWidth();
                var h = _formWinObj.outerHeight();
                var l = ($(document).width()-w)/2.5;
                var t = ($(window).height()-h)/2;
                _formWinObj.css({
                    "left":l,
                    "top":t
                });
            }

            function update(id) {


                var page = layer.open({
                    type: 2,
                    title: '{{ __('auto.修改配置') }}',
                    shadeClose: true,
                    shade: 0.8,
                    offset:'180px',
                    scrollbar: false,
                    maxmin: true, //开启最大化最小化按钮
                    area: ['70%', '60%'],
                    fixed:false,
                    content: '/admin/global/dk_userlist_edit?UserID=' + id,

                end: function (layero, index) {
                        $.ajax({
                            type: "post",
                            url: "/admin/global/dk_userlist",
                            headers: {
                                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                            },
                            data: that.data_obj,
                            success: function (msg) {

                                if (msg) {
                                    $(".main-panel").html(msg)

                                }
                            }
                        })
                    },
                });
            }

            function del(id) {
                myConfirm("{{ __('auto.删除操作不可逆,是否继续') }}?", function () {
                    myRequest("/admin/accusation/del/" + id, "post", {}, function (res) {
                        layer.msg(res.msg)
                        setTimeout(function () {
                            window.location.href = "/admin/global/dk_userlist?GameID={{$GameID}}&Channel={{$Channel}}&UserScoreControl={{$UserScoreControl}}&SpreaderID={{$SpreaderID}}&label={{$user_label}}&label_sort={{$label_sort}}&NickName={{$NickName}}&game_room={{$game_room}}&is_line={{$is_line}}&start_time={{$start_time}}&end_time={{$end_time}}&ChangeScore={{$ChangeScoreSort}}&sort_tx={{$sort_tx}}&sort_date={{$sort_date}}&amount={{$amountSort}}&Score={{$ScoreSort}}&page={{$page}}";
                        }, 1500)
                    });
                });
            }

            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 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);
                myConfirm("{{ __('auto.是否继续账户操作') }}?", function () {
                    myRequest("/admin/global/ban", "post", {id: id, ban: ban}, function (res) {
                        layer.msg(res.msg)
                        setTimeout(function () {
                            window.location.reload();
                        }, 1500)
                    });
                });
                return false;
            }

            var that = this

            function userLabel(obj, val) {

                if (val == 'asc') {
                    $(".user_label svg:eq(1)").children('path').attr('fill', '#707071');
                    $(obj).children('path').attr('fill', 'red')

                } else {
                    $(obj).children('path').attr('fill', 'red')
                    $(".user_label svg:eq(0)").children('path').attr('fill', '#707071');
                }

                that.data_obj.label_sort = val
                that.data_obj.ServerNameSort = null
                that.data_obj.Score = null
                that.data_obj.ChangeScore = null
                that.data_obj.amount = null
                that.data_obj.sort_tx = null
                that.data_obj.sort_date = null

                $.ajax({
                    type: "post",
                    url: "/admin/global/dk_userlist",
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    data: that.data_obj,
                    success: function (msg) {

                        if (msg) {
                            $(".main-panel").html(msg)

                        }
                    }
                })
            }
            function ServerNameSort(obj, val) {

                if (val == 'asc') {
                    $(".ServerNameSort svg:eq(1)").children('path').attr('fill', '#707071');
                    $(obj).children('path').attr('fill', 'red')

                } else {
                    $(obj).children('path').attr('fill', 'red')
                    $(".ServerNameSort svg:eq(0)").children('path').attr('fill', '#707071');
                }

                that.data_obj.label_sort = null
                that.data_obj.ServerNameSort = val
                that.data_obj.Score = null
                that.data_obj.ChangeScore = null
                that.data_obj.amount = null
                that.data_obj.sort_tx = null
                that.data_obj.sort_date = null

                $.ajax({
                    type: "post",
                    url: "/admin/global/dk_userlist",
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    data: that.data_obj,
                    success: function (msg) {

                        if (msg) {
                            $(".main-panel").html(msg)

                        }
                    }
                })
            }

            function sort_money_func(obj, val) {

                if (val == 'asc') {
                    $(".sort_money svg:eq(1)").children('path').attr('fill', '#707071');
                    $(obj).children('path').attr('fill', 'red')

                } else {
                    $(obj).children('path').attr('fill', 'red')
                    $(".sort_money svg:eq(0)").children('path').attr('fill', '#707071');
                }

                that.data_obj.label_sort = null
                that.data_obj.ServerNameSort = null
                that.data_obj.Score = val
                that.data_obj.ChangeScore = null
                that.data_obj.amount = null
                that.data_obj.sort_tx = null
                that.data_obj.sort_date = null

                $.ajax({
                    type: "post",
                    url: "/admin/global/dk_userlist",
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    data: that.data_obj,
                    success: function (msg) {

                        if (msg) {
                            $(".main-panel").html(msg)

                        }
                    }
                })
            }

            function ChangeScore_func(obj, val) {

                if (val == 'asc') {
                    $(".ChangeScore svg:eq(1)").children('path').attr('fill', '#707071');
                    $(obj).children('path').attr('fill', 'red')

                } else {
                    $(obj).children('path').attr('fill', 'red')
                    $(".ChangeScore svg:eq(0)").children('path').attr('fill', '#707071');
                }

                that.data_obj.label_sort = null
                that.data_obj.ServerNameSort = null
                that.data_obj.Score = null
                that.data_obj.ChangeScore = val
                that.data_obj.amount = null
                that.data_obj.sort_tx = null
                that.data_obj.sort_date = null

                $.ajax({
                    type: "post",
                    url: "/admin/global/dk_userlist",
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    data: that.data_obj,
                    success: function (msg) {
                        if (msg) {
                            $(".main-panel").html(msg)

                        }
                    }
                })
            }

            function sort_cz_func(obj, val) {

                if (val == 'asc') {
                    $(".sort_cz svg:eq(1)").children('path').attr('fill', '#707071');
                    $(obj).children('path').attr('fill', 'red')

                } else {
                    $(obj).children('path').attr('fill', 'red')
                    $(".sort_cz svg:eq(0)").children('path').attr('fill', '#707071');
                }

                that.data_obj.label_sort = null
                that.data_obj.ServerNameSort = null
                that.data_obj.Score = null
                that.data_obj.ChangeScore = null
                that.data_obj.amount = val
                that.data_obj.sort_tx = null
                that.data_obj.sort_date = null

                $.ajax({
                    type: "post",
                    url: "/admin/global/dk_userlist",
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    data: that.data_obj,
                    success: function (msg) {

                        if (msg) {
                            $(".main-panel").html(msg)

                        }
                    }
                })
            }

            function sort_tx_func(obj, val) {

                if (val == 'asc') {
                    $(obj).children('path').attr('fill', 'red')
                    $(".sort_tx svg:eq(1)").children('path').attr('fill', '#707071');

                } else {
                    $(".sort_tx svg:eq(0)").children('path').attr('fill', '#707071');
                    $(obj).children('path').attr('fill', 'red')
                }

                that.data_obj.label_sort = null
                that.data_obj.ServerNameSort = null
                that.data_obj.Score = null
                that.data_obj.ChangeScore = null
                that.data_obj.amount = null
                that.data_obj.sort_tx = val
                that.data_obj.sort_date = null

                $.ajax({
                    type: "post",
                    url: "/admin/global/dk_userlist",
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    data: that.data_obj,
                    success: function (msg) {

                        if (msg) {
                            $(".main-panel").html(msg)

                        }
                    }
                })
            }

            function sort_date_func(obj, val) {

                if (val == 'asc') {
                    $(obj).children('path').attr('fill', 'red')
                    $(".sort_date svg:eq(1)").children('path').attr('fill', '#707071');

                } else {
                    $(".sort_date svg:eq(0)").children('path').attr('fill', '#707071');
                    $(obj).children('path').attr('fill', 'red')
                }

                that.data_obj.label_sort = null
                that.data_obj.ServerNameSort = null
                that.data_obj.Score = null
                that.data_obj.ChangeScore = null
                that.data_obj.amount = null
                that.data_obj.sort_tx = null
                that.data_obj.sort_date = val

                $.ajax({
                    type: "post",
                    url: "/admin/global/dk_userlist",
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    data: that.data_obj,
                    success: function (msg) {

                        if (msg) {
                            $(".main-panel").html(msg)

                        }
                    }
                })
            }
        </script>
@endsection
