?? matesman.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> >> <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
%>
<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&" 頁 第 "¤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
%>
</table>
</body>
</html>
<%end if%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -