#@layout()

#define script()
<script>

    function doDel(id) {
        if (confirm("确定要删除该回复吗？删除后不可恢复")) {
            ajaxGet("#(CPATH)/admin/wechat/doDelReply/" + id);
        }
    }

    $("#batchDel").click(function () {
        var ids = getSelectedIds();
        if (ids == "") {
            alert('您未选择任何内容');
            return
        }
        if (confirm("确定要删除选中的内容吗？删除后不可恢复")) {
            ajaxGet("#(CPATH)/admin/wechat/doDelReplyByIds?ids=" + ids);
        }
    })


</script>

#end


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

    <section class="content-header">
        <h1>
            自动回复
            <small>Auto Reply Management</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">
                        <form class="form-horizontal actionPanel" action="#(CPATH)/admin/wechat/keyword" method="get">
                            <div class="row">
                                <div class="form-group col-lg-4">
                                    <label class="col-sm-3 control-label">关键字</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" name="keyword"
                                               value="#para('keyword')">
                                    </div>
                                </div>
                                <div class="form-group col-lg-4">
                                    <label class="col-sm-3 control-label">内容</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" name="content" value="#para('content')">
                                    </div>
                                </div>
                                <div class="form-group col-lg-4">
                                    <div class="col-sm-12">
                                        <button type="submit" class="btn btn-primary ">查询</button>
                                        <button type="reset" class="btn btn-default">重置</button>
                                    </div>
                                </div>
                            </div>
                            <!-- /.box-body -->
                        </form>

                        <div class="row actionPanel">
                            <div class="col-xs-12">
                                <a href="#(CPATH)/admin/wechat/keywordWrite" class="btn btn-primary "> <i
                                        class="fa fa-fw fa-plus"></i> 新建</a>
                                <button type="button" 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" value="0"/>
                                </th>
                                <th style="width: 450px">关键字</th>
                                <th style="width: 450px">回复类型</th>
                                <th>回复内容</th>
                                <th style="width: 100px">发布时间</th>
                            </tr>

                            #for(reply : page.list)
                            <tr class="jp-actiontr">
                                <td><input class="dataItem" type="checkbox" value="#(reply.id)" />
                                </td>
                                <td>
                                    <strong>
                                        <a href="#(CPATH)/admin/wechat/keywordWrite/#(reply.id)">
                                            #(reply.keyword ??)
                                        </a>
                                    </strong>
                                    <div class="jp-actionblock">
                                        <div class="jp-actionitem">
                                            <a href="#(CPATH)/admin/wechat/keywordWrite/#(reply.id)" >编辑</a> |
                                            <a href="javascript:;" onclick="doDel('#(reply.id??)')"
                                               style="color: #a00">删除</a>
                                        </div>
                                    </div>

                                </td>
                                <td>#(reply.replyTypeStr ??)</td>
                                <td>#(reply.showContent ??)</td>
                                <td>#(reply.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
