<link rel="stylesheet" href="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>public/plugins/datatables/jquery.dataTables.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>public/plugins/datatables/extensions/Responsive/css/dataTables.responsive.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="#/SystemMail/index">
                                        <span class="gap"></span>
                                        <div class="form-group">
                                                <label>开始时间: </label>
                                                <input type="text" class="form-control datetimepicker" value="<?php echo $stime ?? '';?>" placeholder="开始时间" name="create_stime" />
                                        </div>
                                        <span class="gap"></span>
                                        <div class="form-group">
                                                <label>结束时间: </label>
                                                <input type="text" class="form-control datetimepicker" value="<?php echo $etime ?? '';?>" placeholder="结束时间" name="create_etime" />
                                        </div>
                                        <span class="gap"></span>
                                        <button type="submit" class="btn btn-primary">查询</button>
                                        <a class="btn btn-primary" href="#/SystemMail/edit">添加</a>
                                    </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>系统邮件</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="table-responsive">
                                        <table class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th>ID</th>
                                                <th>Title</th>
                                                <th>展示天数</th>
                                                <th>玩家在线时间</th>
                                                <th>玩家等级区间</th>
                                                <th>玩家积分区间</th>
                                                <th>平台</th>
                                                <th>版本</th>
                                                <th>操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php
                                                if(is_array($list) && !empty($list)){
                                                    foreach ($list as $key => $val) {
                                            ?>
                                                <tr>
                                                    <td><?=$val['id'];?></td>
                                                    <td><?=$val['title'];?></td>
                                                    <td><?=$val['days']?></td>
                                                    <td><?=date('Y-m-d H:i:s', $val['online_start']);?>-<?=date('Y-m-d H:i:s', $val['online_end']);?></td>
                                                    <td><?=$val['level_start'];?>-<?=$val['level_end'];?></td>
                                                    <td><?=$val['score_start'];?>-<?=$val['score_end'];?></td>
                                                    <td><?=empty($val['sid'])?'全部':($val['sid'] == 1 ? '安卓':'苹果');?></td>
                                                    <td><?=(empty($val['version'])||$val['version'] == '0,0')?'所有':$val['version'];?></td>
                                                    <td><a href="#SystemMail/edit/<?php echo $val['id'];?>" class="btn btn-primary active" role="button">修改</a></th>
                                                </tr>
                                            <?php }} else{?>
                                                <tr>
                                                    <td colspan="10">暂无数据</td>
                                                </tr>
                                            <?php } ?>
                                            </tbody>
                                        </table>
                                    </div>
                                    <nav>
                                        <ul class="pagination">
                                            <li class="disabled"><a href="#">共<span 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>
<script src="<?php echo base_url();?>public/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url();?>public/plugins/datatables/extensions/Responsive/js/dataTables.responsive.min.js"></script>
