<!--#INCLUDE FILE="conn.asp" -->
<!--#include file="Class_Checkuser.asp" -->
<!--#INCLUDE FILE="Class_Top.asp" -->

<%
locat="用户列表"
if membername="" then
  	errmsg=errmsg+"<br>"+"<li>您还没有<a href=Class_Login.asp><font color=red>登录或注册校友录</font></a>。"
	call top(1,1)
	call error("Information",errmsg)
	
	else
Call top(1,1)
%>
<br>
<table cellpadding=4 cellspacing=1 border=0 width=100% Class=TableBorder>
<tr Class=LightTableBody height=25> 
	<td colspan=6 width=350 valign=center>&nbsp;>> <B>校友录注册用户列表</B> <<</td>
	<td colspan=3 align=center>注册用户数：<%=UserNum%>人</td>
</tr>
<tr height=23> 
<th align=center><a href="?OrderBy=userid" title="按用户名排序">用户名</a>
<%if Request("OrderBy")="userid" Then Response.Write "&nbsp;<img src=images/sort.gif>"
response.write "</th><th align=center>Email</th><th align=center>主页</th>"&_
	"<th align=center>QQ</th><th align=center>短讯息</th><th align=center>"&_
	"<a href=""?OrderBy=point"" title=""按用户积分排序"">目前积分</a>"
if Request("OrderBy")="point" Then Response.Write "&nbsp;<img src=images/sort.gif>"
response.write "</th><th align=center><a href=""?OrderBy=regdate"" title=""按用户注册日期排序"">注册日期</a>"
if Request("OrderBy")="regdate" or Request("OrderBy")="" Then 
	Response.Write "&nbsp;<img src=images/sort.gif>"
end if
response.write "</th><th align=center><a href=""?OrderBy=visitcount"" title=""按访问校友录次数排序"">访问次数</a>"
if Request("OrderBy")="visitcount" Then Response.Write "&nbsp;<img src=images/sort.gif>"
response.write "</th><th align=center><a href=""?OrderBy=lastlogin"" title=""按最后登陆时间排序"">最后登陆时间</a>"
if Request("OrderBy")="lastlogin" Then Response.Write "&nbsp;<img src=images/sort.gif>"
response.write "</th></tr>"

Dim totalPages,currentPage
Dim rs,sql
Dim PageSize


if Request("OrderBy")="point" or Request("OrderBy")="regdate" or Request("OrderBy")="visitcount" or Request("OrderBy")="lastlogin" or Request("OrderBy")="userid" Then
	order=Request("OrderBy")
Else
	order="regdate"
End if

	sql="select userid,email,isemailshow,oicq,isoicqshow,homepage,ishomepageshow,point,visitcount,"&_
		"regdate,lastlogin from student where userid<>'' and userid is not null order by "&order&" desc"
Set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof Then
%>
<tr Class=DarkTableBody> 
	<td colspan=9>&nbsp;&nbsp;还没有任何注册用户数据。</td>
</tr></table><BR>
<%
Else

pagesize=20
rs.pagesize=pagesize
totalpages=rs.pagecount

currentPage=Request("page")
if currentpage="" Then currentpage=1
if not isNumeric(currentpage) Then
	currentpage=1
ElseIf Cint(currentpage)>totalpages Then
	currentpage=totalpages
End if
currentpage=Cint(currentpage)
rs.absolutepage=currentpage

for i=1 to pagesize

response.write "<tr Class=LightTableBody ><td >&nbsp;"&_
	"<a href=""Class_Userinfo.asp?name="&rs(0)&""" target=_blank title=""查看 "&rs(0)&" 的个人信息"">"&htmlencode(rs(0))&_
	"</a></td><td align=center>"

if not sysadmin and rs(2)=0 Then
	response.write "<img src=""images/passwd.gif"" title=""我的Email保密噢！"">"
Else
	response.write "<a href=""mailto:"&rs(1)&""" title=""给"&rs(0)&"发电子邮件"">"&_
	"<img border=0 src=""images/email.gif"" hspace=1></a>"
End if
response.write "</td><td align=center>"
if not sysadmin and rs(6)=0 Then
	response.write "<img src=""images/passwd.gif"" title=""我的主页保密噢！"">"
ElseIf rs(5)<>"" and rs(5)<>"http://" Then
	response.write "<a href="""&rs(5)&""" target=_blank title=""去看看"&rs(0)&"的主页"">"&_
	"<img border=0 src=images/homepage.gif width=16 height=16 hspace=1></a>"
Else
	Response.Write "-"
End if
response.write "</td><td align=center>"
if not sysadmin and rs(4)=0 Then
	response.write "<img src=images/passwd.gif alt=""我的QQ保密噢！"">"
ElseIf rs(3)<>"" Then
	response.write "<a href=""http://search.tencent.com/cgi-bin/friend/user_show_info?ln="&rs(3)&""" target=_blank title=""查看"&rs(0)&"的QQ["&rs(3)&"]资料"">"&_
	"<img src=images/oicq.gif border=0 width=16 height=16 hspace=1></a>"
Else
	Response.Write "-"
End if
response.write "</td><td align=center>"&_
	"<a href=""Class_UserSms.asp?Action=new&touser="&rs(0)&""" target=_blank title=""给"&rs(0)&"发短消息"">"&_
	"<img border=0 src=images/message.gif width=16 height=16 hspace=1></a></td>"&_
	"<td align=center>"&rs(7)&"</td>"&_
	"<td align=center>"&rs(9)&"</td>"&_
	"<td align=center>"&rs(8)&"</td>"&_
	"<td align=center width=120>"&formatdatetime(rs(10),vbShortDate)&"&nbsp;"&formatdatetime(rs(10),vbShortTime)&_
	"</td></tr>"
rs.movenext
if currentpage=totalpages then
	if rs.eof then exit for
end if

next

%>
</table>

<table width=100% align="center">
<tr><td align=left valign=center>
<% if currentpage=0 Then currentpage=1
if currentpage>1 Then
	Response.Write "　<a href=?page="&currentpage-1&"&OrderBy="&order&"><img src=images/left.gif border=0>&nbsp;上一页</a>"
End if
		
if currentpage<totalpages Then
	Response.Write "　<a href=?page="&currentpage+1&"&OrderBy="&order&"><img src=images/right.gif border=0>&nbsp;下一页</a>"
End if
response.write "</td><td align=right valign=center>"&_
"页次:"&currentpage&"/"&totalpages&"&nbsp;&nbsp;&nbsp;去第"&_
"<input type=hidden value="&order&" name=""orderby"">&nbsp;"%>
<input type=text name=targetPage size=2 style="height:16px;width:20px;">&nbsp;页</td>
<td width=15 align=right style="cursor:hand" onClick="document.location.href='Class_UserList.asp?OrderBy='+orderby.value+'&page='+targetPage.value;"><img src=images/btngo.gif width=13 height=15></td></tr></table>
<%
End if
rs.close
Set rs=Nothing
end if
Call footer%>

