📄 admin_user.asp
字号:
<!--#include file="conn.asp"-->
<HEAD><TITLE>学生信息管理</TITLE>
<META http-equiv=Content-Language content=zh-cn>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="images/style.css" type=text/css rel=stylesheet>
<script language=javascript>
<!--
function CheckAll(form){
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked;
}
}
-->
</script>
</HEAD>
<BODY bgColor=#2f66bf >
<DIV align=center>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0
cellPadding=0 width=763 border=0>
<TBODY>
<TR>
<TD width="100%"><!--#include file="head.asp"--></TD></TR></TBODY></TABLE>
<TABLE dir=ltr cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=top>
<DIV align=center>
<TABLE height=830 cellSpacing=0 cellPadding=0 width=763 border=0>
<TBODY>
<TR>
<TD width=763 background=images/head_13.jpg height=15></TD></TR>
<TR>
<TD vAlign=top align=middle width=763
background=images/head_14.jpg height=49>
<TABLE id=AutoNumber3 style="BORDER-COLLAPSE: collapse"
borderColor=#111111 cellSpacing=0 cellPadding=0 width=763
border=0><TBODY>
<TR>
<TD width=11 rowSpan=4> </TD>
<TD width=741></TD>
<TD width=11 rowSpan=4> </TD></TR>
<TR>
<TD width=741></TD></TR>
<TR>
<TD width=741> </TD></TR>
<TR>
<TD width=741></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD width=763 background=images/head_16.jpg height=11></TD></TR>
<TR>
<TD width=763 background=images/head_11.jpg height=726>
<DIV align=center>
<TABLE id=table8 height="101%" cellSpacing=0 cellPadding=0
width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=top align=middle width=187>
<!-- #include file="left.asp" -->
</TD>
<TD vAlign=top>
<TABLE id=table9 height=30 cellSpacing=0 cellPadding=0
width=571 border=0>
<TBODY>
<TR>
<TD width=12 background=images/sousuo_1.jpg> </TD>
<TD width=115 background=images/sousuo_2.jpg>
<TABLE id=table12 height=18 cellSpacing=0 cellPadding=0
width="100%" border=0>
<TBODY>
<TR>
<TD vAlign=top><FONT color=#ffffff><SPAN
style="FONT-SIZE: 12px"> 学 生 搜
索</SPAN></FONT></TD></TR></TBODY></TABLE></TD>
<TD background=images/sousuo_2.jpg> </TD>
<TD vAlign=top width=133
background=images/sousuo_2.jpg>
<FORM style="MARGIN: 0px" name="form1" action="search.asp" method="post">
<TABLE cellSpacing=0 cellPadding=0 width=390 border=0>
<TBODY>
<TR>
<TD width=56></TD>
<TD vAlign=top width=144><SPAN lang=zh-cn>
<SELECT class=smallSel size=1 name="searchid">
<OPTION value="Userid" selected name="typeid">=按登陆学号=</OPTION>
<OPTION value="UserName" name="typeid">=按学生姓名=</OPTION>
<OPTION value="Sex" name="typeid">=按学生性别=</OPTION>
<OPTION value="Birthday" name="typeid">=按出生年月=</OPTION>
<OPTION value="Banji" name="typeid">=按学生班级=</OPTION>
</SELECT></SPAN>
</TD>
<TD vAlign=top width=113>
<input name="searchkey" type="text" onfocus="this.value=''" size="10" maxlength="10" value=关键字>
</TD>
<TD width=77><DIV align=center>
<INPUT type=image src="images/sousuo_4.jpg" border=0 name=Submit value="开始查找" onclick="return checkk();"></DIV></TD></TR></TBODY></TABLE></FORM></TD></TD>
<TD width=15
background=images/sousuo_5.jpg> </TD></TR></TBODY></TABLE>
<TABLE id=table15 height=131 cellSpacing=0 cellPadding=0
width=568 border=0>
<TBODY>
<TR>
<TD width=146 background=images/bjbg_1.jpg height=35>
<TABLE id=table16 height=20 cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD align=middle><FONT style="FONT-SIZE: 12px"
color=#ff0000>学生信息列表</FONT></TD></TR></TBODY>
</TABLE></TD>
<TD width=422 height=35><IMG height=35 src="images/bjbg_2.jpg" width=422 border=0></TD></TR>
<TR>
<TD align=middle width=568 background=images/bjbg_3.jpg colSpan=2>
<!--#include file="md5.asp"-->
<%if session("usertype")="2" then%>
<%
action=request("action")
if action="" then call user()
if action="useredit" then
if request("edit")="ok" then
call save()
else
call edit()
end if
end if
if action="del" then call userdel()
sub user()
%>
<table width="95%" border="1"style="border-collapse: collapse; border-style: dotted; border-width: 0px"bordercolor="#333333" cellspacing="0" cellpadding="2">
<form action=admin_user.asp method=post name=user>
<td colspan=7 class=td height=25><a href="admin_user.asp" target="_self">注册学生管理</a> <a href="admin_xy.asp" target="_self">注册协议管理</a> </td></tr>
<%
usersql=request.cookies("usersql")
if request("show")="yes" then
response.cookies("usersql")=""
end if
pages = 20
set rs=server.createobject("adodb.recordset")
sql="select * from [user] where UserNum is not null "
if request("show")<>"yes" then sql=sql+usersql
sql=sql+" order by SignDate desc"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.write "<tr><td colspan=7 align=center height=50>暂时没有学生</td></tr>"
response.end
else
totalrs=rs.RecordCount
rs.pageSize = pages
allPages = rs.pageCount
page = Request("page")
If not isNumeric(page) then page=1
if isEmpty(page) or int(page) <=1 then
page = 1
elseif int(page) > allPages then
page = allPages
end if
rs.AbsolutePage = page
%>
<tr>
<td align=center width=5%>选择</td>
<td align=center width='18%'>登陆学号</td>
<td align=center width='18%'>学生姓名</td>
<td align=center width='15%'>学生职位</td>
<td align=center width='16%'>注册日期</td>
<td align=center width='16%'>上次登陆</td>
<td align=center width='12%'>登陆次数</td>
</tr>
<% Do While Not rs.eof and pages>0
usertype=rs("usertype")
if usertype="2" then
usertype="管理员"
elseif usertype="3" then
usertype="班长"
elseif usertype="4" then
usertype="副班长"
elseif usertype="5" then
usertype="团支书"
elseif usertype="6" then
usertype="委员级别"
else
usertype="普通学生"
end if
%>
<tr><td><input type='checkbox' value='<%=rs("UserNum")%>' name=num></td>
<td><a href='admin_user.asp?action=useredit&id=<%=rs("UserId")%>'><%=rs("UserId")%></a></td>
<td><%=rs("UserName")%></td><td><%=usertype%></td>
<td><span alt="<%=rs("SignDate")%>"><%=split(rs("SignDate")," ")(0)%></span></td>
<td><span alt="<%=rs("lastlogin")%>"><%=split(rs("lastlogin")," ")(0)%></span></td>
<td align=center><%=rs("totallogin")%></td></tr>
<%
pages = pages - 1
rs.movenext
if rs.eof then exit do
loop
end if
%>
<tr><td colspan=7>
<input type='checkbox' name=chkall onclick='CheckAll(this.form)'>全选
<input type=hidden name=action value="del">
<input type=submit value="删除" onclick="{if(confirm('确认要删除选定的学生吗?')){this.document.user.submit();return true;}return false;}">
</td></tr>
</form>
</table>
<%
response.write "<br>总学生人数<font color=red>"&totalrs&"</font> 每页<font color=red>20</font> "
if page <= 1 then
response.write "<font color=darkgray>首页 前页</font>"
else
response.write "<a href=admin_user.asp?keywords="&keywords&"&page=1>首页</a> <a href=admin_user.asp?keywords="&keywords&"&page="&page-1&">前页</a>"
end if
if page = allpages then
response.write "<font color=darkgray> 下页 末页</font>"
else
response.write " <a href=admin_user.asp?keywords="&keywords&"&page="&page+1&">下页</a> <a href=admin_user.asp?keywords="&keywords&"&page="&allpages&">末页</a>"
end if
response.write " 第"&page&"页 共"&allpages&"页"
end sub
sub edit()
'修改学生资料
name=request("id")
set rs=conn.execute("select * from [user] where UserId='"&name&"'")
if rs.eof and rs.bof then
response.write "<script language='javascript'>"
response.write "alert('出错了,没有此学生。');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
usertype=rs("usertype")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -