📄 classmates.asp
字号:
<!--#INCLUDE file="inc/DB.INC" -->
<!--#INCLUDE FILE="char.asp" -->
<!-- #include file="inc/func.inc" -->
<%
userid=session("myuserid")
password=session("mypwd")
if isman(userid,password)=0 then
%>
<script>
alert("同志,你不是管理员,无权进入!");
parent.location.href="index.asp";
</script>
<%
else%>
<html>
<meta NAME=GENERATOR Content="text/html" CHARSET=GB2312>
<title>成员数据管理</title><head>
<link rel=stylesheet type=text/css href=jscs/css.CSS>
<script language="JavaScript" src="jscs/jsfun.js"></script>
</head>
<body bgcolor="#F2F8FF">
<%
sub alldelete()
sql="select id from [txluser]"
set rs=conn.execute(sql)
if rs.eof then
errmsg="操作失败!在线还没有任何成员!"
call error(errmsg,"javascript:history.back()")
exit sub
end if
i=0
do until rs.eof
call delmember(rs(0))
rs.movenext
i=i+1
loop
set rs=nothing
stitle="删除成员"
smsg="您已经成功的从在线中删除了"&i&"个成员!"
call success(stitle,smsg,"classmates.asp")
end sub
sub seldelete()
dim idlist,idarr,id
If request("id")="" then
Errmsg="请选择所要删除的成员!"
call error(errmsg,"javascript:history.back()")
exit sub
end if
idlist=request("id")
if instr(idlist,",")>0 then
idArr=split(idlist)
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call delmember(id)
next
else
call delmember(clng(idlist))
end if
stitle="删除成员"
smsg="您已经成功的从在线中删除了成员!"
call success(stitle,smsg,"classmates.asp")
End sub
sub delmember(id)
sql="delete from [txluser] where id="&cstr(id)
conn.execute sql
end sub
if request("action")="全部删除" then
call alldelete()
elseif request("action")="删除所选"then
call seldelete()
else
call showalbum()
end if
sub showalbum()
dim totalPages,currentPage
currentPage=request.querystring("page")
stats=ordername
%>
<form action="classmates.asp" method=post name=album>
<table width=90% bgcolor=#CED8CA cellspacing=0 border=0 align=center>
<tr>
<td>
<table cellpadding=5 cellspacing=1 border=0 width=100% bgcolor=#0099CC>
<tr bgcolor=#99CCFF>
<td colspan=4 valign=top width=350 align=center> >> <B>在线成员</B> <<
<font face=宋体> </font></td>
<td><div align=center>成员数:<%=allrec("txluser")%></div></td>
</tr>
<tr bgcolor=#D2E9FE>
<td align=center nowrap><b>姓名</b></td>
<td align=center nowrap><b>登录次数</b></td>
<td align=center nowrap><b>上次登录</b></td>
<td align=center nowrap><b>状态</b></td>
<td align=center nowrap><b>操作</b></td>
</tr>
<%
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="select id,truename,logcnt,logtime,manclass from [txluser] order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%>
<tr bgcolor=#99CCFF>
<td colspan=9> 目前还没有成员.</td>
</tr>
<%
else
rs.pagesize=20
totalpages=rs.pagecount
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 20
if rs.eof then exit for
%>
<tr bgcolor=#99CCFF>
<td align=center>
<%=rs("truename")%>
</td>
<td align=center>
<%=rs("logcnt")%>
</td>
<td align=center><%=rs("logtime")%></td>
<td align=center>
<%if rs("manclass")=0 then
manclass="成员"
else
manclass="管理员"
end if%>
<%=manclass%></td>
<td align=center>
<%if rs("manclass")=2 then
response.write "锁定"
else%>
<input type=checkbox name=id value=<%=rs("id")%>><%end if%></td>
</tr>
<%
rs.movenext
next
end if
rs.close
set rs=nothing
%>
<tr bgcolor=#D2E9FE><td colspan=5 align=right nowrap>
<input type=checkbox name=chkall value=on onclick="return CheckAll(album)">选中所有显示记录 <input type=submit name=action onclick="{if(confirm('确定删除选定的纪录吗?')){this.document.album.submit();return true;}return false;}" value="删除所选"> <!--<input type=submit name=action onclick="{if(confirm('确定清除所有的纪录吗?')){this.document.album.submit();return true;}return false;}" value="全部删除">-->
</td></tr>
</table>
</td></tr>
</table>
<table width=85% align="center" >
<tr><td align=right>
<% if currentpage=0 then currentpage=1
response.write "共 "&totalpages&" 页 第 "¤tpage&" 页 "
if currentpage=1 or totalpages=0 then
response.write "<font color=gray>首页 前页</font>"
else
response.write "<a href=?page=1&orders="&orders&">首页</a> <a href=?page="¤tpage-1&"&orders="&orders&">前页</a>"
end if
if currentpage=totalpages or totalpages=0 then
response.write " <font color=gray>后页 尾页</font>"
else
response.write " <a href=?page="¤tpage+1&"&orders="&orders&">后页</a> <a href=?page="&totalpages&"&orders="&orders&">尾页</a>"
end if
%>
<%
end sub
%>
</body>
</html>
<%end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -