📄 listselectedcourse.asp
字号:
<!-- #include file="utility/check.asp" -->
<%
'****************************************
'目的: 显示学生所有选课信息
'开始时间: 2005-5-31
'最后修改时间: 2005-5-31
'编写人: 某某某
'****************************************
'首先检查是否有权限
'也就是用户是否通过审核
CheckFlag(1)
'教师编号,以便能够查询该教师所以被选择的课程
dim cTeacherID
dim studentID
cTeacherID = Request.QueryString("tID")
studentID = Session("userID")
dim sql
dim rs
dim pageSize '每页显示信息数目
dim pgnm '总共的页面数目
dim page '用户请求的页面索引
dim count '消息计数器,用来判断是否到达分页条目
dim deleteInfo '依据数据库内容显示不同的 删除 字样
count = 0
pageSize = 9
page = Request.QueryString("page")
sql = "select stuCourse.*,teacher.tName,course.tID,course.cName,course.cCredit,course.canSelect from stuCourse,teacher,course"
sql = sql & " where stuCourse.courseID = course.ID and course.tID = teacher.ID"
sql = sql & " and stuCourse.stuID = '" & studentID & "'"
'如果是依据教师ID查询,就继续构造sql字符串
if(cTeacherID <> "") then
sql = sql & " and course.tID = " & cTeacherID
end if
%>
<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>
<table border="1" width="565" id="table2" cellspacing="0" cellpadding="0" height="76" bordercolor="#CCCCCC" style="border-collapse: collapse">
<tr>
<td height="27" width="78" align="center" bgcolor="#EEEEEE">课程名</td>
<td height="27" width="50" align="center" bgcolor="#EEEEEE">教师</td>
<td height="27" width="62" align="center" bgcolor="#EEEEEE">学分</td>
<td height="27" width="62" align="center" bgcolor="#EEEEEE">平时成绩</td>
<td height="27" width="66" align="center" bgcolor="#EEEEEE">考试成绩</td>
<td height="27" width="79" align="center" bgcolor="#EEEEEE">总成绩</td>
<td height="27" width="109" align="center" bgcolor="#EEEEEE">详细信息/作业</td>
<td height="27" width="54" align="center" bgcolor="#EEEEEE">操作</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)
'把是否能被选择转换为字符显示
if(rs("canSelect") = 0) then
deleteInfo = "<font color=#999999>删除</font>"
else
deleteInfo = "<a href='manageCourse.asp?actionType=delete&courseID=" & rs("courseID") & "'>删除</a>"
end if
%>
<tr>
<td height="28" width="78" align="center" style="line-height: 150%"><%=rs("cName")%></td>
<td height="28" width="50" align="center" style="line-height: 150%"><a href="listSelectedCourse.asp?tID=<%=rs("tID")%>"><%=rs("tName")%></a></td>
<td height="28" width="62" align="center" style="line-height: 150%"><%=rs("cCredit")%></td>
<td height="28" width="62" align="center" style="line-height: 150%"><%=rs("stuCommonMark")%></td>
<td height="28" width="66" align="center" style="line-height: 150%"><%=rs("stuTestMark")%></td>
<td height="28" width="79" align="center" style="line-height: 150%"><%=rs("stuRank")%></td>
<td height="28" width="109" align="center" style="line-height: 150%">
<a href="showCourseInfo.asp?courseID=<%=rs("courseID")%>">查看</a></td>
<td height="28" width="54" align="center" style="line-height: 150%"><%=deleteInfo%></td>
</tr>
<%
rs.MoveNext
count = count + 1
loop
%>
<tr>
<td width="556" align="right" height="23" colspan="8"><%if page=1 then%><p align="right">
<font color="#CCCCCC">上一页</font><%else%>
<a href="listSelectedCourse.asp?tID=<%=cTeacherID%>&page=<%=page-1%>">上一页</a><%end if%>
<%if page\pgnm=0 then%><a href="listSelectedCourse.asp?tID=<%=cTeacherID%>&page=<%=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=62px;height=16px; color:#111111; background-color:#DDDDFF">
<option selected value="#">请选择</option>
<%for i=1 to pgnm%>
<option value="listSelectedCourse.asp?tID=<%=cTeacherID%>&page=<%=i%>">第<%=i%>页
</option>
<%next%>
</select></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -