⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cjtj.asp

📁 本人的课程设计。不足之处请大家指教。因为第一次用ASP有很多不足的地方。
💻 ASP
字号:
<!-- #include file="cookies.asp" -->
<!-- #include file="conn/conn.asp" -->
<html>
<head>
<title>成绩统计</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
	background-color: #0099FF;
}
-->
</style></head>

<body text="#000000">
<!-- #include file="button_t.asp" -->

<table width="760" border="0" align="center" bgcolor="#FFFFFF">
<form name="form2" method="post" action="cjtj.asp">
<tr>
    <td height="10"><font color="#0000FF">请先选择专业分类: 
      <%
	  set rs=server.createobject("adodb.recordset")
	  sql="select * from profession order by name"    '取所有专业列表
	  rs.open sql,conn,1,1
	  %>
      <select name="pname" id="pname">
	  <option value="">所有专业</option>
	  <%do while not rs.eof       '循环  输出专业下拉框
		%>
        <option value="<%=trim(rs("name"))%>">
		<%=trim(rs("name"))%>
        </option>
        <%
	  rs.movenext
	  loop
	  rs.close
	  set rs=nothing
	  %>
      </select>
      <input type="submit" name="Submit2" value="确定">
      <input type="hidden" name="type" value="fl">
     </font></td>
  </tr>
  </form>

<tr><td height="10"><hr> </td></tr>

  <tr> 
    <td> 
	   <table width="750" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor=<%=color%>>
        <tr>
          <td height="25"><strong>试卷名称</strong></td>
		  <td height="25"><strong>课程</strong></td>
		  <td height="25"><strong>编号</strong></td>
          <td height="25"><strong>发布时间</strong></td>
          <td height="25" width="40">&nbsp;</td>
		  <td height="25" width="40">&nbsp;</td>
        </tr>
		 <%
		 
		
		if request("page")="" then
			page="1"		'初始 页数从1开始
		else 
			page=request("page")
		end if
		
		pname=trim(request.form("pname"))		
		set rs=server.createobject("adodb.recordset")
		if pname="" then    '未选择专业取所有试卷
		sql="select * from exam where fabu='1' order by ename,eid"
		else                '取选择专业对应的试卷
		sql="select * from exam where pname='"&pname&"' and fabu='1' order by ename,eid"
		end if		
		rs.open sql,conn,1,1
		if rs.eof then
			response.Write "<tr><td>无记录</tr></td>"
		else
			rs.pagesize=30       '设置每页30条记录
			rs.Absolutepage=clng(page)    '指针移动到第page页的记录
			
			'取当前页记录数
			if cstr(page)=cstr(rs.PageCount) and (rs.RecordCount mod rs.PageSize <> 0) then 
				'尾页而且记录数不足30条时                      
				recend=rs.RecordCount mod  rs.PageSize               
			else  
				recend=30           '每页记录数为30条          
			end if 
			
			for i=1 to recend
				if i mod 2=1 then    '输出显示颜色隔行变换
				  color="#f8f8f8"
				else
				  color="#E4e4e4"
				end if
		'以下显示记录
  %>
        <tr bgcolor=<%=color%>> 
          <td height="25"><a href="exam_view.asp?ename=<%=trim(rs("ename"))%>&eid=<%=trim(rs("eid"))%>" target="_blank"><%=trim(rs("text"))%></a>
			</td>
		  <td height="25"><%=trim(rs("ename"))%></td>
		  <td height="25"><%=trim(rs("eid"))%></td>
          <td height="25"><%=trim(rs("addtime"))%></td>
          <td height="25" width="40"> <input type="button" name="Submit3" value="开始统计" onClick="window.open('cjtj_start.asp?ename=<%=trim(rs("ename"))%>&eid=<%=trim(rs("eid"))%>');"> 
          <td height="25" width="40"> <input type="button" name="Submit4" value="考生成绩" onClick="window.open('cjtj_quary.asp?ename=<%=trim(rs("ename"))%>&eid=<%=trim(rs("eid"))%>');"> 
          </td>
        </tr>  <%
			rs.movenext
			next
  %>
      </table></td>
  </tr>
</table>
<table border="0" width="760" align="center" bgcolor="#FFFFFF">
  <tr> 
    <td> 
      <div align="left"><font color="#000000">共有试卷记录<%=rs.recordcount%>条</font></div>
    </td>
    <td width="40" align="center"> <font color="#000000"> 
      <% if page="1" then %>
      上页 
      <%else%>
      <a href=cjtj.asp?page=<%=page-1%>>上页</a> 
      <% end if %>
      </font></td>
    <td width="39" align="center"> <font color="#000000"> 
      <% if page=cstr(rs.pagecount) then %>
      下页 
      <%else%>
      <a href=cjtj.asp?page=<%=page+1%>>下页</a> 
      <%end if %>
      </font>
	   
<%		end if 
rs.close
set rs=nothing
%>
    </td>
  </tr>
</table>
</body>
</html>
<%
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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