📄 adm_mainright.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conndb/conn.asp"-->
<%
getcondition = replace(trim(request("condition")),"'","''")
getkey = replace(trim(request("key")),"'","''")
if(getcondition = "" or getkey = "")then
rssql = "select * from Tab_stuResult"
else
rssql = "select * from Tab_stuResult where "&getcondition&" like '%"&getkey&"%' order by res_subdate desc"
end if
set rs = server.createobject("adodb.recordset") 'conn.Execute(rssql)不用它因为用了之后,rs.recordcount不好使。
rs.open rssql,conn,1,3
rs.pagesize = 5
'实现分页
if rs.eof then
rs_total = 0
else
rs_total = rs.recordcount
end if
dim pageno
getpageno = replace(trim(request("pageno")),"'","")
if(getpageno = "")then
pageno = 1
else
pageno = getpageno
End if
if(not rs.eof)then
rs.absolutepage = pageno
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查询考生成绩</title>
<script language="javascript" src="js/js.js"></script>
</head>
<style>
td{font-size:9pt;}
A{text-decoration:none;color:black;}
A:hover{text-decoration:underline;color:blue;}
A.nq{text-decoration:none;color:black;}
A.nq:hover{text-decoration:underline;color:blue;}
</style>
<body topmargin="0" leftmargin="0">
<form name="queryuser" method="post" action="adm_Mainright.asp">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center>
<tr>
<td height="27" colspan=5 align=center><font color="red">查 询 考 生 成 绩</font></td>
</tr>
<tr>
<td width="29%" height="26" align=right nowrap>查询条件:</td>
<td width="17%">
<select name="condition" style="width:150;border:1px solid;">
<option value="stu_id">学生证号</option>
<option value="which_lesson">考试课程</option>
<option value="res_subdate">考试时间</option>
</select>
</td>
<td width="9%" align = right nowrap>关键字:</td>
<td width="24%"><input type="text" name="key"></td>
<td width="21%"><input type="submit" name="submit" value="查询" style="border:1px solid;"></td>
</tr>
</table>
</form>
<form name="delresult" method="post">
<table width="100%" border="1" cellspacing="0" cellpadding="0" align=center>
<tr>
<td width="5%" height="27" align="center" nowrap>选 项</td>
<td width="16%" height="27" align="center">学生证号</td>
<td width="17%" height="27" align="center">考试课程</td>
<td width="17%" height="27" align="center">单选成绩</td>
<td width="14%" height="27" align="center" nowrap>多选成绩</td>
<td width="15%" height="27" align="center">总成绩</td>
<td width="16%" height="27" align="center">考试时间</td>
</tr>
<%
if(rs.eof)then
%>
<tr><td height="27" colspan=7 align=center nowrap><font color="red">没有符合条件的记录!</font></td></tr>
<%
else
repeat_rows = 0
while(repeat_rows < rs.pagesize) and (not rs.eof)
%>
<tr>
<td height="27" align=center nowrap>
<input type="checkbox" name="ChkBox" value="<%=server.htmlencode(rs("res_id"))%>">
</td>
<td height="27" align=center nowrap><%=server.htmlencode(rs("stu_id"))%></td>
<td height="27" align=center nowrap><%=server.htmlencode(rs("which_lesson"))%></td>
<td height="27" align=center nowrap><%=server.htmlencode(rs("res_single"))%></td>
<td height="27" align=center nowrap><%=server.htmlencode(rs("res_more"))%></td>
<td height="27" align=center nowrap><%=server.htmlencode(rs("res_total"))%></td>
<td height="27" align=center nowrap><%=server.htmlencode(mid(rs("res_subdate"),1,10))%></td>
</tr>
<%
repeat_rows = repeat_rows + 1
rs.movenext
wend
%>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center>
<tr>
<td colspan=5> </td>
</tr>
<tr>
<td width="3%" height="26" align=right nowrap><input name="Chkall" type="checkbox" onClick="CheckAll(this.form.ChkBox,this.form.Chkall)">
</td>
<td width="7%" align=center nowrap>[全选/反选]</td>
<td width="30%">[<a style="cursor:hand;color:red;" onclick="javascript:Check(delresult)">删 除</a>]</td>
<td width="2%"></td>
<td width="58%">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center>
<tr>
<td align=right nowrap>
[<%=pageno%>/<%=rs.pagecount%>] [共<font color="red"><%=rs_total%></font>条记录]
[
<%
if(pageno <> 1)then
%>
<a href="adm_Mainright.asp?condition=<%=getcondition%>&key=<%=getkey%>">第一页</a>
<%
End if
%>
<%
if(pageno <> 1)then
%>
<a href="adm_Mainright.asp?condition=<%=getcondition%>&key=<%=getkey%>&pageno=<%=(pageno-1)%>">上一页</a>
<%
end if
%>
<%
if(instr(pageno,cstr(rs.pagecount)) = 0)then
%>
<a href="adm_Mainright.asp?condition=<%=getcondition%>&key=<%=getkey%>&pageno=<%=(pageno+1)%>">下一页</a>
<%
end if
%>
<%
if(instr(pageno,cstr(rs.pagecount)) = 0)then
%>
<a href="adm_Mainright.asp?condition=<%=getcondition%>&key=<%=getkey%>&pageno=<%=rs.pagecount%>">最后一页</a>
<%
end if
rs.close
set rs = nothing
%>]</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<%
end if
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -