@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-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/control/show_control_log/{{$user_id}}">
                                <div>
                                    @csrf

                                    <spen style="padding-left: 10px">{{ __('auto.单控生效时间：') }}</spen>
                                    <input type="date" step="01" name="start_time" id="start_time"
                                           class="form-control" value="{{$start_time}}"/>
                                    <input type="date" step="01" name="end_time" id='end_time'
                                           class="form-control" value="{{$end_time}}"/>
                                    <input type="submit" class="btn btn-sm btn-gradient-primary btn-icon-text"
                                           value="{{ __('auto.搜索') }}"/>&nbsp;&nbsp;
                                    <a href="/admin/control/record" 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 width="5%">{{ __('auto.被单控对象') }}ID</th>
                                        <th width="8%">{{ __('auto.被单控对象昵称') }}</th>
                                        <th width="8%">{{ __('auto.最后操作人') }}</th>
                                        <th width="8%">{{ __('auto.单控生效时间') }}</th>
                                        <th width="8%">{{ __('auto.单控生效内容') }}</th>
                                        <th width="8%">{{ __('auto.之前单控配置进度') }}</th>
                                        <th width="8%">{{ __('auto.单控用户余额') }}</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    @foreach($list as $k=>$v)
                                        <tr>
                                            <td>{{ $v->GameID }}</td>
                                            <td>{{$v->NickName}}</td>
                                            <td>{{$v->account}}</td>
                                            <td>{{$v->created_at}}</td>
                                            <td>{{$v->contents}}</td>
                                            <td>{{$v->before_config}}</td>
                                            <td>{{$v->score}}</td>

                                        </tr>
                                   @endforeach
                                    </tbody>
                                </table>
                            <div class="box-footer clearfix" id="pages">
                                {{ __('auto.总共') }} <b>{{ $list->appends([
                                        'list'=>$list,
                                        'user_id'=>$user_id,

                                        '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 switch_control(id,type){

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

        function update_region(id) {
            layer.open({
                type: 2,
                title: '{{ __('auto.修改开放地区') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['50%', '50%'],
                content: '/admin/channel/update/'+id
            });
        }


    </script>
@endsection
