<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Main.aspx.cs" Inherits="LMN.Web.Admin.Member.Main" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="../css/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>
</head>
<body>
<form id="form1" runat="server">
    <div style="padding: 20px;">
        <h4 class="title">用户管理<%-- <a href="HelpCategoryAdd.aspx">+<span>添加</span></a>--%></h4>
        <div class="division">
            <table>
                <thead>
                    <tr class="left">
                        <th class="chk"><input type="checkbox" id="all" name="all" value="true" /></th>
                        <th class="w60">姓名</th>
                        <th class="w120">手机</th>
                        <th class="w60">积分</th>
                        <th class="w60">金币</th>
                        <th class="w60">余额</th>
                        <th>会员等级</th>
                        <th class="w40">性别</th>
                        <th class="w60">QQ</th>
                        <th class="w160">邮箱</th>
                        <th class="w120">注册日期</th>
                        <th class="w40">状态</th>
                    </tr>
                </thead>
                <asp:Repeater ID="Repeater1" runat="server">
                    <ItemTemplate>
                        <tr>
                            <td><input type="checkbox" id="id_<%#Eval("id") %>" name="id" value="<%#Eval("id") %>"></td>
                            <td><%#Eval("name") %></td>
                            <td><a href="Edit.aspx?id=<%#Eval("id") %>"><%#Eval("mobile") %></a></td>
                            <td><%#Eval("score")%></td>
                            <td><%#Eval("gold")%></td>
                            <td><%#Eval("money")%></td>
                            <td><a href="Main.aspx?group=<%#Eval("group_id") %>"><%#Eval("group_name")%></td>
                            <td><%#Eval("sex") %></td>
                            <td><%#Eval("qq")%></td>
                            <td><%#Eval("email")%></td>
                            <td><%#Eval("regtime")%></td>
                            <td><%#Eval("islock")%></td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
                <tfoot>
                    <tr>
                        <td colspan="12"><input style="float: left;" type="button" id="dele" name="dele" value="批量删除" />
                            <div style="float: left; margin-left: 5px;">
                                <LMN:Pager ID="Pager1" runat="server" PageSize="20" CssClass="pager">
                                </LMN:Pager>
                            </div>
                        </td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>
</form>
<script type="text/javascript">
    $("#all").click(function() {
        var b = $(this).attr("checked");
        $("input[name=id]").each(function() {
            $(this).attr("checked", b);
        });
    });
    $("#dele").click(function() {
        if ($("input[name=id]:checked").length == 0) {
            showTips("请选择要删除的项！", 3);
            return false;
        }

        if (!confirm("确认删除选中的记录？"))
            return false;

        var ids = "";
        $("input[name=id]:checked").each(function() {
            ids += (ids == "" ? "" : ",") + $(this).val();
        });

        if (ids != "") {
            $.get("Action.aspx?action=userdelete&id=" + ids + "&" + new Date(), function(data) {
                if (data == "-1") {
                    alert("请选择要删除的记录！");
                } else if (data == "0") {
                    alert("删除失败，请重试！");
                } else {
                    alert("删除成功！");
                    location.reload();
                }
            });
        }
        return true;
    });
</script>
</body>
</html>
