<%
if title<>"" then
sql="select userid,username from [user] where username like '%"&trim(title)&"%' order by userid desc"
else
sql="select userid,username from [user] order by userid desc"
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "
还 没 有 任 何 用 户
"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
MaxAnnouncePerpage=Clng(MaxAnnouncePerpage)
if (currentpage-1)*MaxAnnouncePerPage>totalput then
if (totalPut mod MaxAnnouncePerPage)=0 then
currentpage= totalPut \ MaxAnnouncePerPage
else
currentpage= totalPut \ MaxAnnouncePerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxAnnouncePerPage,"admin_user.asp"
else
if (currentPage-1)*MaxAnnouncePerPage
<%
end sub
function showpage(totalnumber,MaxAnnouncePerPage,filename)
dim n
if totalnumber mod MaxAnnouncePerPage=0 then
n= totalnumber \ MaxAnnouncePerPage
else
n= totalnumber \ MaxAnnouncePerPage+1
end if
response.write " "
if CurrentPage<2 then
response.write "首页 上一页 "
else
response.write "首页 "
response.write "上一页 "
end if
if n-currentpage<1 then
response.write "下一页 尾页"
else
response.write ""
response.write "下一页 尾页"
end if
response.write " 页次:"&CurrentPage&"/"&n&"页 "
response.write " 共"&totalnumber&"个用户 "&MaxAnnouncePerPage&"个用户/页 "
end function
sub deleteannounce(id)
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="delete from [user] where userid="&cstr(id)
conn.execute sql
if err.Number<>0 then
err.clear
response.write "删 除 失 败 !
"
else
response.write "用户"&cstr(id)&"被删除了!
"
end if
End sub
%>