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

📄 liststudentcourse.asp

📁 一套完整的学生课程管理系统
💻 ASP
字号:
<!-- #include file="utility/checkAdmin.asp" -->
<%
	'****************************************
	'目的:			显示所有学生选课信息
	'开始时间:		2005-6-4 15:43
	'最后修改时间:	2005-6-4 17:58
	'编写人:		某某某
	'****************************************
	
	'定义搜索字段
	dim stuID
	dim stuNameIS
	dim courseName
	dim courseNameIS
	dim teaName
	dim teaNameIS
	dim order
	dim orderDesc
	
	dim sql
	dim rs
	
	dim pageSize	'每页显示信息数目
	dim pgnm		'总共的页面数目
	dim page		'用户请求的页面索引
	dim count		'消息计数器,用来判断是否到达分页条目
	dim link		'把翻页链接地址保存在变量中
	
	'搜索变量赋值
	stuID = Request.QueryString("stuID")
	stuIDIS = Request.QueryString("stuNameIS")
	courseName = Request.QueryString("courseName")
	courseNameIS = Request.QueryString("courseNameIS")
	teaName = Request.QueryString("teaName")
	teaNameIS = Request.QueryString("teaNameIS")
	order = Request.QueryString("order")
	orderDesc = Request.QueryString("orderDesc")
	
	count = 0
	pageSize = 10
	
	link = "listStudentCourse.asp?is=is"
	sql = "select stuCourse.*,course.cName,teacher.tName,course.cCredit "
	sql = sql & "from stuCourse,course,teacher where "
	sql = sql & "stuCourse.courseID = course.ID and course.tID = teacher.ID "
	
	'处理stuID参数
	if(stuID <> "") then
		if(stuIDIS = "yes") then
			sql = sql & "and stuCourse.stuID = '" & stuID & "' "
			link = link & "&stuID=" & stuID & "&stuIDIS=" & stuIDIS
		else	
			sql = sql & "and stuCourse.stuID like '%" & stuID & "%' "
			link = link & "&stuID=" & stuID
		end if
	end if
	
	'处courseName理参数
	if(courseName <> "") then
		if(courseNameIS = "yes") then
			sql = sql & "and course.cName = '" & courseName & "' "
			link = link & "&courseName=" & courseName & "&courseNameIS=" & courseNameIS
		else
			sql = sql & "and course.cName like '%" & courseName & "%' "
			link = link & "&courseName=" & courseName
		end if
	end if
	
	'处理teaName参数
	if(teaName <> "") then
		if(teaNameIS = "yes") then
			sql = sql & "and teacher.tName = '" & teaName & "' "
			link = link & "&teaName=" & teaName & "&teaNameIS=" & teaNameIS
		else
			sql = sql & "and teacher.tName like '%" & teaName & "%' "
			link = link & "&teaName=" & teaName
		end if
	end if
	
	'处理order参数,即查询排序处理
	if(order = "学号") then
		sql = sql & "order by stuCourse.stuID "
	elseif(order = "教师名") then
		sql = sql & "order by teacher.tName "
	else
		sql = sql & "order by course.cName "
	end if	
	link = link & "&order=" & order
	
	'处理orderDesc参数,即是否降序排列
	if(order <> "") then
		if(orderDesc = "yes") then
			sql = sql & "desc"
		end if
	end if
			
	page = Request.QueryString("page")
	link = link & "&page="
%>
<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">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>

<body>

