@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>
                    {{$gameName}}{{ __('auto.小环节') }}
                </h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">{{$gameName}}{{ __('auto.小环节') }}</a></li>
                        <li class="breadcrumb-item active" aria-current="page">{{$gameName}}{{ __('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">{{$gameName}}{{ __('auto.小环节明细') }}</h4>
                            <form class="well form-inline margin-top-20" method="get" action='{{$action}}'>
                                <spen style="padding-left: 10px">{{ __('auto.房间类型：') }}</spen>

                                <select name="SortID" id="" class="form-control">
                                    @foreach($sortArr as $k => $v)
                                        <option value="{{$k}}" @if ($k == $SortID)
                                            selected
                                            @endif>{{$v}}</option>
                                    @endforeach
                                </select>

                                <spen style="padding-left: 10px">{{ __('auto.买入方式：') }}</spen>

                                <select name="Type" id="" class="form-control">
                                    @foreach($typeArr as $k => $v)
                                        <option value="{{$k}}" @if ($k == $Type)
                                            selected
                                            @endif>{{$v}}</option>
                                    @endforeach
                                </select>


                                <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="datetime-local" step="01" name="start_time" class="form-control" id="start_time" onclick="start_times()"
                                       value="{{$start_time}}"/>&nbsp;&nbsp;
                                <input type="datetime-local" step="01" name="end_time" class="form-control" id="end_time" onclick="end_times()"
                                       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/game_data/GateBuyRecord"
                                   class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.重置') }}</a>&nbsp;&nbsp;

                            </form>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>{{ __('auto.游戏') }}ID</th>
                                    <th>{{ __('auto.昵称') }}</th>
                                    <th>{{ __('auto.房间类型') }}</th>
                                    <th>{{ __('auto.底注') }}</th>
                                    <th>{{ __('auto.买入类型') }}</th>
                                    <th>{{ __('auto.买入金额') }}</th>
                                    <th>{{ __('auto.轮次') }}</th>
                                    <th>{{ __('auto.个控') }}</th>
                                    <th>{{ __('auto.输赢') }}</th>
                                    <th>{{ __('auto.时间') }}</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($list as $k=>$v)
                                    <tr>
                                        <td ><a href="/admin/global/id_find?UserID={{$v->UserID}}">
                                                {{$v->GameID}}
                                            </a></td>
                                        <td >
                                            {{ $v->NickName}}
                                        </td>

                                        <td >{{ $sortArr[$v->SortID]}}</td>
                                        <td >{{ $v->BuyBase}}</td>
                                        <td >{{ $typeArr[$v->Type]}}</td>
                                        <td >{{ $v->BuyScore }}</td>
                                        <td >{{ $v->GameLevel }}</td>
                                        <td >{{ $v->Control }}</td>

                                        <td ><span style="color: @if ($v->ChangeScore>0) green @else red @endif"  >{{ $v->ChangeScore }}</span></td>
                                        <td >{{ $v->CreateTime }}</td>
                                    </tr>
                                @endforeach
                                </tbody>
                                <tr>
                                    <td>{{ __('auto.总买入：') }}{{number_float($sumData->sumbuy/100)}} </td>
                                    <td>{{ __('auto.总输赢：') }}{{number_float($sumData->sumwin/100)}} </td>
                                </tr>
                            </table>
                            <div class="box-footer clearfix">
                                {{ __('auto.总共') }}
                                <b>{{ $list->appends([
    'GameID'=>$GameID,
    'start_time'=>$start_time,
    'end_time'=>$end_time,
    'SortID' => $SortID,
    'Type' => $Type

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

        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
        }

    </script>
@endsection
