📄 show_homework.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%const need_purview=1%>
<!--#include file="localhost.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="lockip.asp"-->
<!--#include file="show_error.asp"-->
<!--#include file="purview.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<link href="eric.css" rel="stylesheet" type="text/css">
<SCRIPT language=javascript>
function openScript(url, width, height) {
var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,status=n0' );
}
</SCRIPT>
</head>
<body>
<%
'response.write session("our_teacher")
'response.end
dim sql_80
sql_80="select * from homework where object_class='" & session("student_class") & "' and teacher_name='" & session("our_teacher") & "' and homework_name<>'' order by id desc"'使最近的一次作业排在最前,
sql_81= "select * from upload_info where teacher='" & session("our_teacher") & "' and class_e='" & session("student_class") & "' and upload_username='" & session("student") & "' order by id desc"'使最后上传的文件排在最前面
call opendb()
set rs=conn.execute(sql_80)
if not rs.eof then
array_01=rs.getrows()'取得SElECTa Recordset的二维数组
rows_01=ubound(array_01,2)'取得array_01第二维的下界
'set rs=rs.NextRecordset '使用Nextrecordset激活下一个recordset
call closers()
set rs=conn.execute(sql_81)
if not rs.eof then
is_upfile=true
array_02=rs.GetRows '再次取得第二个SElECTb Recordset的二维数组
rows_02=ubound(array_02,2)'取得array_02第二维的下界
else
is_upfile=false
end if
call closers()
else
call closers()
call closedb()
response.write "<span class='red_bold_14pt_font'>当前未有布置的作业!</span>"
response.end
end if
'call closedb()
%>
<table width="600" border="0" align="center" cellpadding="4" cellspacing="1" id="table_01">
<tr>
<td width="39" class="white_bold_blue">序号</td>
<td width="157" class="white_bold_blue">作业名称:</td>
<td width="158" class="white_bold_blue">操作:</td>
<td width="105" class="white_bold_blue">布置及上传时间</td>
<td width="95" class="white_bold_blue">备注:</td>
</tr>
<%
for i=0 to rows_01
%>
<tr>
<td align="center" class="white_bold_blue"><%=i+1%></td>
<td><a title="点击查看该次作业内容!" href=javascript:openScript('detail.asp?id=<%=array_01(0,i)%>',418,300)><%=array_01(2,i)%></a><% '第2列第i行,数据库表中homework中的字段不能随意添加或删除%></td>
<td>
<%
if array_01(4,i)=true then'是否允许上传
response.write "<a href='upload.asp?id=" & array_01(0,i) & "&work_name=" & array_01(2,i) & "'>[上传]</a>"
elseif array_01(4,i)=false then
response.write "<FONT SIZE='2' COLOR='red'>[当前不允许上传该作业]</FONT>"
end if
%>
</td>
<td><%=array_01(3,i)%><%'布置作业的时间%></td>
<td> </td>
</tr>
<%
if is_upfile=true then
k=0
for j=0 to rows_02
if array_01(2,i)=array_02(5,j) then
k=k+1
'sql_05="select * from upload_info where teacher='" & session("our_teacher") & "' and class_e='" & session("student_class") & "' and upload_username='" & session("student") & "'"
'set rs_05=conn.execute(sql_05)
'if not rs_05.eof then
'do while not rs_05.eof
'response.write right(rs_05("upload_path"),len(rs_05("upload_path"))-instrRev(rs_05("upload_path"),"/"))
'rs.movenext
'rs_05.close
'set rs_05=nothing
'loop
'end if
%>
<tr>
<td colspan="2"><%=right(array_02(2,j),len(array_02(2,j))-instrRev(array_02(2,j),"/"))%><%'输出上传的文件名%>
</td>
<td><a href="download.asp?work_name=<%=array_01(2,i)%>&FileName=<%=right(array_02(2,j),len(array_02(2,j))-instrRev(array_02(2,j),"/"))%>">[下载]</a>
<%
if array_01(4,i)=true then
response.write "<a href='check.asp?action=delete_upfile&id=" & array_02(0,j) & "'>[删除]</a>"
end if
%> </td><td><%=array_02(4,j)%></td>
<td> </td>
</tr>
<%
end if
next
'exit for
'end if
'next
if k=0 then
%>
<tr>
<td colspan="2"><FONT SIZE="2" COLOR="red">当前你未提交本次作业!</FONT></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<%
end if
end if
next
%>
<%
'rs.movenext
'loop
'call closers()
'else
'response.write "<span class='red_bold_14pt_font'>当前未有布置的作业!</span>"
'response.write "dd"
'response.write session("our_teacher")
'response.write session("student_class")
'end if
call closedb()
%>
</table>
<br>
<br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -