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

📄 showcourseinfo.asp

📁 一套完整的学生课程管理系统
💻 ASP
字号:
<!-- #include file="utility/check.asp" -->
<%
	'****************************************
	'目的:			
	'开始时间:		2005-5-31
	'最后修改时间:	2005-5-31
	'编写人:		某某某
	'****************************************
		
	'首先检查是否有权限
	'也就是用户是否通过审核
	CheckFlag(1)
	
	dim courseID			'课程号
	dim courseName			'课程名
	dim courseTeacher		'教师
	dim courseStartTime		'开课时间
	dim courseEndTime		'结束时间
	dim courseAddress		'每次上课时间
	dim courseTime			'每次上课地点
	dim courseCredit		'学分
	dim studentID
	
	dim sql
	dim rs
	
	courseID = Request.QueryString("courseID")
	studentID = Session("userID")
	
	sql = "select course.*,teacher.tName from course,teacher where course.tID = teacher.ID"
	sql = sql & " and course.ID = " & courseID
	set rs = ExecuteQuery(sql)
	'先判断是否存在这门课程
	if(rs.EOF) then
		Alert("似乎没有这门课程,请查实!")
		rs.close()
		set rs = nothing
		GoBack()
		Response.end
	end if
	'取值并赋给变量
	courseName = rs("cName")
	courseTeacher = rs("tName")
	courseStartTime = rs("cStartTime")
	courseEndTime = rs("cEndTime")
	courseAddress = rs("cAddress")
	courseTime = rs("cTime")
	courseCredit = rs("cCredit")
	'关闭RecordSet
	rs.close()
	set rs = nothing
	
%>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>已发信息列表</title>
<link rel="stylesheet" type="text/css" href="images/link.css">

</head>
<body>

<div align="center">
	<table border="1" width="560" id="table1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="85" bordercolor="#CCCCCC">
		<tr>
			<td width="558" height="20" align="right" colspan="4" bgcolor="#EEEEEE" valign="bottom">
			<p align="center">课程<font color=red><%=courseName%></font>具体信息如下:</td>
		</tr>
		<tr>
			<td width="76" height="21" align="right">课程名称:</td>
			<td height="21" width="244">&nbsp;&nbsp;<%=courseName%></td>
			<td height="21" width="93" align="right">教师:</td>
			<td height="21" width="138">&nbsp;&nbsp;<%=courseTeacher%> </td>
		</tr>
		<tr>
			<td width="76" align="right" height="21">课程时间:</td>
			<td height="21" width="244">&nbsp;&nbsp;<%=courseStartTime%>&nbsp;到&nbsp;<%=courseEndTime%></td>
			<td height="21" width="93" align="right">上课地点:</td>
			<td height="21" width="138">&nbsp;&nbsp;<%=courseAddress%> </td>
		</tr>
		<tr>
			<td width="76" align="right" height="22">上课时间:</td>
			<td height="22" width="244">&nbsp;&nbsp;<%=courseTime%></td>
			<td height="22" width="93" align="right">学分:</td>
			<td height="22" width="138">&nbsp;&nbsp;<%=courseCredit%> </td>
		</tr>
		</table>
	<br>
	<table border="1" width="561" id="table2" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="58" bordercolor="#CCCCCC">
		<tr>
			<td width="559" height="19" align="center" bgcolor="#EEEEEE" valign="bottom" colspan="2">
				课程<font color=red><%=courseName%></font>作业列表如下:
			</td>
		</tr>
		<!-- TODO: 循环开始处 -->
		<%
			'这里构造了一个左外连接查询
			sql = "select courseHomework.*,stuHomework.* from courseHomework left join "
			sql = sql & "(select * from stuHomework where stuID = '" & studentID & "') as stuHomework "	
			sql = sql & " on courseHomework.ID = stuHomework.homeworkID"
			sql = sql & " where courseHomework.courseID = " & courseID
			sql = sql & " order by courseHomework.ID desc "
			set rs = ExecuteQuery(sql)
			'判断是否存在作业
			if(rs.EOF) then
				Response.Write("暂时没有任何作业!")
				Response.end
			end if
			'列表显示存在的作业以及学生作答情况
			do while (not rs.EOF)
		%>		
		<tr>
			<td width="559" height="8" colspan="2"></td>
		</tr>
		<tr>
			<td height="28" width="71" bgcolor="#EEEEEE" valign="middle">
			<p align="right">题目:</td>
			<td height="28" width="486">
			<table border="0" width="100%" id="table3" cellspacing="3" cellpadding="2">
				<tr>
					<td style="line-height: 150%">
					<%
						Response.Write("[<font color=red>" & rs("courseHomework.addTime") & "</font>]" & rs("homework") )
					%>
					</td>
				</tr>
			</table>
			</td>
		</tr>
		<tr>
			<td height="28" width="71" bgcolor="#EEEEEE" valign="middle">
			<p align="right">我的解答:</td>
			<td height="28" width="486">
			<table border="0" width="100%" id="table4" cellspacing="3" cellpadding="2">
				<tr>
					<td style="line-height: 150%; font-size: 9pt">
						<%
							if(rs("homeworkContent") <> "") then
								Response.write("[<font color=red>" & rs("stuHomework.addTime") & "</font>]<br>")
								Response.write(rs("homeworkContent"))
							else
								Response.write("<font color=#999999>您还没有完成本次作业,</font>")
								Response.write("<a href=addHomework.asp?homeworkID=" & rs("courseHomework.ID"))
								Response.write("><font color=red>现在作答</font></a>")
							end if	
						%>
					</td>
				</tr>
			</table>
			</td>
		</tr>
		<tr>
			<td height="28" width="71" bgcolor="#EEEEEE" valign="middle">
			<p align="right">教师评定:</td>
			<td height="28" width="486">
			<table border="0" width="100%" id="table5" cellspacing="3" cellpadding="2">
				<tr>
					<td>
					<%
						if(rs("homeworkRank") <> "") then
							Response.write("[<font color=red>" & rs("teacherTime") & "</font><br>]")
							Response.write(rs("homeworkRank"))
						else
							Response.write("<font color=#999999>暂时没有评定内容</font>")
						end if	
					%>
					</td>
				</tr>
			</table>
			</td>
		</tr>
		<%
			rs.MoveNext()
			loop
			rs.close()
			set rs = nothing
		%>
		<!-- TODO: 循环结束处 -->
	</table>
</div>


</body>

</html>

⌨️ 快捷键说明

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