{layout:default} {class:Shop.Admin.user.UserPoint}
<lbhead>
    <title><%=Tag("会员积分")%>-<%=Tag("会员管理")%>-<%=site.title%></title>
</lbhead>
<lbfile>
    <link href="<%=site.AdminAssetsPath %>/plugins/daterangepicker/daterangepicker.css" rel="stylesheet">
</lbfile>
<lbpath>
    <h3 class="text-themecolor m-b-0 m-t-0"><%=Tag("会员积分")%></h3>
    <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="<%=site.AdminPath %>/Ajax/ajax_admin.aspx?__Action=MenuJump&pid=0"><%=Tag("管理首页")%></a></li>
        <li class="breadcrumb-item"><a href="<%=site.AdminPath %>/user/default.aspx"><%=Tag("会员管理")%></a></li>
        <%if (user.UserName != ""){ %>
        <li class="breadcrumb-item"><a href="<%=site.AdminPath %>/user/UserPoint.aspx"><%=Tag("会员积分")%></a></li>
        <li class="breadcrumb-item active"><%=user.UserName%></li>
        <%}else{%>
        <li class="breadcrumb-item active"><%=Tag("会员积分")%></li>
        <%}%>
    </ol>
</lbpath>
<lbbody>
    <div class="col-12">
        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-3 m-b-10">
                        <div class="input-group">
                            <input type="text" id="key" name="key" value="<%=key %>" class="form-control" onkeydown="if(event.keyCode==13){search_();}">
                            <div class="input-group-append">
                                <button type="button" class="btn btn-primary" onclick="search_();"><i class="ti-search"></i></button>
                                <button class="btn btn-default" data-toggle="modal" data-target="#SearchModal"><i class="ti-filter"></i></button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="table-responsive">
                    <table class="table table-hover no-wrap">
                        <thead>
                            <tr>
                                <th>
                                    <%=Tag("会员帐号")%>
                                </th>
                                <th>
                                    <%=Tag("姓名")%>
                                </th>
                                <th>
                                    <%=Tag("积分")%>
                                </th>
                                <th>
                                    <%=Tag("状态")%>
                                </th>
                                <th>
                                    <%=Tag("描述")%>
                                </th>
                                <th>
                                    <%=Tag("时间")%>
                                </th>
                                <th>
                                    <%=Tag("管理员")%>
                                </th>
                                <th>
                                    <%=Tag("操作时间")%>
                                </th>
                                <th>
                                    <%=Tag("操作")%>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <%foreach (DB.LebiShop.Lebi_User_Point model in models){%>
                            <tr ondblclick="EditObj(<%=model.User_id+" ,"+ model.id %>);">
                                <td>
                                    <a href="?user_id=<%=model.User_id %>"><%=model.User_UserName %></a>
                                </td>
                                <td>
                                    <a href="?user_id=<%=model.User_id %>"><%=model.User_RealName%></a>
                                </td>
                                <td>
                                    <%=model.Point %>
                                </td>
                                <td>
                                    <%=Shop.Bussiness.EX_Type.TypeName(model.Type_id_PointStatus,CurrentLanguage.Code) %>
                                </td>
                                <td>
                                    <%=model.Remark %>
                                </td>
                                <td>
                                    <%=FormatTime(model.Time_Add) %>
                                </td>
                                <td>
                                    <%=model.Admin_UserName %>
                                </td>
                                <td>
                                    <%if (model.Admin_UserName != ""){%><%=FormatTime(model.Time_Update) %><%} %>
                                </td>
                                <td>
                                    <a href="javascript:void(0)" onclick="EditObj('<%=model.User_UserName%>',<%=model.id %>);"><%=Tag("编辑")%></a>
                                </td>
                            </tr>
                            <%} %>
                        </tbody>
                    </table>
                </div>
                <div class="row">
                    <div class="col-12">
                        <nav aria-label="Page navigation">
                            <%=PageString%>
                        </nav>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="SearchModal" tabindex="-1" role="dialog" aria-labelledby="SearchModal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title"><%=Tag("高级搜索")%></h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                </div>
                <div class="modal-body">
                    <form>
                        <div class="form-group">
                            <select name="status" id="status" class="form-control">
                                <option value="0"><%=Tag("状态")%></option>
                                <%=Shop.Bussiness.EX_Type.TypeOption("PointStatus", status,CurrentLanguage.Code)%>
                            </select>
                        </div>
                        <div class="form-group">
                            <div class="input-group">
                                <input type="text" name="daterange" id="daterange" class="form-control">
                                <div class="input-group-append">
                                    <span class="input-group-text">
                                        <span class="ti-calendar"></span>
                                    </span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <input name="key" type="text" id="key" class="form-control" value="<%=key %>" onkeydown="if(event.keyCode==13){modal_search_();}">
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><i class="ti-close"></i> <%=Tag("关闭")%></button>
                    <button type="button" class="btn btn-success" onclick="modal_search_();"><i class="ti-search"></i> <%=Tag("搜索")%></button>
                </div>
            </div>
        </div>
    </div>
</lbbody>
<lbscripts>
    {MOD:DateRangePicker}
    <script>
        function search_() {
            var key = $("#key").val();
            window.location = "?key=" + escape(key);
        }
        function modal_search_() {
            $("#SearchModal").modal("hide");
            var key = $("#key").val();
            var dateFrom = "";
            var dateTo = "";
            var daterange = $("#daterange").val();
            if (daterange.indexOf(" - ") >-1){
                dateFrom = daterange.split(" - ")[0];
                dateTo = daterange.split(" - ")[1];
            }
            var status = $("#status").val();
            window.location = "?key=" + escape(key) + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "&status=" + status;
        }
        function EditObj(User_Name,id) {
            var title_ = "<%=Tag("编辑积分")%>";
            if (id ==0)
                var title_ = "<%=Tag("添加积分")%>";
            $("#EditModal").modal("show");
            $.ajax({
                url: "userpoint_edit_window.aspx",
                type: "GET",
                cache: false,
                data: {User_Name:User_Name,id:id,title:title_},
            }).done(function(result){
                $("#EditModal .modal-content").html(result);
            });
        }
    </script>
</lbscripts>