@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/recharge/record'>
                                <div>
                                    @csrf
                                    <spen style="padding-left: 10px" >{{ __('auto.会员ID：') }}</spen>
                                    <input class="form-control" type="text" name="GameID" id="GameID" value="{{$GameID}}" >
                                    <spen style="padding-left: 10px" >{{ __('auto.额度查询：') }}</spen>
                                    <input class="form-control" type="text" name="amount" id="GameID" value="{{$amount}}" >
                                    <spen style="padding-left: 10px" >{{ __('auto.额度筛选：') }}</spen>
                                    <select class="form-control" name="amount_search" value="" style="color: black">
                                        <option value="">{{ __('auto.全部') }}</option>

                                        <option value="100" @if ($amount_search == 100)
                                            selected
                                        @endif>100{{ __('auto.以下（不含100）') }}</option>

                                        <option value="500" @if ($amount_search == 500)
                                        selected
                                            @endif>100-500（{{ __('auto.含500）') }}</option>

                                        <option value="1000" @if ($amount_search == 1000)
                                        selected
                                            @endif>500-1000({{ __('auto.含1000）') }}</option>

                                        <option value="1001" @if ($amount_search == 1001)
                                        selected
                                            @endif>1000{{ __('auto.以上（不含') }}1000)</option>
                                    </select>

                                    <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="{{ __('auto.搜索') }}"/>&nbsp;&nbsp;
                                    <a href="/admin/recharge/record" style="color: white">
                                        <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text">
                                            {{ __('auto.重置') }}
                                        </button>
                                    </a>
                                    <br>
                                </div>


                            </form>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="6%">{{ __('auto.时间') }}</th>
                                    <th width="4%">{{ __('auto.收件人') }}ID</th>
                                    <th width="15%">{{ __('auto.标题') }}</th>
                                    <th width="6%">{{ __('auto.附件内容') }}</th>
                                    <th width="6%">{{ __('auto.文本内容') }}</th>

                                </tr>
                                </thead>
                                <tbody class="search_checkbox">
                                @foreach($list as $k=>$item)
                                    <tr>

                                        <td>{{$item->CreateTime}}</td>
                                        <td>{{$item->GameID}}</td>
                                        <td>{{$item->TitleString}}</td>
                                        <td>{{$item->BonusString}}</td>
                                        <td>{{$item->TextString}}</td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            <div class="box-footer clearfix" id = "pages">
                                {{ __('auto.总共') }} <b>{{ $list->appends([
                                         'list'=>$list,
                                        'GameID'=>$GameID,
                                        'amount_search'=>$amount_search,
                                        'amount'=>$amount,

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

        function update(id,type){
            if (id === 0){
                var num=document.getElementsByName('checkbox');

                var str='';
                for(var i=0;i<num.length;i++){
                    if(num[i].checked){
                        str=str+num[i].id+',';
                    }
                }

                if (str==''){
                    alert('{{ __('auto.请选择要操作的数据') }}');return false;
                }
               id =str.substr(0,str.length-1);
            }

            var page = layer.open({
                type: 2,
                title: '{{ __('auto.修改配置') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['70%', '90%'],
                content: '/admin/withdrawal/verify?ids='+id+'&type='+type
            });
        }

        function refuse(){
            var page = layer.open({
                type: 2,
                title: '{{ __('auto.修改配置') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['70%', '90%'],
                content: '/admin/withdrawal/verify'
            });
        }

        function checkbox(){
            var num=document.getElementsByName('checkbox');
            for(var i=0;i<num.length;i++){
                if(num[i].checked){
                    num[i].checked=false;
                }else{
                    num[i].checked=true;
                }
            }
        }

    </script>
@endsection
