#include("_user_detail_layout.html")
#@user_detail_layout("member")

#define layout_script()
<script>
    function del(id) {
        if (confirm("确定要删除该会员吗？")){
           ajaxGet("#(CPATH)/admin/user/doMemberDel?id="+id)
        }
    }
</script>
#end

#define detail()

<div class="box-header with-border">
    <div class="row actionPanel">
        <div class="col-xs-12">
            <a href="javascript:;" class="btn btn-primary"
               data-opentype="layer"
               data-layer-content="#(CPATH)/admin/user/memberedit?userId=#(user.id)"
               data-layer-title="添加会员"
               data-layer-area="['60%', '80%']"
               data-layer-end="reload"
            >
                <i class="fa fa-fw fa-plus"></i> 添加会员
            </a>
            <button type="submit" id="batchDel" class="btn btn-default checkAction"> 批量删除</button>
        </div>
    </div>
</div>


<div class="box-body no-padding">
    <table class="table table-striped">
        <tbody>
        <tr>
            <th style="width: 25%">会员名称</th>
            <th style="">到期时间</th>
            <th style="">创建时间</th>
            <th style="width: 10%">来源</th>
            <th style="width: 15%">操作</th>
        </tr>

        #for(member : members ??)
        <tr class="jp-actiontr">
            <td>#(member.group.name ??)</td>
            <td>#date(member.duetime ??)</td>
            <td>#date(member.created ??)</td>
            <td>#(member.sourceStr)</td>
            <td>
                <a href="javascript:;"
                   data-opentype="layer"
                   data-layer-content="#(CPATH)/admin/user/memberedit?userId=#(user.id)&id=#(member.id)"
                   data-layer-title="添加会员"
                   data-layer-area="['60%', '80%']"
                   data-layer-end="reload">编辑</a>

                <a href="javascript:;"
                   data-opentype="layer"
                   data-layer-content="#(CPATH)/admin/user/memberRenewal?id=#(member.id)"
                   data-layer-title="添加会员"
                   data-layer-area="['60%', '80%']"
                   data-layer-end="reload">续期</a>

                <a href="javascript:;" onclick="del('#(member.id)')">删除</a>
            </td>
        </tr>
        #end


        </tbody>
    </table>
</div>

<div class="box-footer">
    <div class="row">
        <div class="col-sm-12">

        </div>
    </div>
</div>

#end

