@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/card/friends'>
                                {{ __('auto.亲友圈昵称：') }}
                                <input class="form-control" type="text" name="nick_name" style="width: 10%; " value="{{$nick_name}}" placeholder="{{ __('auto.请输入亲友圈昵称') }}">
                                <spen style="padding-left: 10px" >{{ __('auto.亲友圈ID：') }}</spen>
                                <input class="form-control" type="text" name="show_id" style="width: 10%; " value="{{$show_id}}" placeholder="{{ __('auto.输入亲友圈') }}ID">
                                <spen style="padding-left: 10px" >{{ __('auto.圈主姓名：') }}</spen>
                                <input class="form-control" type="text" name="name" style="width: 10%; " value="{{$name}}" placeholder="{{ __('auto.输入圈主姓名') }}">
                                <spen style="padding-left: 10px" >{{ __('auto.输入圈主游戏ID：') }}</spen>
                                <input class="form-control" type="text" name="game_id" style="width: 10%; " value="{{$game_id}}" placeholder="{{ __('auto.输入圈主游戏') }}ID">&nbsp;&nbsp;
                                <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="{{ __('auto.搜索') }}"/>&nbsp;&nbsp;
                                <a href="/admin/card/friends" class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.清空') }}</a>&nbsp;&nbsp;
                                <a href="/admin/card/friends?excel=1&nick_name={{$nick_name}}&show_id={{$show_id}}&name={{$name}}" 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="6%">{{ __('auto.亲友圈昵称') }}</th>
                                    <th width="4%">{{ __('auto.亲友圈') }}ID</th>
                                    <th width="6%">{{ __('auto.成员数') }}</th>
                                    <th width="6%">{{ __('auto.推广员姓名') }}</th>
                                    <th width="6%">{{ __('auto.推广员游戏昵称') }}</th>
                                    <th width="6%">{{ __('auto.推广员游戏') }}ID</th>
                                    <th width="6%">{{ __('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->CreateDate }}</td>
                                        <td>{{ $v->NickName }}</td>
                                        <td>{{ $v->ShowID }}</td>
                                        <td>{{ $v->count }}/{{ $v->NumberLimit}}</td>
                                        <td>{{ $v->Name }}</td>
                                        <td>{{ $v->GameName }}</td>
                                        <td>{{ $v->GameID }}</td>
                                        <td>{{ $v->WxAccount}}</td>
                                        <td>{{ $v->Mobile}}</td>
                                        <td>{{ $v->InsureScore}}</td>
                                        <td><button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="members({{ $v->ID }})">{{ __('auto.查看') }}</button></td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            <div class="box-footer clearfix">
                                {{ __('auto.总共') }} <b>{{ $list->appends(['nick_name'=>$nick_name,'show_id'=>$show_id,'name'=>$name,'game_id'=>$game_id])->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
                                {!! $list->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        function excel(id){
            myConfirm("{{ __('auto.处理操作不可逆,是否继续') }}?",function(){
                var start_time = document.getElementById("start_time").value;
                var end_time = document.getElementById("end_time").value;
                myRequest("/admin/card/statistics/0","get",{'start_time':start_time,'end_time':end_time,'excel':1},function(res){
                    layer.msg(res.msg)
                    setTimeout(function(){
                        window.location.reload();
                    },1500)
                });
            });
        }
        function del(id){
            myConfirm("{{ __('auto.删除操作不可逆,是否继续') }}?",function(){
                myRequest("/admin/accusation/del/"+id,"post",{},function(res){
                    layer.msg(res.msg)
                    setTimeout(function(){
                        window.location.reload();
                    },1500)
                });
            });
        }
        function members(id){
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.玩家列表') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['100%', '80%'],
                content: '/admin/card/friends/members/'+id
            });
        }
    </script>
@endsection
