<!--#include file="conn.asp"-->
<!--#include file="ad_chk.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href=inc/css.css rel=STYLESHEET type=text/css>
<body topmargin="5" leftmargin="5" rightmargin="5" bottommargin="5">
<%
if Request.Cookies("WrzcNet")("admin_class")<>0 then
response.write "你没有这个权限!"
response.end
end if
%>
<%
if request("action")="deluser" then
set rs=server.createobject("adodb.recordset")
sql="select * from WrzcNet_user where id="&request("user_id")
rs.open sql,conn,1,3
if not rs.eof then
rs.delete
end if
rs.close
set rs=nothing
call deleok(delet,"ad_user.asp")
end if
%>
<p style="margin-top: 5px; margin-bottom: 5px">按等级管理：
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from WrzcNet_usertype",conn,1,1
i=0
do while not rs.eof
i=i+1%>
<a href=ad_user.asp?usertype_id=<%=rs("usertype_id")%>><%=rs("usertype_name")%></a> | 
<%
rs.movenext
loop
rs.close
set rs=nothing
%><a href=ad_user.asp>全部等级</a>
</p>
<table border="0" cellpadding="5" cellspacing="0" class="st">
<tr bgcolor="688cb8"><td align="center" class="sa">ID</td>
	<td align="center" class="sa">用户名</td>
	<td align="center" class="sa">E-mail</td>
	<td align="center" class="sa">注册时间</td>
	<td align="center" class="sa">类型</td>
	<td align="center" class="sa">积分</td>
	<td align="center" class="sa">订单</td>
	<td align="center" class="sa">删除</td></tr>
<%page=request.querystring("page")
if page="" then page=1
if not(isnumeric(page)) then page=1
if page<1 then page=1
page=int(page)


usertype_ID=request("usertype_id")
if usertype_ID="" then usertype_ID=0
if usertype_ID<>0 then
sera=" and user_type="&usertype_ID&""
showp=showp&"&usertype_id="&usertype_id
end if





set rs=server.createobject("adodb.recordset")
	if request("user_name")<>"" then
	user_name=request("user_name")
	showp=showp&"&user_name="&request("user_name")
	sql="select * from WrzcNet_user where username like '%"&user_name&"%' "&sera&" order by ID desc"
	else
	sql="select * from WrzcNet_user where 1=1 "&sera&" order by ID desc"
	end if
rs.open sql,conn,1,1
if rs.eof then
%><tr><td colspan="8" bordercolor="#F0F0F0">暂且没有任何用户注册</td></tr>
<%else
rs.pagesize=20
totalrec=rs.recordcount
totalpage=rs.pagecount
if page>totalpage then page=totalpage
rs.absolutepage=page
rs.cachesize=rs.pagesize
i=0
do while not rs.eof and (i<rs.pagesize)
i=i+1%>
<tr>
<td align="center" class="s<%=i mod 2%>"><%=rs("id")%></td>
<td align="center" class="s<%=i mod 2%>"><a href="ad_modify.asp?id=<%=rs("id")%>"><%=rs("username")%></a></td>
<td align="center" class="s<%=i mod 2%>"><a href="ad_dysend.asp?tmail=<%=rs("usermail")%>"><%=rs("usermail")%></a> <img border="0" src="Img/ad_help.gif" class="helpimg" alt="点击邮箱可以给用户发信"></td>
<td align="center" class="s<%=i mod 2%>"><%=right(year(rs("regtime")),2)%>-<%=month(rs("regtime"))%>-<%=day(rs("regtime"))%></td>
<td align="center" class="s<%=i mod 2%>"><%if rs("user_type")="" then
usertype_name="普通用户"
else
user_type=rs("user_type")
set rst=server.createobject("adodb.recordset")
sql="select * from WrzcNet_usertype where usertype_id="&user_type&""
rst.open sql,conn,1,1
if rst.eof then
usertype_name="普通用户"
else
usertype_name=rst("usertype_name")
end if
rst.close
set rst=nothing
end if%><%=usertype_name%></td>
<td align="center" class="s<%=i mod 2%>"><%=rs("savemoney")%></td>
<td align="center" class="s<%=i mod 2%>"><a href="ad_sub.asp?user_name=<%=rs("username")%>">查看订单</a><img border="0" src="Img/ad_help.gif" class="helpimg" alt="点击查看订单可以查看用户订单信息统计"></td>
<td align="center" class="s<%=i mod 2%>"><a href="ad_user.asp?user_id=<%=rs("id")%>&action=deluser" onClick="return confirm('您确定进行删除操作吗？')">删除</a></td></tr>
<%rs.movenext
loop
rs.close
set rs=nothing
i=i+1
%>
<tr><td colspan="8" class="s<%=i mod 2%>"> 
共<font color=red><%=totalpage%></font>页 第<%=page%>页 
<%if page-1>0 then%><a href="ad_user.asp?page=<%=page-1%><%=showp%>">上一页</a> <%else%>上一页 <%end if%>
<%if page+1<=totalpage then%><a href="ad_user.asp?page=<%=page+1%><%=showp%>">下一页</a> <%else%>下一页 <%end if%>
</td></tr></table><%end if%>
<br>
<table border="0" cellpadding="5" cellspacing="0" bgcolor="#F0F0F0"><form method="POST" action="ad_user.asp">
<tr><td>用户名查找：</td><td>
<input style="FONT-SIZE: 12px; WIDTH: 110px" type="text" name="user_name" size="15" class=input></td>
<td>
<select name="usertype_id" size="1"><option value="">全部等级</option>
<%set rsp=server.createobject("adodb.recordset")
sql="select * from WrzcNet_usertype order by usertype_id asc"
rsp.open sql,conn,1,1
do while not rsp.eof%>
<option value="<%=rsp("usertype_ID")%>" style="padding-left:20px;"<%if int(usertype_ID)=rsp("usertype_ID") then%> selected<%end if%>><%=rsp("usertype_name")%></option>
<% rsp.movenext
loop
rsp.close
set rsp=nothing%>
</select>
</td>

<td>
<input type="submit" name="imageField2" value="查询" ></td><td>
<img border="0" src="Img/ad_help.gif" class="helpimg" alt="按用户名模糊查询！"></td></tr></form></table>
<!--#include file="ad_bottom.asp"-->