<!--#include file="../Index_Setting.asp"-->
<%
MaxPerPage=20
dim OrderType
OrderType=Trim(request("OrderType"))
if OrderType="" then
	OrderType=1
else
	OrderType=Clng(OrderType)
end if
Cl.Path = Cl.lanstr(1) & "<a href='" & Cl.Web_info(4) & "'>" & Cl.Web_info(0) & "</a>&nbsp;&gt;&gt;&nbsp;用户列表"
Cl.Title= Cl.Web_info(1) & " >> 用户列表"
strFileName="List.asp?OrderType=" & OrderType
TempStr=Split(Template.html(6),"||")
TempStr(0)=Replace(TempStr(0),"{%showuserlist%}",ShowUserList())
if TotalPut>0 then
	TempStr(0)=Replace(TempStr(0),"{%showpage%}",Cl.ShowPage(strFileName,TotalPut,MaxPerPage,"个","用户"))
else
	TempStr(0)=Replace(TempStr(0),"{%showpage%}","")
end if

Response.write Cl.ReplaceAllFlag(TempStr(0))

'分页显示所有用户
Function ShowUserList()
	Dim rsUser,sqlUser
	select case OrderType
	case 1
		sqlUser="select * from " & Db.UserTable & " order by " & Db.UserDataNum & " desc"
	case 2
		sqlUser="select * from " & Db.UserTable & " order by " & Db.UserJoinDate & " desc"
	case 3
		sqlUser="select * from " & Db.UserTable & " order by UserID desc"
	end select
	set rsUser=server.createobject("adodb.recordset")
	OpenConn_U : rsUser.open sqlUser,Conn_U,1,1
	if rsUser.bof and rsUser.eof then
		TotalPut=0
		ShowUserList="<br><li>没有任何用户</li>"
	else
		TotalPut=rsUser.recordcount
		if (TotalPut mod MaxPerPage)=0 then
			TotalPages = TotalPut \ MaxPerPage
		else
			TotalPages = TotalPut \ MaxPerPage + 1
		end if
		if CurrentPage > TotalPages then CurrentPage=TotalPages
		if CurrentPage < 1 then CurrentPage=1
		rsUser.move (CurrentPage-1)*MaxPerPage
		Dim strTemp
		i=0
		strTemp= ""
		do while not rsUser.eof
			dim UserIM
			UserIM=split(rsUser(Db.UserIM),"|||")
			strTemp=strTemp & TempStr(2)
			strTemp=Replace(strTemp,"{%userid%}",rsUser("UserID"))
			strTemp=Replace(strTemp,"{%username%}",rsUser(Db.UserName))
			strTemp=Replace(strTemp,"{%usersex%}",Cl.GetUsersex(rsUser(Db.UserSex)))
			strTemp=Replace(strTemp,"{%useremail%}",rsUser(Db.UserEmail))
			strTemp=Replace(strTemp,"{%userqq%}",UserIM(1))
			strTemp=Replace(strTemp,"{%usermsn%}",UserIM(3))
			strTemp=Replace(strTemp,"{%userhomepage%}",UserIM(0))
			strTemp=Replace(strTemp,"{%userjoindage%}",rsUser(Db.UserJoinDate)&"")
			strTemp=Replace(strTemp,"{%userdatanum%}",rsUser(Db.UserDataNum))
			rsUser.movenext
			i=i+1
			if i>=MaxPerPage then exit do
		loop
		ShowUserList=Replace(TempStr(1),"{%userlist%}",strTemp)
	end if
	rsUser.close:set rsUser=Nothing
End Function
%>
<%
'===================================================
' CreateLive CMS Version 3.1
'							Powered by Aspoo.CoM
'===================================================
' Mail: aspoo@126.com, Info@aspoo.cn
' Q  Q: 3315263, 596197794
' Msn : aspoo@126.com, Clw866@hotmail.com
' Web : http://www.aspoo.com, http://www.aspoo.net
' Bbs : http://bbs.aspoo.com, http://bbs.aspoo.net
' Copyright (C) 2005 Aspoo.CoM All Rights Reserved.
'===================================================
%>