@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-wrench"></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/withdrawal/userWithdrawalStatistics'>

                                <span style="padding-left: 10px">{{ __('auto.会员ID：') }}</span>
                                <input class="form-control" type="text" name="GameID" style="width: 10%; "
                                       value="{{$gameID}}" placeholder="{{ __('auto.输入会员') }}ID">


                                <spen style="padding-left: 10px">{{ __('auto.选择时间：') }}</spen>
                                <input type="date" step="01" name="date" class="form-control" id="start_time"
                                       onclick="start_times()"
                                       value="{{$date}}"/>&nbsp;&nbsp;

                                <select name="Channel" id="" class="form-control">
                                    <option value="">{{ __('auto.请选择') }}</option>
                                    @foreach($channelList as $val)
                                        <option value="{{ $val }}" @if ($channel == $val)
                                            selected
                                        @endif>{{ $val }}</option>
                                    @endforeach
                                </select>

                                <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="{{ __('auto.搜索') }}"/>&nbsp;&nbsp;
                                <a href="/admin/withdrawal/userWithdrawalStatistics"
                                   class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.重置') }}</a>&nbsp;&nbsp;
                                <a href="/admin/withdrawal/userWithdrawalStatistics?GameID={{ $gameID }}&date={{ $date }}&Channel={{ $channel }}&excel=1"
                                   class="btn btn-sm btn-gradient-dark">{{ __('auto.导出') }}</a>&nbsp;&nbsp;

                            </form>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>{{ __('auto.排名') }}</th>
                                    <th>{{ __('auto.游戏') }}ID</th>
                                    <th>{{ __('auto.当日茶叶') }}</th>
                                    <th>{{ __('auto.当日咖啡') }}</th>
                                    <th>{{ __('auto.历史茶叶') }}</th>
                                    <th>{{ __('auto.历史咖啡') }}</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($list as $item)
                                    <tr>
                                        <td>{{ $loop->iteration }}</td>
                                        <td>
                                            <a href="/admin/global/id_find?UserID={{ $item->UserID }}">
                                                {{ $item->GameID }}
                                            </a>
                                        </td>
                                        <td>{{ $item->Withdraw }}</td>
                                        <td>{{ $item->Recharge }}</td>
                                        <td>{{ $item->HisWithdraw }}</td>
                                        <td>{{ $item->HisRecharge }}</td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            <div class="box-footer clearfix" id="pages">
                                {{ __('auto.总共') }} <b>{{ $list->appends([
'GameID' => $gameID,
'date' => $date
                                    ])->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
                                {!! $list->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>

    <script>

        function add() {
            layer.open({
                type: 2,
                title: '{{ __('auto.添加管理员') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['100%', '100%'],
                content: '/admin/administrator/add'
            });
        }

        function update(id) {
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.修改管理员') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['70%', '90%'],
                content: '/admin/administrator/update/' + id
            });
        }

        function del(id) {
            myConfirm("{{ __('auto.删除操作不可逆,是否继续') }}?", function () {
                myRequest("/admin/administrator/del/" + id, "post", {}, function (res) {
                    layer.msg(res.msg)
                    setTimeout(function () {
                        window.location.reload();
                    }, 1500)
                });
            });
        }

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

    </script>

@endsection
