#@layout()

#define script()
<script>

    function doDel(id) {
        ajaxGet("#(CPATH)/admin/finance/coupon/doRoleDel/" + id);
    }

    $("#batchDel").click(function () {
        var ids = getSelectedIds();
        if (ids == "") {
            alert('您未选择任何内容');
            return
        }
        ajaxGet("#(CPATH)/admin/finance/coupon/doRoleDelByIds?ids=" + ids);
    })


</script>
#end

#define content()
<div class="content-wrapper">

    <section class="content-header">
        <h1>
            优惠券领取列表
            <small>Coupon User List</small>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-xs-12">
                <div class="box box-primary">
                    <div class="box-header with-border">

                        <div class="row actionPanel">
                            <div class="col-xs-12">
                                <a href="coupon/edit" class="btn btn-primary ">
                                    <i class="fa fa-fw fa-plus"></i> 新建
                                </a>
                                <button type="submit" id="batchDel" class="btn btn-default checkAction"> 批量删除</button>
                            </div>
                        </div>

                    </div>
                    <!-- /.box-header -->
                    <div class="box-body ">

                        <table class="table table-striped">
                            <tbody>
                            <tr>
                                <th style="width: 10px">
                                    <input name="dataItem" onchange="checkAll(this)" type="checkbox"/>
                                </th>
                                <th style="width: 35%">名称</th>
                                <th style="width: 15%">优惠码</th>
                                <th style="width: 10%">用户</th>
                                <th style="width: 10%">有效期至</th>
                                <th style="width: 10%">状态</th>
                                <th style="width: 10%">领取时间</th>
                            </tr>
                            #for(coupon : page.list ??)
                            <tr class="jp-actiontr">
                                <td><input class="dataItem" type="checkbox" value="#(code.id)" />
                                </td>
                                <td>
                                    <strong>
                                        #(code.title ??)
                                    </strong>
                                </td>
                                <td>#(code.code ??)</td>
                                <td>#(code.user.nickname ??)</td>
                                <td>#(code.valid_time ??)</td>
                                <td>#(code.status ??)</td>
                                <td>#(code.created ??)</td>
                            </tr>
                            #end
                            </tbody>
                        </table>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <div class="row">
                            <div class="col-sm-12">
                                #@_paginate()
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.box -->
            </div>
        </div>

    </section>
</div>
#end
