selectsubject.asp

来自「网络考试系统最终备份」· ASP 代码 · 共 79 行

ASP
79
字号
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="conn.inc"-->
<html>
<head>
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<body>
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
  <tr>
    <td width="100%" height="30" style="border-left-style: solid; border-left-width: 0; border-right-style: solid; border-right-width: 0; border-top-style: solid; border-top-width: 0; border-bottom: 1px solid #000000">
    <img border="0" src="images/selectsubject.jpg"></td>
  </tr>
</table>
<%
'本程序根据 用户id 获取 他要参加考试的试卷ID 由试卷ID 找到对应的科目id 然后找到对应的科目名称
response.cookies("downloadok")=""
sql1="select * from exam_testuser examin_testuser where havetest=0 and user_id="& request.cookies("userid")
set rs1=server.createobject("adodb.recordset")
rs1.open sql1,conn,3,2
if rs1.eof then
%>
<table border="0" cellspacing="0" bordercolor="#111111" width="480">
  <tr>
    <td width="100%" height="30">&nbsp;现在您还没有需要参加考试的科目! </td>
  </tr>
</table>
<%
else
i=1
%>
<table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#C0C0C0" id="AutoNumber2" width="480" cellpadding="0">
  <tr>
    <td height="22" width="20" bgcolor="#E1E1E1"></td>
    <td bgcolor="#E1E1E1">&nbsp;<b>科目名称</b></td>
    <td bgcolor="#E1E1E1" width="80">
    <p align="center"><b>考试时间</b></td>
    <td bgcolor="#E1E1E1" width="80">
    <p align="center"><b>操作</b></td>
  </tr>
  <%
 
do while not rs1.eof
 sql="select * from exam_test_info t,exam_subject s  where '"&Date()&"' between starttime and endtime and not passuserid is null and t.sub_id = s.s_id and testid="& rs1("test_id")
 set rs=server.createobject("adodb.recordset")
 rs.open sql,conn,3,2
 if not rs.eof then
 v_subid= rs("sub_id")  '获取科目ID 以便找到对应的科目名称
 sqlsub = "select * from exam_subject where s_id = "&v_subid
 set rsSub = server.CreateObject("adodb.recordset")
 rsSub.open sql,conn,3,2
 
%>
  <tr>
    <td align="center" height="20" width="20" bgcolor="#E1E1E1"><%=i%></td>
    <td bgcolor="#FFFFFF">
    <p align="left">&nbsp;<%=rs("exam_subject")%></td>
    <td bgcolor="#FFFFFF">
    <p align="center">&nbsp;<%=rs("testtime")%>小时</td>
    <td bgcolor="#FFFFFF">
    <p align="center"><a href="paper.asp?testid=<%'=rs1("testid")%>">进入考场</a></td>
  </tr>
  <%
 rsSub.close()
  set rsSub = NOTHING
end if
rs1.movenext
i=i+1
loop

rs.close()
set rs = nothing
%>
</table>
<%
end if
%>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?