gusucode.com > ASP+ACCESS学生排课管理系统毕业设计(源代码+论文) > ASP+ACCESS学生排课管理系统毕业设计(源代码+论文)\ASP+SQL学生排课管理系统\SelectCourse\SelectCourseMain_bACKuP.asp

    <!--#include file="../include/keepHouse.asp"-->
<html>
<head>
<title><%=WebName%>-选课系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../include/WebCourseSettlementStyle.Css" rel="stylesheet" type="text/css">
</head>

<body bgcolor=#F5F5F5>
<%
call insureID()
if Session("USER_TYPE")<>"Student" and Session("USER_TYPE")<>"Admin" then
	response.end
end if
'下面根据不同的需求显示不同的结果,这些提交的需求动态的添加到了SQL语句中:
dim COURSE_ID
dim TEACHER_ID
COURSE_ID=request("COURSE_ID")
TEACHER_ID=request("TEACHER_ID")
COURSE_ID=Trim(request("COURSE_ID"))
TEACHER_ID=Trim(request("TEACHER_ID"))
sql="select * from VIEW_Arrange where ORIENT_DEPT_ID like '%"&session("DEPT_ID")&"%'"
if COURSE_ID<>"" then
	sql=sql+" and COURSE_ID='"&COURSE_ID&"'"
end if
if TEACHER_ID<>"" then
	sql=sql+" and TEACHER_ID='"&TEACHER_ID&"'"
end if
call openDB()
rs.open sql,conn,1,1
response.Write "<p align='center'><font size='+1' face='黑体'>你可选择的课程</font></p>"
if rs.eof or rs.bof then
	'如果记录集为空,则没有该学生可选的课程:
                if COURSE_ID="" then
		response.write"<p align='center'>没有您可选的课程!</p>"
		response.write"session('DEPT_ID')="&session("DEPT_ID")
	else
'如果COURSE_ID不为空,表明有一个查询提交上来,这是的提示应该是:		
         response.Write "<p align='center'>编号为<font color='red'>"&COURSE_ID&"</font>的课程不存在!</p>"
	end if
else
%>
<div align="center"><font color="#0000FF">点击课程号可以直接选课</font> </div>
-----------------------------------------------------------------------------------
<table width="760" border="1" align="center"  bordercolorlight="#0000dd" bordercolordark="#FFFFFF" cellpadding="0" cellspacing="0">
  <tr bgcolor="#99CCFF"> 
    <td width="39" nowrap height="28"><strong>课程号</strong></td>
    <td width="89" nowrap><strong>课程名</strong></td>
    <td width="58" nowrap><strong>教师号</strong></td>
    <td width="53" nowrap><strong>教师名</strong></td>
    <td width="60" nowrap><strong>开课部门</strong></td>
    <td width="28" nowrap><strong>课程<br>性质</strong></td>
    <td width="22" nowrap><strong>学<br>分</strong></td>
    <td width="33" nowrap><strong>考察<br>方式</strong></td>
    <td width="69" nowrap><strong>面向<br>专业号</strong></td>
    <td width="35" nowrap><strong>最大<br>人数</strong></td>
    <td width="93" nowrap><strong>上课地点</strong></td>
    <td width="64" nowrap><strong>教室性质</strong></td>
	<td width="89" nowrap><strong>上课时间</strong></td>
  </tr>
<%
	dim i
	i=1
	while not rs.eof
	if i mod 2=0 then
		Bgcolor="#F0F0F0"
	else
		Bgcolor="#FFFFFF"
	end if
	%>
    <tr bgcolor="<%=Bgcolor%>">
    <td nowrap><font color=red><a href="detectSelectCollision.asp?ARRANGE_ID=<%=rs("ARRANGE_ID")%>" target="_parent"><%=rs("COURSE_ID")%></a></font></td>
    <td nowrap><%=rs("COURSE_NAME")%></td>
    <td nowrap><%=rs("TEACHER_ID")%></td>
    <td nowrap><%=rs("TEACHER_NAME")%></td>
    <td nowrap><%=rs("DEPT_NAME")%></td>
    <td nowrap><%=rs("SELECT_LIMIT")%></td>
    <td nowrap><%=rs("SCORE")%></td>
    <td nowrap><%=rs("TEST_METHOD")%></td>
    <td nowrap><%=rs("ORIENT_DEPT_ID")%></td>
    <td nowrap><%=rs("SELECTOR_NO_LIMIT")%></td>
    <td nowrap><%=rs("BUILDING_NAME")&rs("CLASSROOM_NAME")%></td>
    <td nowrap><%=rs("CLASSROOM_PROPERTY")%></td>
	<td nowrap><%=rs("DAY_TIME")%></td>
  </tr>
 -------------------------------------------------------------------------------------------------------------------
 
 
 
 
 
 
 
 -----------------------------------------------------------------------------------------------------------------
<%
		rs.movenext
		i=i+1
	wend
	rs.close
end if
response.Write "<hr size=1>"
call closeDB()
%>
</table>
<p align="center"><font color="#000000" size="+2" class="title" face="黑体">课 程 查 询</font></p>
<form method="post" action="SelectCourseMain.asp">
  <div align="center"><center><table border="0">
    <tr>
      <td align="right" nowrap>输入课程号:</td>
      <td nowrap><input type="text" name="COURSE_ID" size="20"></td>
    </tr>
    <tr>
          <td align="right" nowrap>输入教师号:</td>
      <td nowrap><input type="text" name="TEACHER_ID" size="20"></td>
    </tr>
    <tr>
      <td colspan="2" align="center"><br>
      <input class=button type="submit" value="查  询" style="FONT-SIZE: 9pt; WIDTH: 80px"></td>
    </tr>
  </table>
  </center></div>
</form>
</body>
</html>