<div align="center">
	<table border="1" width="749" id="table2" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="22">
		<tr>
			<td>&nbsp;当前操作: 学生选课列表</td>
		</tr>
	</table>
	<br>
	<table border="1" width="749" id="table1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="70" bordercolor="#CCCCCC">
		<tr>
			<td width="106" height="22" align="center" bgcolor="#F2F2F2">学号</td>
			<td height="22" align="center" width="106" bgcolor="#F2F2F2">课程名</td>
			<td height="22" align="center" width="107" bgcolor="#F2F2F2">教师</td>
			<td height="22" align="center" width="107" bgcolor="#F2F2F2">课程学分</td>
			<td height="22" align="center" width="107" bgcolor="#F2F2F2">平时成绩</td>
			<td height="22" align="center" width="107" bgcolor="#F2F2F2">考试成绩</td>
			<td height="22" align="center" width="107" bgcolor="#F2F2F2">总成绩</td>
		</tr>
		<%
			set rs = ExecuteQuery(sql)
			if(not rs.eof) then
				rs.PageSize = pageSize
				pgnm = rs.PageCount
			
				if(IsEmpty(page) or cint(page) < 1 or cint(page) > pgnm) then
					page = 1
				end if
			
				rs.absolutePage = page		'指定当前页码
			
			else
				Alert("无符合条件的记录,请返回并访问其他页面!")
				Go("welcome.htm")
				Response.end	 
			end if
			
			do while(not rs.EOF and count <> pageSize)
		%>
		<tr>
			<td width="106" align="center" height="26"><%=rs("stuID")%></td>
			<td height="26" align="center" width="106"><%=rs("cName")%></td>
			<td height="26" align="center" width="107"><%=rs("tName")%></td>
			<td height="26" align="center" width="107"><%=rs("cCredit")%></td>
			<td height="26" align="center" width="107"><%=rs("stuCommonMark")%></td>
			<td height="26" align="center" width="107"><%=rs("stuTestMark")%></td>
			<td height="26" align="center" width="107"><%=rs("stuRank")%></td>
		</tr>
		<%
				rs.MoveNext()
				count = count + 1
			loop
		%>
		<tr align="right">
			<td width="658" align="right" height="23" colspan="7" align="right">
			<%if page=1 then%> <font color="#CCCCCC">上一页</font><%else%>
			<a href="<%Response.write(link & (page-1))%>">上一页</a><%end if%>&nbsp;
			<%if page\pgnm=0 then%><a href="<%Response.write(link & (page+1))%>">下一页</a><%else%>
			<font color="#CCCCCC">下一页</font><%end if%> 共<font color="#FF0000"><%=rs.recordcount%></font>条信息,每页<font color="#FF0000"><%=pageSize%></font>条,共<font color="#FF0000"><%=pgnm%></font>页,<span lang="zh-cn">当前为第<font color="#FF0000"><%=page%></font>页,</span>跳转到<select name="page" onchange="MM_jumpMenu('this',this,0)" style="border:1px solid #8293E6; font-size: 9pt;width=62;height=16; color:#111111; background-color:#DDDDFF">
			<option selected value="#">请选择</option>
			<%for i=1 to pgnm%>
			<option value="<%Response.write(link & i)%>">
			第<%=i%>页</option>
			<%next%></select></td>
		</tr>
	</table>
	<br>
	<table border="1" width="749" id="table3" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="115">
		<tr>
			<td bgcolor="#F2F2F2" height="20" colspan="4">&nbsp;&nbsp;搜索面板:</td>
		</tr>
		<tr>
			<td height="8" colspan="4"></td>
		</tr>
		<!-- 注意这里我们采用get方式来传递表单中的值!-->
		<form action=listStudentCourse.asp method=get>
		<tr>
			<td width="78" align="right" bgcolor="#F2F2F2" height="25">学号:</td>
			<td width="286" height="25" valign="bottom">&nbsp;&nbsp;<input type=text name="stuID" size="20" class="inputText">&nbsp;<input type=checkbox name="stuIDIS" value="yes" id="fp1"><label for="fp1">精确匹配</label></td>
			<td width="80" align="right" bgcolor="#F2F2F2" height="25">教师名:</td>
			<td width="300" height="25" valign="bottom">&nbsp;&nbsp;<input type=text name="teaName" size="20" class="inputText">&nbsp;<input type=checkbox name="teaNameIS" value="yes" id="fp5"><label for="fp5">精确匹配</label></td>
		</tr>
		<tr>
			<td width="78" align="right" bgcolor="#F2F2F2" height="25">课程名:</td>
			<td width="286" height="25" valign="bottom">&nbsp;&nbsp;<input type=text name="courseName" size="20" class="inputText">&nbsp;<input type=checkbox name="courseNameIS" value="yes" id="fp2"><label for="fp2">精确匹配</label></td>
			<td width="80" align="right" bgcolor="#F2F2F2" height="25">排列次序:</td>
			<td width="300" height="25" valign="bottom">&nbsp;&nbsp;<select size="1" name="order" class="inputText">
			<option>学号</option>
			<option>教师名</option>
			<option>课程名</option>
			</select>&nbsp;<input type=checkbox name="orderDesc" value="yes" id="fp9"><label for="fp9">降序排列</label></td>
		</tr>
		<tr>
			<td height="32" bgcolor="#F2F2F2">
			<p align="right">操作:</td>
			<td height="32" colspan="3">&nbsp;&nbsp;<input type=submit value="确定查询" name="OK" class="anniu">&nbsp;
			<input type=reset value="重新填写" name="Cancel" class="anniu"></td>
		</tr>
		</form>
		</table>
</div>
	
</body>

</html>

⌨️ 快捷键说明

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