<!--#include file="sd_mdb.asp"-->
<%
if session("User")="" then
	response.write"<SCRIPT language=JavaScript>alert('您尚未登录！');"
	response.write"location.href=""sd_admin_login.asp"";</SCRIPT>"
end if
%>
<%
	Set Rs=Server.CreateObject("adodb.recordSet")
	act=request.QueryString("act")
	id=request.QueryString("id")
	keyword=request.form("keyword")
	if keyword="" or keyword="输入用户名..." then 	keyword=request.QueryString("keyword")
	if act="del" then
		conn.execute("delete * from [sd_user] where sd_userid="&id)
		conn.execute("delete * from [sd_web] where sd_userid="&id&"")
		response.write"<SCRIPT language=JavaScript>alert('用户名删除成功！');"
		response.write"location='sd_index_users.asp';</SCRIPT>"	
	end if
%>
<html>
<head>
<TITLE>雨过天晴工作室 www.adminchn.com</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="images/Admin_css.css" type=text/css rel=stylesheet>
<script language="javascript" src="js/prototype.js"></script>
</head>
<body>
<table height="1" border="0" cellpadding="3" cellspacing="1" bgcolor="#F2F9E8" class="admintable1">
  <tr>
    <td colspan="8" class="admintitle">会员管理</td>
  </tr>
  <tr bgcolor="E8FBD1" align="center">
    <td width="8%" height="30">ID</td>
    <td width="15%">会员名</td>
    <td width="8%">网站数</td>
    <td width="12%">腾讯QQ</td>
    <td width="15%">Email</td>
    <td width="12%">金币</td>
    <td width="15%">更新时间</td>
    <td width="15%">操作</td>
  </tr>
<%
dim pagecount,page,Spage,Epage,recordcount,i
Const PAGESIZE=15
Const PARTSIZE=10
Const AboutSize=8

page = request.querystring("page")
if page = "" or IsNull(page) then page = 1
if not IsNumeric(page) then page = 1
page = Cint(page)
if act<>"search" then
	sql="select * from [sd_User] Order by sd_UserID DESC"
	rs.open sql,conn,1,1
else
	sql="select * from [sd_User] Order by sd_UserID DESC"
	rs.open sql,conn,1,1
	rs.filter = "sd_User like '%"&keyword&"%'"
end if
recordcount = RS.RecordCount
RS.PageSize = PAGESIZE
pagecount = RS.PageCount
if page < 1 then
    page = 1
elseif page > pagecount then
    page = pagecount
end if
if RS.EOF  then
    Response.Write("<tr><td height='30' colspan='8'><p align='center'>没有找到任何记录</p></td></tr>")
else
  if recordcount > 0 then RS.AbsolutePage = page
  for i=1 to PAGESIZE
  if RS.EOF then exit for
%>
  <tr align="center" <%If i/2=Cint(i/2) Then response.write "bgcolor=#F7FDEF" Else Response.write "bgcolor=#FFFFFF" End If %> >
   <td height="30"><%=rs("sd_userid")%></td>
   <td><%=rs("sd_user")%></td>
<%
idd=rs("sd_userid")
dim userweb
set rs1=conn.Execute("select count(*) from sd_Web where sd_userid="&idd&"")
userweb=rs1(0)
%>
   <td><%=userweb%></td>
   <td><a target=blank href=http://wpa.qq.com/msgrd?V=1&Uin=<%=rs("sd_QQ")%>&Site=站长助手&Menu=yes><%=rs("sd_qq")%></a></td>
   <td><%=rs("sd_email")%></td>
   <td><%=rs("sd_Points")%></td>
   <td><%=year(rs("sd_RegTime"))%>-<%=month(rs("sd_RegTime"))%>-<%=day(rs("sd_RegTime"))%></td>
   <td><a href="sd_user_edit.asp?id=<%=rs("sd_userid")%>">编辑</a>&nbsp;&nbsp; <a href="javascript:delrec('<%=rs("sd_userid")%>')">删除</a></td>
  </tr>
<%
	RS.MoveNext()
	next
end if
%>

<tr>
<td height="40" colspan="8">　
<%
if pagecount > 0 then
%><span class='black12'>共<span class='calendar_checked'><%=recordcount%></span>条信息&nbsp;&nbsp;|&nbsp;&nbsp;共有<span class='calendar_checked'><%=pagecount%></span>页&nbsp;&nbsp;|&nbsp;&nbsp;每页<span class='calendar_checked'><%=pagesize%></span>条记录&nbsp;&nbsp;|&nbsp;&nbsp;当前第<span class='calendar_checked'><%=page%></span>页</span>&nbsp;&nbsp;|&nbsp;&nbsp;
<%
if page>1 then
	if keyword<>"" and act="search" then %>
	<a href='sd_index_users.asp?page=1&act=search&keyword=<%=keyword%>' style="text-decoration: none"><font color="#009300">首页</font></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='sd_index_users.asp?act=search&keyword=<%=keyword%>&page=<%=page-1%>' style="text-decoration: none"><font color="#009300">上一页</font></a>&nbsp;&nbsp;|&nbsp;&nbsp;
	<%else%>
	<a href='sd_index_users.asp?page=1' style="text-decoration: none"><font color="#009300">首页</font></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='sd_index_users.asp?page=<%=page-1%>' style="text-decoration: none"><font color="#009300">上一页</font></a>&nbsp;&nbsp;|&nbsp;&nbsp;
	<%end if
else%>
首页&nbsp;&nbsp;|&nbsp;&nbsp;上一页&nbsp;&nbsp;|&nbsp;&nbsp;
<%end if
if pagecount>page then
	if keyword<>"" and act="search" then %>
		<a href='sd_index_users.asp?act=search&keyword=<%=keyword%>&page=<%=page+1%>' style="text-decoration: none"><font color="#009300">下一页</font></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='sd_index_users.asp?act=search&keyword=<%=keyword%>&page=<%=pagecount%>' style="text-decoration: none"><font color="#009300">尾页</font></a>
	<%else%>
		<a href='sd_index_users.asp?page=<%=page+1%>' style="text-decoration: none"><font color="#009300">下一页</font></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='sd_index_users.asp?page=<%=pagecount%>' style="text-decoration: none"><font color="#009300">尾页</font></a>
	<%end if
else%>
下一页&nbsp;&nbsp;|&nbsp;&nbsp;尾页
<%end if
end if
rs.close
set rs=nothing
%>
</td></tr>
<tr>
<td height="40" colspan="8" align='center'>
<form name="search" method="post" action="sd_index_users.asp?act=search">
模糊搜索：<input name="keyword" type="text" class="iptxt" value="输入用户名..." onClick="javascript:if(this.value='输入用户名...') this.value=''">&nbsp;&nbsp;
<input type="submit" onClick="sousuo()" value="搜索会员"/></form>
<SCRIPT language=Javascript>

	function delrec(code)
	{
		if (confirm("您确认要删除吗？该会员所属所有网站也将被删除！")==true)
		{
		window.location.href="sd_index_users.asp?act=del&id="+code
		}
	}

function sousuo()
{
	if($F('keyword')=='' || $F('keyword')=='输入用户名...'){
		alert('请输入你要搜索别名！');
		return false;
	}
	$("search").submit();
}
//-->
</script>
</td></tr>
</table>
<!--#include file="sd_copy.asp"-->
</body>
</html>