www.gusucode.com > ASP+ACCESS学生排课管理系统毕业设计(源代码+论文) > ASP+ACCESS学生排课管理系统毕业设计(源代码+论文)\ASP+SQL学生排课管理系统\SelectCourse\SelectCourseMain.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

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'>你可选择的课程</p>"
if rs.eof or rs.bof then
	if COURSE_ID="" then
		response.write"<p align='center'>没有您可选的课程。</p>"
	else
		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="100%" border="1" cellpadding="0" cellspacing="0" 
	bordercolorlight="#0000dd" bordercolordark="#FFFFFF" bgcolor="#F0F0F0">
	<tr align="center" bgcolor=#99CCFF rowspan="2">
	<td colspan="7" height="28">排课系统</td>
	</tr>
	<tr bgcolor=#99CCFF align="center"> 
	<td rowspan="2" width="14%" align="center">课程号</td>
	<td width="15%">课程名称</td>
	<td width="14%">已选人数</td>
	<td width="14%">教师编号</td>
	<td width="14%">学分</td>
	<td width="15%">上课地点</td>
	<td width="14%">课程性质</td>
	</tr>
	<tr bgcolor=#99CCFF align="center"> 
	<td width="15%">开课分院</td>
	<td width="14%">最大人数</td>
	<td width="14%">教师姓名</td>
	<td width="14%">面向专业</td>      <td width="15%">上课时间</td>
	<td width="14%">考察方式</td>
	</tr>
	<%
	dim i
	i=1
	while not rs.eof
		if i mod 2=0 then
			Bgcolor="#F0F0F0"
		else
			Bgcolor="#FFFFFF"
		end if
		%>
		<tr align="center"> 
		<td rowspan="2" width="14%" align="center">
		<a href="detectSelectCollision.asp?ARRANGE_ID=<%=rs("ARRANGE_ID")%>" target="_parent">
		<%=rs("COURSE_ID")%>
		</a>
		</td>
		<td width="15%"><%=rs("COURSE_NAME")%></td>
		<td width="14%">
		<%
		set rs1=server.createobject("ADODB.Recordset")
		sql="select count(STUDENT_ID) as SELECTED from CourseSelect where ARRANGE_ID="&rs("ARRANGE_ID")
		rs1.open sql,conn
		if rs1("SELECTED")<rs("SELECTOR_NO_LIMIT") then
			response.write rs1("SELECTED")
		else
			response.write "<font color=#FF0000>"&rs1("SELECTED")&"</font>"
		end if
		rs1.close
		%>
		</td>
		<td width="14%"><%=rs("TEACHER_ID")%></td>
		<td width="14%"><%=rs("SCORE")%></td>      
		<td width="15%">
		<%=rs("BUILDING_NAME")&rs("CLASSROOM_NAME")%></td>
		<td width="14%"><%=rs("SELECT_LIMIT")%></td>
		</tr>
		<tr align="center"> 
		<td width="15%"><%=rs("DEPT_NAME")%></td>
		<td width="14%"><%=rs("SELECTOR_NO_LIMIT")%></td>
		<td width="14%"><%=rs("TEACHER_NAME")%></td>
		<td width="14%"><%=rs("ORIENT_DEPT_ID")%></td>
		<td width="15%"><%=rs("DAY_TIME")%></td>
		<td width="14%"><%=rs("TEST_METHOD")%></td>
		</tr>
		<%
		rs.movenext
		i=i+1
	wend
	rs.close
end if
response.Write "<hr size=1>"
set rs1=nothing
call closeDB()
%>
</table>
<p align="center">可选课程查询</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>