<link rel="stylesheet" href="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css">
<script src="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
<script src="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<div class="content_wrapper">

    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <form class="form-inline" role="form" method="POST" action="#payment/vipuserList">
<!--                                        <span class="gap"></span>-->
<!--                                        <div class="form-group">-->
<!--                                                <label>开始时间: </label>-->
<!--                                                <input type="text" class="form-control datetimepicker" value="--><?php //if($stime) echo $stime;?><!--" placeholder="开始时间" name="payment_stime" />-->
<!--                                        </div>-->
                                        <span class="gap"></span>
                                        <div class="form-group">
                                                <label >时间  <span class="fa fa-question-circle "  data-toggle="tooltip" title="vip过期时间大于等于该时间"></span>: </label>
                                                <input type="text" class="form-control datetimepicker" value="<?php if($etime) echo $etime;?>" placeholder="结束时间" name="payment_etime" />
                                        </div>
                                        <span class="gap"></span>

                                        <button type="submit" class="btn btn-primary">查询</button>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>VIP用户汇总</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-4">
                                    <div class="table-responsive">
                                        <table id="exampleTotal" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th>VIP1</th>
                                                <th>VIP2</th>
                                                <th>VIP3</th>
                                                <th>VIP4</th>
                                                <th>VIP1(赠送VIP --大转盘或者后台加)</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                                <th ><a href="<?php echo base_url().'#payment/vipuserList/1'?>"><?php echo $list[1]['total'] ?? 0;?></a></th>
                                                <th ><a href="<?php echo base_url().'#payment/vipuserList/2'?>"><?php echo $list[2]['total'] ?? 0;?></a></th>
                                                <th ><a href="<?php echo base_url().'#payment/vipuserList/3'?>"><?php echo $list[3]['total'] ?? 0;?></a></th>
                                                <th ><a href="<?php echo base_url().'#payment/vipuserList/4'?>"><?php echo $list[4]['total'] ?? 0;?></a></th>
                                                <th ><a href="<?php echo base_url().'#payment/vipuserList/999'?>"><?php echo $list[999]['total'] ?? 0;?></a></th>
                                            </tr>

                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
        <div class="row <?php if($type <= 0){echo 'hide';}?>" >
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>VIP<?php echo $type;?>用户查询</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="table-responsive">
                                        <table id="example" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th>序号</th>
                                                <th>uid</th>
                                                <th>等级</th>
                                                <th>剩余天数</th>
                                                <th>更新时间</th>
                                                <th>到期时间</th>
                                            </tr>
                                            </thead>
                                            <tbody>

                                            <?php
                                            $vipList = $list[$type] ?? [];
                                            if(!empty($vipList)){
                                                unset($vipList['total']);//清楚掉总人数
                                                $num = 1;
                                                foreach ($vipList as $key => $val) {
                                                    ?>
                                                    <tr>
                                                        <td><?php echo $num++;?></td>
                                                        <td><a href="<?php echo base_url().'#user/index/'.$val['uid'];?>"><?php echo $val['uid'];?></a></td>
                                                        <td><?php echo 'VIP'.($val['type'] == 999 ? 1 : $val['type']);?></td>
                                                        <td><?php echo $val['days'];?></td>
                                                        <td><?php echo $val['updatetime'];?></td>
                                                        <td><?php echo $val['etime'];?></td>
                                                    </tr>
                                                <?php } } else{?>
                                                <tr>
                                                    <td colspan="10">暂无数据</td>
                                                </tr>
                                            <?php } ?>
                                            </tbody>
                                        </table>
                                    </div>
<!--                                    <nav>-->
<!--                                        <ul class="pagination">-->
<!--                                            <li class="disabled"><a href="#">共<span style="color:red;" class="pagetotal">--><?php //echo $total;?><!--</span>条</a></li>-->
<!--                                            --><?php //echo $pageurl;?>
<!--                                        </ul>-->
<!--                                    </nav>-->
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
    </div>

</div>

<script>
    //选择日期
    $('.datetimepicker').datepicker({
        language:'zh-CN',
        format:'yyyy-mm-dd',
        zIndexOffset:906  //控制z-index
    });
</script>