?? stud_manage.asp
字號:
<!-- #include file="cookies.asp" -->
<!-- #include file="conn/conn.asp" -->
<html>
<head>
<title>用戶管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#EEEEEE" text="#000000">
<div align="center">
<!-- #include file="button_t.asp" -->
</div>
<table width="760" border="0" align="center" bgcolor="#FFFFFF">
<form name="form1" method="post" action="stud_manage.asp">
<tr>
<td>
<font color="#0000FF">用戶分類:
<select name="lev" id="lev">
<option value="">所有用戶</option>
<option value="1">學生</option>
<option value="2">老師</option>
<option value="3">管理員</option>
</select>
<input type="hidden" name="type" value="fl">
班級:<input type="text" name="class" size="10" maxlength="10">
姓名:<input type="text" name="name" size="20" maxlength="20">
<input type="submit" name="Submit2" value="查詢"> </font>
<hr width="760">
</td>
</tr>
</form>
<tr>
<td>
<form name="form2" method="post" action="stud_del.asp">
<div align="right">編輯修改后請刷新</div>
<table width="750" border="0" align="center" bgcolor="#CCCCCC">
<tr>
<td width="80">
<div align="center">用戶名</div>
</td>
<td width="100">
<div align="center">姓名</div>
</td>
<td width="100">
<div align="center">學號</div>
</td>
<td width="120">
<div align="center">班級</div>
</td>
<td width="120">
<div align="center">性別</div>
</td>
<td width="100">
<div align="center">問題</div>
</td>
<td width="50">
<div align="center">答案</div>
</td>
<td width="50">
<div align="center">級別</div>
</td>
<td width="50">
<div align="center">刪除</div>
</td>
<td> </td>
</tr>
<%
'以下分頁顯示用戶信息列表
uname=trim(request.form("name"))
uclass=trim(request.form("class"))
lev=trim(request.form("lev"))
if request("page")="" then
page="1"
else
page=request("page")
end if
set rs=server.createobject("adodb.recordset")
if lev="" then
if uclass="" then
if uname="" then
sql="select * from student order by id desc"
else
sql="select * from student where name='"&trim(uname)&"' order by id desc"
end if
else
if uname="" then
sql="select * from student where class='"&trim(uclass)&"' order by id desc"
else
sql="select * from student where name='"&trim(uname)&"' and class='"&trim(uclass)&"' order by id desc"
end if
end if
else
if uclass="" then
if uname="" then
sql="select * from student where lev='"&trim(lev)&"' order by id desc"
else
sql="select * from student where name='"&trim(uname)&"' and lev='"&trim(lev)&"' order by id desc"
end if
else
if uname="" then
sql="select * from student where class='"&trim(uclass)&"' and lev='"&trim(lev)&"' order by id desc"
else
sql="select * from student where name='"&trim(uname)&"' and class='"&trim(uclass)&"' and lev='"&trim(lev)&"' order by id desc"
end if
end if
end if
rs.open sql,conn,1,1
if not rs.eof then
rs.pagesize=30
rs.Absolutepage=clng(page)
if cstr(page)=cstr(rs.PageCount) and (rs.RecordCount mod rs.PageSize <> 0) then
recend=rs.RecordCount mod rs.PageSize
else
recend=rs.PageSize
end if
if request("page")<>"" then
if fix(trim(request("page")))>rs.pagecount then
response.redirect "stud_manage.asp?page="&(request("page")-1)
end if
end if
for i=1 to recend
if i mod 2=1 then '動態顯示顏色
color="#f8f8f8"
else
color="#E4e4e4"
end if
%>
<tr bgcolor="<%=color%>">
<td width="80"><%=trim(rs("id"))%></td>
<td width="100"><%=trim(rs("name"))%></td>
<td width="100"><%=trim(rs("cid"))%></td>
<td width="120"><%=trim(rs("class"))%></td>
<td width="120"><%=trim(rs("sex"))%></td>
<td width="100"><%=trim(rs("question"))%></td>
<td width="100"><%=trim(rs("answer"))%></td>
<%if trim(rs("lev"))=1 then%>
<td width="100">學生</td>
<%elseif trim(rs("lev"))=2 then%>
<td width="100">老師</td>
<%else%>
<td width="100">管理員</td>
<%end if%>
<td width="50">
<div align="center">
<%if trim(rs("lev"))<>3 then%>
<input type="checkbox" name="id" value="<%=trim(rs("id"))%>">
<%end if%>
</div>
</td>
<td>
<input type="button" name="Submit4" value="編輯" onclick="window.open('stud_edit.asp?id=<%=trim(rs("id"))%>','intr','menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=1,resizable=0,width=530,height=500,top=80,left=100');return false;">
</td>
</tr>
<%
rs.movenext
next
%>
<tr>
<td width="80"> </td>
<td width="100"> </td>
<td width="100"> </td>
<td width="120"> </td>
<td width="120"> </td>
<td width="100"> </td>
<td width="120"> </td>
<td width="100"> </td>
<td width="50">
<div align="center">
<input type="submit" name="Submit3" value="刪除">
</div>
</td>
<td> </td>
</tr>
</table>
</form>
<table border="0" width="750" align="center" bgcolor="<%=tablebgcolor_2%>">
<tr>
<td>
<div align="left"><font color="#000000">共有考生記錄<%=rs.recordcount%>條,每頁30個,目前<%=page%>/<%=rs.pagecount%>頁</font></div>
</td>
<td width="40" align="center"> <font color="#000000">
<% if page="1" then %>
首頁
<%else%>
<a href=stud_manage.asp?t=students>首頁</a>
<% end if %>
</font></td>
<td width="40" align="center"> <font color="#000000">
<% if page="1" then %>
上頁
<%else%>
<a href=stud_manage.asp?page=<%=page-1%>&t=students>上頁</a>
<% end if %>
</font></td>
<td width="40" align="center"> <font color="#000000">
<% if page=cstr(rs.pagecount) then %>
下頁
<%else%>
<a href=stud_manage.asp?page=<%=page+1%>&t=students>下頁</a>
<% end if %>
</font></td>
<td width="40" align="center"> <font color="#000000">
<% if cstr(page)-cstr(rs.pagecount)=0 then%>
尾頁
<% else %>
<a href=stud_manage.asp?page=<%=rs.pagecount%>&t=students>尾頁</a>
<% end if %>
<%
else
response.write "還沒有加入考生!"
end if
rs.close
set rs=nothing
%>
</font></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
conn.close
set conn=nothing
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -