@extends('base.base')
@section('base')
    <!-- 内容区域 -->
<style type="text/css">
    .table th{
      padding: 0.8375rem;
      vertical-align: top;
      border-top: 1px solid #ebedf2;
    }
    .card{
        width: 100%;
        /*使用overflow-y:auto剪裁，详情请见w3cschool
            http://www.w3school.com.cn/cssref/pr_overflow-y.asp
        */
        overflow-y: auto;
    }
    .card table{
        width: 120%;
        border-collapse:collapse;
    }
    .card table tr{
        border-bottom: 0.01rem solid #B2B2B2;
    }
    .card table tr td span{
        width: 1.32rem;
        height: 0.18rem;
        display: run-in;
        background-color: red;

    }
</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="card-body">
                            <h4 class="card-title">{{ __('auto.游戏日志') }}</h4>
                            <form class="well form-inline margin-top-20" method="get" action='/admin/gold/game'>
                                <span style="padding-left: 5px" >{{ __('auto.游戏：') }}</span >
                                <select class="form-control" name="kind_id" value="{{$kind_id}}" id="select" onchange="gradeChange(this.options[this.options.selectedIndex].value)">
                                    <option value="">{{ __('auto.选择游戏') }}</option>
                                    @foreach($game_name as $k=>$v)
                                        <option value="{{$k}}" @if($k==$kind_id) selected @endif >{{$v}}</option>
                                    @endforeach
                                </select>
                                <span style="padding-left: 5px" >{{ __('auto.房间：') }}</span >
                                <select class="form-control" name="game_level" value="" id="game_level">
                                    <option value="">{{ __('auto.选择房间') }}</option>
                                    @foreach($room_list as $k=>$v)
                                        <option value="{{$v->ServerID}}" @if($v->ServerID==$game_level) selected @endif>{{$v->ServerName}}</option>
                                    @endforeach
                                </select> &nbsp;&nbsp;
                                <spen style="padding-left: 10px" >{{ __('auto.选择时间：') }}</spen>
                                <input type="date"  step="01" name="start_time" class="form-control" value="{{$start_time}}" />&nbsp;&nbsp;
                                <input type="date"  step="01" name="end_time" class="form-control" value="{{$end_time}}" />&nbsp;&nbsp;
                                <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="{{ __('auto.搜索') }}"/>&nbsp;&nbsp;
                                <a href="/admin/gold/game" class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.清空') }}</a>&nbsp;&nbsp;
                                <a href="/admin/gold/game?excel=1&start_time={{$start_time}}&end_time={{$end_time}}&kind_id={{$kind_id}}&room_type={{$room_type}}" class="btn btn-sm btn-gradient-light btn-icon-text">{{ __('auto.导出') }}</a>
                            </form>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="6%">{{ __('auto.时间') }}</th>
                                    <th width="4%">{{ __('auto.星期') }}</th>
                                    <th width="6%">{{ __('auto.游戏总局数') }}</th>
                                    <th width="6%">{{ __('auto.参游人次') }}</th>
                                    <th width="6%">{{ __('auto.人均局数') }}</th>
                                    <th width="6%">{{ __('auto.破产用户数') }}</th>
                                    <th width="6%">{{ __('auto.破产率') }}</th>
                                    <th width="6%">{{ __('auto.充值用户总局数') }}</th>
                                    <th width="6%">{{ __('auto.充值用户人均局数') }}</th>
                                    <th width="6%">{{ __('auto.登录用户携带金币量') }}</th>
                                    <th width="6%">{{ __('auto.付费用户携带金币量') }}</th>
                                    <th width="6%">{{ __('auto.总流水') }}</th>
                                    <th width="6%">{{ __('auto.总税收') }}</th>
                                    <th width="6%">{{ __('auto.人均流水') }}</th>
                                    <th width="6%">{{ __('auto.均局流水') }}</th>
                                    <th width="6%">{{ __('auto.机器人输赢') }}</th>
                                    <th width="6%">{{ __('auto.税收流水比') }}</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($list as $k=>$v)
                                    <tr>
                                        <td>{{ $v->RecordDate }}</td>
                                        <td>{{ $v->week }}</td>
                                        <td>{{ $v->PlayCount }}</td>
                                        <td>{{ $v->PlayersCount }}</td>
                                        <td>{{ $v->AverageCount }}</td>
                                        <td>{{ $v->BankruptcyPlayersCount}}</td>
                                        <td>{{ $v->BankruptcyRate}}</td>
                                        <td>{{ $v->PayPlayCount}}</td>
                                        <td>{{ $v->PayAverageCount}}</td>
                                        <td>{{ $v->AllLoginScore}}</td>
                                        <td>{{ $v->PayUserScore}}</td>
                                        <td>{{ $v->AllWorkingScore}}</td>
                                        <td>{{ $v->AllRevenue}}</td>
                                        <td>{{ $v->AverageUserScore}}</td>
                                        <td>{{ $v->AveragePlayScore}}</td>
                                        <td>{{ $v->AndroidScore}}</td>
                                        <td>{{ $v->Percentage}}</td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            <div class="box-footer clearfix">
                                {{ __('auto.总共') }} <b>{{ $list->appends(['start_time'=>$start_time,'end_time'=>$end_time,'kind_id'=>$kind_id,'room_type'=>$room_type])->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
                                {!! $list->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<script type="text/javascript">


    function gradeChange(value){
        console.log(value)
        myRequest("/admin/gold/roomlist","post",{'GameID':value},function(res){
            // layer.msg(res.msg)
            var data = res.data
            var html = ''
            for (var i of data){
                html += '<option value='+i['ServerID'] +'>'+i['ServerName']+'</option>'
            }
            $("#game_level").html(html)
        });
    }

</script>
    <script>
        // (function(doc, win) {
        //     var docEl = doc.documentElement,
        //         isIOS = navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
        //         dpr = isIOS ? Math.min(win.devicePixelRatio, 3) : 1,
        //         dpr = window.top === window.self ? dpr : 1, //被iframe引用时，禁止缩放
        //         dpr = 1,
        //         scale = 1 / dpr,
        //         resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
        //     docEl.dataset.dpr = dpr;
        //     var metaEl = doc.createElement('meta');
        //     metaEl.name = 'viewport';
        //     metaEl.content = 'initial-scale=' + scale + ',maximum-scale=' + scale + ', minimum-scale=' + scale;
        //     docEl.firstElementChild.appendChild(metaEl);
        //     var recalc = function() {
        //         var width = docEl.clientWidth;
        //         if (width / dpr > 750) {
        //             width = 750 * dpr;
        //         }
        //         // 乘以100，
        //         px : rem = 100 : 1
        //         docEl.style.fontSize = 100 * (width / 750) + 'px';
        //     };
        //     recalc()
        //     if (!doc.addEventListener) return;
        //     win.addEventListener(resizeEvt, recalc, false);
        // })(document, window);
    </script>
@endsection
