@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="post"
                                  action='/admin/group_control/record'>
                                <div>
                                    @csrf
                                    <span style="padding-left: 5px" >{{ __('auto.房间选择：') }}</span >
                                    <select class="form-control" name="server_id" value="" >
                                        <option value="">{{ __('auto.选择房间') }}</option>
                                        @foreach($room_list as $k=>$v)
                                            <option value="{{$v->ServerID}}" @if($v->ServerID==$server_id) selected @endif>{{$v->ServerName}}</option>
                                        @endforeach
                                    </select> &nbsp;&nbsp;

                                    <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/group_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.群控生效房间') }}</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->ServerName }}</td>
                                            <td>{{$v->stock}}</td>
                                            <td>{{$v->account}}</td>
                                            <td>{{$v->created_at}}</td>
                                            <td>
                                                <button type="button" class="btn btn-sm btn-facebook btn-icon-text" onclick="show({{$v->server_id}})">
                                                    {{ __('auto.查配置') }}
                                                </button>
                                            </td>


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


                                        '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 show(value) {
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.查看配置') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['50%', '60%'],
                content: '/admin/group_control/show_config/'+value
            });
        }


    </script>
@endsection
