<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="JuSNS.Web.system.user.index" %>

<!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>
<title id="ptitle" runat="server">会员管理</title>
<link href="../images/css/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="../../js/ajax.js"></script>
<script language="javascript" type="text/javascript" src="../../js/public.js"></script>

</head>
<body>
<table width="99%" border="0" align="center" cellpadding="5" cellspacing="1">
  <tr>
    <td width="120" align="center" valign="top">
        <div class="menu">
            <ul>
        	<%=this.GetSystemMenu(sort)%>
        	</ul>
      </div>
    </td>
    <td valign="top">
   <div class="navip">
    <span class="Blue"><a href="index.aspx">会员管理</a> <a href="index.aspx?s=5">正常会员</a> <a href="index.aspx?s=0">等待验证会员</a> <a href="index.aspx?s=2">未验证邮件会员</a> <a href="index.aspx?s=1">锁定会员</a> </span> 
   </div> 
   <div id="DivErr" runat="server"></div>
   <form id="form1" runat="server">
   <div id="mainbody">
            <asp:Repeater runat="server" ID="Rpt_UserList">
                <HeaderTemplate>
                    <table width="100%" border="0" cellpadding="3" cellspacing="1" class="maintable">
                        <tr class="maintablehead">
                            <td align="center" style="width: 6%;">
                                编号</td>
                            <td style="width: 10%;">
                                姓名</td>
                            <td style="width: 15%;">
                                邮箱
                            </td>
                            <td align="center" style="width: 12%;">
                                状态</td>
                            <td align="center" style="width: 8%;">
                                登录次数</td>
                                <td align="center" style="width: 15%;">
                                是否是推荐会员</td>
                            <td align="center" style="width: 8%;">
                                注册时间</td>
                            <td align="center" style="width: 20%;">
                                操作</td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="maintablelist">
                        <td align="center">
                            <%# DataBinder.Eval(Container.DataItem, "UserID")%>
                        </td>
                        <td>
                            <a href="../../user/?r=<%# DataBinder.Eval(Container.DataItem, "UserID")%>"><%# DataBinder.Eval(Container.DataItem, "UserName")%></a>
                        </td>
                        <td align="left">
                            <a href="../../user/?r=<%# DataBinder.Eval(Container.DataItem, "UserID")%>"><%# DataBinder.Eval(Container.DataItem, "Email")%></a>
                        </td>
                        <td align="center">
                            <font color="red"><%# DataBinder.Eval(Container.DataItem, "State")%></font>
                        </td>
                        <td align="center">
                            <%# DataBinder.Eval(Container.DataItem, "LoginTimes")%>
                        </td>
                        <td align="center">
                           <font color="red"><%# DataBinder.Eval(Container.DataItem, "Recommended")%></font> 
                        </td>
                        <td>
                            <%# Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "RegTime")).ToShortDateString()%>
                        </td>
                        <td align="center">
                            <a href="UserEdit.aspx?r=<%# DataBinder.Eval(Container.DataItem, "UserID")%>">编辑</a>|<a href="javascript:Recommended(<%# DataBinder.Eval(Container.DataItem, "UserID")%>,1,'<%=Request.QueryString["Page"] %>');">推荐</a>|<a href="javascript:Recommended(<%# DataBinder.Eval(Container.DataItem, "UserID")%>,2,'<%=Request.QueryString["Page"] %>');">取消推荐</a>|<a href="javascript:del(<%# DataBinder.Eval(Container.DataItem, "UserID")%>);">删</a>|<a href="adv.aspx?uid=<%# DataBinder.Eval(Container.DataItem, "UserID")%>&uName=<%# JuSNS.Common.Input.URLEncode(DataBinder.Eval(Container.DataItem, "UserName").ToString())%>">高级</a></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
            <div style="text-align:right;padding:10px;"><a href="javascript:delAll();">清空所有会员</a></div>
            <div class="pagination" runat="server" id="DivPage" align="center"></div>
            <table width="100%" border="0" cellpadding="3" cellspacing="1">
                <tr class="maintablepage">
                    <td>
                        <div align="center">
                            输入会员姓名或邮箱搜索你要找的会员
                            <asp:TextBox ID="Key" runat="server" Width="200"></asp:TextBox><asp:Button ID="Button1"
                                runat="server" Text=" 搜索 " OnClick="Button1_Click" /></div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
    </td>
  </tr>
</table>
</body>
</html>
<script language="javascript" type="text/javascript">
function del(id)
{
    if(confirm('你确认删除此会员吗?'))
        self.location="?Type=del&id="+id;
}
function delAll()
{
    if(confirm('你确认删除所有会员吗?此操作不可逆！'))
        self.location="?Type=delAll";
}
function Recommended(id,flag,p)
{
    var str="你确定要推荐此会员吗？";
    if(flag==2)
    {
        str="你确定要取消推荐次会员吗？";
    }
    if(confirm(str))
        self.location="?Type=Recommended&pg="+p+"&id="+id+"&flag="+flag;
}

</script>
