📄 clsadm_member.asp
字号:
<!--#INCLUDE FILE="conn.asp" -->
<!--#INCLUDE FILE="const.asp" -->
<!--#INCLUDE FILE="char.asp" -->
<!--#INCLUDE FILE="checkuser.asp" -->
<!--#INCLUDE FILE="theme.asp" -->
<html><head>
<title><%=SchoolmateName%>——成员管理</title>
<meta content="text/html; charset=gb2312" http-equiv="Content-Type">
<link href="txl.css" type="text/css" rel="stylesheet">
</head>
<body bgColor="<%=bodycolor%>" text="#000000">
<%
call isjoinclass(1)
call main()
call endconnection()
sub main()
bshowmsg=1
if isclassadmin(bshowmsg)=false then
exit sub
end if
if request("action")="deletemember" then
call manage()
elseif request("action")="handover" then
call handover()
elseif request("action")="通过审核" then
call passjoin()
elseif request("action")="禁止加入" then
call refusejoin()
else
call classmatelist()
end if
end sub
sub refusejoin()
on error resume next
passid=request("id")
if passid="" or isnull(passid) then
Errmsg=Errmsg+"<li>"+"请选择要进行操作的同学。"
call error(errmsg)
exit sub
end if
idlist=split(passid,",")
for i= 0 to ubound(idlist)
tmpsql="update [student] set classid=0,enyear='',status=false where studid="&clng(idlist(i))
conn.execute(tmpsql)
next
stitle="审核班级成员"
smsg="<br>"+"<li><b>你已经成功禁止所选同学加入到你们班级!"
response.write smsg
' call success(stitle,smsg)
if err then response.write err.description
end sub
sub passjoin()
on error resume next
passid=request("id")
if passid="" or isnull(passid) then
Errmsg=Errmsg+"<li>"+"请选择要通过审核的同学。"
call error(errmsg)
exit sub
end if
idlist=split(passid,",")
for i= 0 to ubound(idlist)
conn.execute("update [class] set studcount=studcount+1 where classid="&clsid)
conn.execute("update [student] set status=false,point=point+"&pJoinclass&" where studid="&clng(idlist(i)))
next
stitle="审核班级成员"
smsg="<br>"+"<li><b>恭喜您,成功将所选同学通过审核并加入到你们班级!"
response.write smsg
' call success(stitle,smsg)
if err then response.write err.description
end sub
sub classmatelist()
%>
<br><br>
<table cellpadding=0 cellspacing=0 border=0 width=400 bgcolor=<%=bodycolor%> align=center>
<tr>
<td>
<table cellpadding=6 cellspacing=1 border=0 width=100% bgcolor=<%=tablebordercolor%>>
<TBODY>
<TR align=middle bgcolor=<%=tabletitlecolor%>>
<TD height=24 colspan=4><b>班级成员管理
</b></TD></TR>
<%
sql="select userid,studid,realname from [student] where classid="&clsid&" and userid<>'"&membername&"'"
set rs=conn.execute(sql)
studcount=1
do until rs.eof
%>
<TR height=10 bgcolor=<%=tablebodycolor2%>>
<TD valign=center align=center><%=studcount%>
</TD> <TD valign=center align=center><%=htmlencode(rs("realname"))%>(<%=htmlencode(rs("userid"))%>)
</TD> <TD valign=center align=center><font color=blue><a href=clsadm_member.asp?action=deletemember&id=<%=cstr(rs("studid"))%>>剔出班级</a>
</TD><TD valign=center align=center><a href=clsadm_member.asp?action=handover&id=<%=cstr(rs("studid"))%>>移交大权</a>
</TD>
</TR>
<%rs.movenext
studcount=studcount+1
loop
set rs=nothing
%>
</TBODY></TABLE>
<BR>
<form action="clsadm_member.asp"><table cellpadding=6 cellspacing=1 border=0 width=100% bgcolor=<%=tablebordercolor%>>
<TBODY>
<TR align=middle bgcolor=<%=tabletitlecolor%>>
<TD height=24 colspan=3><b>管理未审核的同学
</b></TD></TR>
<%
sql="select userid,studid,realname from [student] where classid="&clsid&" and status=true and userid<>'"&membername&"'"
set rs=conn.execute(sql)
if rs.eof then
response.write "<tr bgcolor="&tablebodycolor2&"><td colspan=3>不存在没有审核的同学:(</td></tr>"
else
studcount=1
do until rs.eof
%>
<TR height=10 bgcolor=<%=tablebodycolor2%>>
<TD valign=center align=center><%=studcount%>
</TD> <TD valign=center align=center><%=htmlencode(rs("realname"))%>(<%=htmlencode(rs("userid"))%>)
</TD> <TD valign=center align=center><font color=blue><input type=checkbox name=id value=<%=cstr(rs("studid"))%>></a>
</TD>
</TR>
<%rs.movenext
studcount=studcount+1
loop
end if%>
<TR align=middle bgcolor=<%=tabletitlecolor%>>
<TD height=24 colspan=3 align=right><input type=submit name=action value="通过审核"> <input type=submit name=action value="禁止加入"></TD></TR>
</TBODY></TABLE></form>
</td></tr></table>
</body>
</html>
<%
end sub
sub manage()
delid=request.querystring("id")
if delid="" then
errmsg=errmsg+"<li>没有操作请求,你试图进行非法操作!"
call error(errmsg)
exit sub
end if
sql="update class set studcount=studcount-1 where classid="&clsid
conn.execute(sql)
sql="update student set classid=0,point=point+"&pExitClass&" where studid="&delid
conn.execute(sql)
sql="select realname from student where studid="&delid
set rs=conn.execute(sql)
call success("deletemember",rs(0))
end sub
sub handover()
toid=request.querystring("id")
if toid="" then
call errormsg()
set rs=nothing
call endconnection()
response.end
end if
sql="select userid,realname from student where studid="&toid
set rs=conn.execute(sql)
sql="update class set admin='"&rs("userid")&"' where classid="&clsid
conn.execute(sql)
sql="update student set isadmin=0,point=point+"&PResignAdmin&" where userid='"&membername&"'"
conn.execute(sql)
sql="update student set isadmin=1,point=point+"&pApplyAdmin&" where studid="&toid
conn.execute(sql)
call success("handover",rs("realname"))
end sub
sub success(action,byval studname)
%>
<br><br>
<table cellpadding=0 cellspacing=0 border=0 width=75% align=center bgcolor=<%=tablebordercolor%>>
<tr>
<td>
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<tr align="center">
<td width="100%" bgcolor=<%=tabletitlecolor%>>成功:班级成员管理</td>
</tr>
<tr align="center">
<td width="100%" bgcolor=<%=tablebodycolor2%>><br> 恭喜您,<%if action="deletemember" then%>您已经成功的将<font color=#cc0000><%=htmlencode(studname)%></font>从本班删除。<%elseif action="handover" then%>您已经成功的将班级管理员大权移交给<font color=#cc0000><%=htmlencode(studname)%></font>!<%end if%></b><br><br>
</td>
</tr>
<tr align="center">
<td width="100%" bgcolor=<%=tabletitlecolor%>>
<a href="javascript:history.go(-1)"> << 返回上一页</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
end sub
%>
<!--#INCLUDE FILE="footer.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -