📄 chengji_query.asp
字号:
<!--#include file="checkuser.asp"-->
<!--#include file="conn.asp"-->
<%
dim lx,tj
dim rs,sql
lx=request.querystring("lx")
tj=request.querystring("tj")
if lx=0 then
%>
<script language="vbscript">
msgbox("请正确输入查找类型~!")
window.history.go(-1)
</script>
<%end if
if tj="" then%>
<script language="vbscript">
msgbox("查找条件不能为空~!")
window.history.go(-1)
</script>
<%end if%>
<%if lx=1 then
sql="select * from score where username='"&tj&"'"
elseif lx=2 then
sql="select * from score where zkz='"&tj&"'"
elseif lx=3 then
sql="select * from score where class='"&tj&"'"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
pagesize=20 '每一页的信息条数
Page=clng(Request.QueryString ("Page"))
if page<1 then page=1
if page>rs.PageCount then page=rs.PageCount
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
background-color: #EFF8FE;
}
body,td,th {
font-size: 12px;
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
color: #000000;
}
-->
</style>
<script language="VBScript">
sub del(id)
if confirm("你真的要删除着条考试记录吗~!") then
window.location.href"chengji_del.asp?id="&id
end if
end sub
</script>
</head>
<body>
<table width="522" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#67B0ED">
<tr bgcolor="#EFF8FE">
<td colspan="6"><div align="center">考试成绩管理系统</div></td>
</tr>
<tr bgcolor="#EFF8FE">
<td colspan="6"><table width="522" cellpadding="0" cellspacing="0">
<tr>
<form name="cnwy" method="get" action="chengji_query.asp" onsubmit="return checkform()">
<td width="90">考生条件查询: </td>
<td width="233"><select name="lx" id="lx">
<option value="0">查询类型</option>
<option value="1">真实姓名</option>
<option value="2">准考证号</option>
<option value="3">所在班级</option>
</select>
<input name="tj" type="text" id="tj" value="输入你要查询的条件" size="18"></td>
<td width="76">
<input type="submit" name="Submit" value="查找">
</td>
</form>
<td width="120"><div align="right"><a href="chengji.asp">返回考生管理首页</a></div></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#EFF8FE">
<td width="87" height="16"><div align="center">考试的科目</div></td>
<td width="97"><div align="center">考生姓名</div></td>
<td width="84"><div align="center">考试的分数</div></td>
<td width="101"><div align="center">参加考试的日期</div></td>
<td width="101"><div align="center">成绩类型</div></td>
<td width="33"><div align="center">删除</div></td>
</tr>
<%
if not rs.eof then
rs.movefirst
rs.AbsolutePage=Page
for i=1 to pagesize
id=rs("id")
kemu=rs("kemu")
username=rs("username")
score=rs("score")
ksdate=rs("ksdate")
wytype=rs("type")
%>
<tr bgcolor="#EFF8FE">
<td><div align="center"><%=kemu%></div></td>
<td><div align="center"><%=username%></div></td>
<td><div align="center"><%=score%></div></td>
<td><div align="center"><%=ksdate%></div></td>
<td><div align="center"><%=wytype%></div></td>
<td><div align="center"><a href="#" onClick="call del(<%=id%>)">删除</a></div></td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
else
response.write"暂时没有任何数据"
end if
%>
<tr bgcolor="#EFF8FE"><td height="26" colspan="6"><div align="center">
<table border=0 width='100%'>
<tr>
<td width="325" height="20" align=left>
<div align="center">考试成绩信息共:<font color=#ff3333><%=rs.recordcount%></font>条 总页数:<font color=#ff3333><%=rs.PageCount%></font>页 当前第<font color=#ff3333><%=Page%>/<%=rs.pagecount%></font>页</div></td>
<td width="190" align="right">
<div align="center"></div>
<div align="center"> |<a href="chengji_query.asp?lx=<%=lx%>&tj=<%=tj%>&Page=1">第一页</a>|<a href="chengji_query.asp?lx=<%=lx%>&tj=<%=tj%>&Page=<%=Page-1%>">上一页</a>|<a href="chengji_query.asp?lx=<%=lx%>&tj=<%=tj%>&Page=<%=Page+1%>">下一页</a>|<a href="chengji_query.asp?lx=<%=lx%>&tj=<%=tj%>&Page=<%=rs.PageCount%>">最后一页</a>|</div></td>
</tr>
</table>
</div></td>
</tr>
</table>
</body>
</html>
<%else%>
<SCRIPT LANGUAGE="VBSCRIPT">
msgbox("对不起没有查找的数据~!")
window.history.go(-1)
</SCRIPT>
<%
end if
rs.close
set rs=nothing
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -