@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/user/game/{{$user_id}}'>
                                <span style="padding-left: 10px" >{{ __('auto.游戏：') }}</span >
                                <select class="form-control" name="game" value="">
                                    <option value="">{{ __('auto.请选择游戏') }}</option>
                                    @foreach($game_name as $k=>$v)
                                        <option value="{{$k}}" @if($k==$game) selected @endif>{{$v}}</option>
                                    @endforeach
                                </select>
                                <span style="padding-left: 10px" >{{ __('auto.房间：') }}</span>
                                <select class="form-control" name="type" value="">
                                    <option value="">{{ __('auto.请选择房间') }}</option>
                                    @foreach($room_type as $key=>$val)
                                        <option value="{{$key}}" @if($key==$type) selected @endif>{{$val}}</option>
                                    @endforeach
                                </select>
                                <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/user/game/{{$user_id}}" class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.清空') }}</a>&nbsp;&nbsp;
                                <!-- <a href="/admin/user/list/{{$user_id}}" class="btn btn-sm btn-gradient-info btn-icon-text">返回</a> -->
                            </form>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>{{ __('auto.游戏时间') }}</th>
                                    <th>{{ __('auto.游戏名称') }}</th>
                                    <th>{{ __('auto.游戏房间') }}</th>
                                    <th>{{ __('auto.游戏时长') }}</th>
                                    <th>{{ __('auto.输赢金豆') }}</th>
                                    <th>{{ __('auto.服务费') }}</th>
                                </tr>
                                </thead>
                                <tbody>
                                <input style="width:20%;float:left;" class="form-control" type="text" value="{{$nick_name}}" disabled="disabled">
                                <input style="width:10%;float:left;" class="form-control" type="text" value="{{$game_id}}" disabled="disabled">
                                @foreach($list as $k=>$v)
                                    <tr>
                                        <td style="width: 13%">{{ $v->InsertTime }}</td>
                                        <td style="width: 10%">{{ $v->ServerName}}</td>
                                        <td style="width: 10%">{{ $v->SortID}}</td>
                                        <td style="width: 12%">{{ $v->PlayTimeCount}}</td>
                                        <td style="width: 10%">{{ $v->Score}}</td>
                                        <td style="width: 10%">{{ $v->Revenue}}</td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            <div class="box-footer clearfix">
                                {{ __('auto.总共') }} <b>{{ $list->appends(['game'=>$game,'type'=>$type,'start_time'=>$start_time,'end_time'=>$end_time])->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
                                {!! $list->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        function publish(id){
            myConfirm("{{ __('auto.是否继续') }}?",function(){
                var myselect=document.getElementById("state"+id);
                var index=myselect.selectedIndex;
                var data = {state:myselect.options[index].value}
                myRequest("/admin/shop/update/"+id,"post",data,function(res){
                    layer.msg(res.msg)
                    setTimeout(function(){
                        window.location.reload();
                    },1500)
                });
            });
        }

        $('.menu-switch').click(function(){
            id = $(this).attr('id');
            state = $(this).attr('state');
            if(state == "on"){
                $('.pid-'+id).hide();
                $(this).attr("state","off")
                $(this).removeClass('mdi-menu-down').addClass('mdi-menu-right');
            }else{
                $('.pid-'+id).show();
                $(this).attr("state","on")
                $(this).removeClass('mdi-menu-right').addClass('mdi-menu-down');
            }
        })
    </script>
@endsection
