<div class="content_wrapper">

    <div class="container-fluid">
        <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="btn-group" style="margin-bottom:20px;">
                                        <button type="button" class="btn btn-success goback">返回</button>
                                    </div>
                                    <div class="table-responsive">
                                        <table id="example" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th>名称</th>
                                                <th>创建时间</th>
                                                <th>操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php foreach($list as $v) { ?>
                                            <tr>
                                                <td><?php echo $v['ad_name'];?></td>
                                                <td><?php echo date('Y-m-d H:i:s', $v['ad_time']);?></td>
                                                <td><button type="button" class="btn btn-danger delad" adid=<?php echo $v['id'];?>>删除</button></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 type="text/javascript">
    //删除操作
    $('.delad').click(function(){
      if (confirm('确定删除吗?') == true) {
       var adId = $(this).attr('adid');
       $.post(
            "<?php echo base_url('advertiser/delAdver');?>",
            {adid:adId},
          );
       alert('删除成功');
       $(this).parent().parent().remove();
       //window.location.reload();
      }
    });

    $('.goback').click(function(){
        history.go('-1');
    });
</script>