<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="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>真实ID</th>
                                                <th>真实ID(ios)</th>
<!--                                                <th>最大次数</th>-->
                                                <th>奖品</th>
                                                <th>开关</th>
                                                <th>操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php
                                            if(!empty($list)){
                                                foreach ($list as $key => $vl) { ?>
                                                    <tr>
                                                        <td><?php echo $vl['id'];?></td>
                                                        <td><?php echo $vl['name'];?></td>
                                                        <td><?php echo $vl['trueId'];?></td>
                                                        <td><?php echo $vl['trueId_ios'];?></td>
<!--                                                        <td>--><?php //echo $vl['max']; ?><!--</td>-->
                                                        <td><?php echo $vl['reward'];?></td>
                                                        <td><?php echo $vl['status'] != 0 ?  '<span class="label label-success">开</span>' : '<span class="label label-default">关</span>';?></td>
                                                        <td>
                                                            <a href="#config/polymerizationEdit/<?php echo $vl['id'];?>" class="btn btn-primary active" role="button">编辑</a>
                                                        </td>
                                                    </tr>
                                                <?php }
                                            } else{?>
                                            <tr>
                                                <td colspan="10">暂无数据</td>
                                            </tr>
                                            <?php } ?>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
    </div>
</div>
<script src="<?php echo base_url();?>public/js/common.js"></script>
<script>
    $('#actionCache').click(function () {
        $.post("advertisement/cacheAction", {
            <?php foreach ($channel as $key=>$row){
                echo $key.":"."$('#{$key}').val(),";
            }?>
        }, function(data){
            window.location.reload();
        });
    });
</script>