<div class="content_wrapper">
<style>
    .btn-name {
        white-space: nowrap;
    }
</style>
    <div class="container-fluid">
        <div id="msg-tip"></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="btn-group" style="margin-bottom:20px;">
                                        <a class="btn btn-success" href="#events/add" role="button">添加漏斗</a>
                                    </div>
                                    <div class="table-responsive">
                                        <table id="example" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th>漏斗ID</th>
                                                <th>名称</th>
                                                <th>漏斗识别号</th>
                                                <th>操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php
                                            if(!empty($list)){
                                                foreach ($list['data'] as $key => $vl) { ?>
                                                    <tr>
                                                        <td><?php echo $vl['id'];?></td>
                                                        <td><?php echo $vl['name'];?></td>
                                                        <td><?php echo $vl['event_id']; ?></td>
                                                        <td>
                                                            <a href="#events/edit/<?php echo $vl['event_id'];?>" class="btn btn-primary active" role="button">编辑</a>
                                                            <button type="button" class="btn btn-danger" onclick="del(<?php echo $vl['id'];?>)">删除</button>
                                                        </td>
                                                    </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 src="<?php echo base_url();?>public/js/common.js"></script>
<script>
    function del(id) {
        console.log(id);
        var msg = "您真的确定要删除吗？\n\n请确认！";
        if (confirm(msg)==true){
            $.post(rootPath + 'events/delete',{
                id:id,
            },function (data) {
                window.location.reload();
            });
        }
    }

</script>