📄 listhomework.asp
字号:
<!-- #include file="utility/checkTeacher.asp" -->
<%
'****************************************
'目的: 列表显示所有作业信息
'开始时间: 2005-6-5 15:24
'最后修改时间: 2005-6-6 10:05
'编写人: 某某某
'****************************************
dim sql
dim rs
dim teacherID
dim courseID
dim pageSize '每页显示信息数目
dim pgnm '总共的页面数目
dim recordCount '总共的记录数
dim page '用户请求的页面索引
dim count '消息计数器,用来判断是否到达分页条目
dim link '把翻页链接地址保存在变量中
dim cName '搜索的课程名
dim cNamIS '是否严格匹配课程名
cName = Request.QueryString("cName")
cNameIS = Request.QueryString("cNameIS")
courseID = Request.QueryString("courseID")
teacherID = Session("userID")
count = 0
pageSize = 10
link = "listHomework.asp?is=is"
sql = "select cName,courseID,homework,addTime,courseHomework.ID from courseHomework,course"
sql = sql & " where courseHomework.courseID = course.ID and course.tID = " & teacherID
'处理搜索信息
if(cName <> "") then
if(cNameIS = "yes") then
sql = sql & " and cName = '" & cName & "'"
link = link & "&cName=" & cName & "&cNameIS=yes"
else
sql = sql & " and cName like '%" & cName & "%'"
link = link & "&cName=" & cName
end if
end if
'处理按作业编号匹配信息
if(courseID <> "") then
sql = sql & " and courseHomework.courseID = " & courseID
link = link & "&courseID=" & courseID
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>
<div align="center">
<table border="1" width="700" id="table2" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="22">
<tr>
<td valign="bottom"> 当前操作: 作业列表</td>
</tr>
</table>
<br>
<table border="1" width="700" id="table1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="65" bordercolor="#CCCCCC">
<tr>
<td width="70" height="19" align="center" bgcolor="#F2F2F2">课程名</td>
<td height="19" width="405" align="center" bgcolor="#F2F2F2">作业内容</td>
<td height="19" width="70" align="center" bgcolor="#F2F2F2">发布时间</td>
<td height="19" width="149" align="center" bgcolor="#F2F2F2">操作</td>
</tr>
<%
'循环显示表格开始
set rs = ExecuteQuery(sql)
if(not rs.eof) then
rs.PageSize = pageSize
pgnm = rs.PageCount
recordCount = rs.RecordCount
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="70" align="center" height="25"><%=rs("cName")%></td>
<td height="25" width="405" align="left"> <%=rs("homework")%></td>
<td height="25" width="70" align="center"><%=rs("addTime")%></td>
<td height="25" width="149" align="center">
<a href="listStudentHomework.asp?homeworkID=<%=rs("ID")%>">查看学生回答情况</a>/<a href="manageHomework.asp?actionType=deleteHomework&homeworkID=<%=rs("ID")%>">删除</a></td>
</tr>
<%
'循环显示表格结束
rs.MoveNext()
count = count + 1
loop
rs.close()
set rs = nothing
%>
<tr>
<td width="694" align="right" height="21" colspan="4">
<%if page=1 then%> <font color="#CCCCCC">上一页</font><%else%>
<a href="<%Response.write(link & (page-1))%>">上一页</a><%end if%>
<%if page\pgnm=0 then%><a href="<%Response.write(link & (page+1))%>">下一页</a><%else%>
<font color="#CCCCCC">下一页</font><%end if%> 共<font color="#FF0000"><%=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="700" id="table4" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="49">
<tr>
<td valign="bottom" height="19" bgcolor="#F2F2F2" colspan="4"> 搜索面板:</td>
</tr>
<tr>
<td valign="middle" height="8" colspan="4"></td>
</tr>
<form action=listHomework.asp method=get>
<tr>
<td valign="middle" height="24" width="70" align="right" bgcolor="#F2F2F2">
课程名:</td>
<td valign="bottom" height="24" width="264"> <input type="text" name="cName" class="inputTextShort" size="20" > <input type="checkbox" name="cNameIS" value="精确匹配" id="fp1"><label for="fp1">精确匹配</label></td>
<td valign="middle" height="24" width="95" align="right" bgcolor="#F2F2F2">
操作:</td>
<td valign="middle" height="24" width="264"> <input type=submit value="确定查询" name="OK" class="anniu">
<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 + -