⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 matesman.asp

📁 一路飞扬在线同学录单班级版,主要用于个人系统中的同学录,不过对于学习有帮助!
💻 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="Microsoft FrontPage 5.0" CHARSET=GB2312>
<title>成员状态管理</title><head>
<link rel=stylesheet type=text/css href=jscs/css.CSS>
</head>
<body bgcolor="#F2F8FF">
<%sub raise()
id=request("flag")
sql="update txluser set manclass=1 where id="&id
conn.execute(sql)
stitle="升级成员"
smsg="您已经成功升级了此成员!"
call success(stitle,smsg,"matesman.asp")
end sub%>
<%sub down()
id=request("flag")
sql="update txluser set manclass=0 where id="&id
response.write sql
conn.execute(sql)
stitle="降级成员"
smsg="您已经成功将此成员降级!"
call success(stitle,smsg,"matesman.asp")
end sub%>
<%

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

if request("action")="升级" then
	call raise()
end if

if request("action")="降级" then
	call down()
end if

sub showalbum()

	dim totalPages,currentPage
	currentPage=request.querystring("page")
	stats=ordername
%>

<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>&nbsp;>> <B>一路飞扬在线成员</B> <<
<font face=宋体>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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
%>
<form  action="matesman.asp" method=post name=getone><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>
<input type=hidden name=flag value="<%=rs("id")%>">
<%
if rs("manclass")=2 then
response.write "锁定"
else%>
<%if rs("manclass")=0 then%>
<input type=submit name=action value="升级"><%else%><input type=submit name=action  value="降级"><%end if%><%end if%>

</td>
</tr></form>
<%
rs.movenext
next
end if
rs.close
set rs=nothing
%>
<tr bgcolor=#D2E9FE><td colspan=5 align=right nowrap>
按“升级”或“降级”来改变成员状态</td></tr>
</table>
</td></tr>


</table></form>
<table width=85% align="center" >
<tr><td align=right>
<% if currentpage=0 then currentpage=1
response.write "共 "&totalpages&" 页 第 "&currentpage&" 页 "
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="&currentpage-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="&currentpage+1&"&orders="&orders&">后页</a> <a href=?page="&totalpages&"&orders="&orders&">尾页</a>"
		end if
%>


<%
end sub
%>
</table>

</body>
</html>
<%end if%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -