📄 add.asp
字号:
<%
if session("user_type")<>"T" then
response.redirect "../../../index.asp"
end if
%>
<%response.buffer=true%>
<!--#INCLUDE FILE="../../../system/odbc_connection.asp"-->
<!--#INCLUDE FILE="../../../system/function.asp"-->
<HTML>
<HEAD>
<TITLE> 发布新的作业 </TITLE>
<link rel="stylesheet" href="../../../system/all.css">
</HEAD>
<BODY>
<%
dim lesson_id
lesson_id=session("lesson_id")
%>
<center>
<h2 align="center"> 布置新的作业 </h2>
<form name="form1" method="post" action="">
<table border="0" width=80%>
<caption align=left><b>作业说明</b></caption>
<tr>
<td width=20%>主题</td>
<td><input type="text" name="title" size=60 ></td>
</tr>
<tr>
<td width=20%>内容</td>
<td><textarea name="body" rows=5 cols=60 ></textarea></td>
</tr>
<tr>
<td width=20%>附件</td>
<td>
<input type="radio" name="append" value="N" checked>不需要
<input type="radio" name="append" value="Y">需要(如选择需要,请准备您的附件)
</td>
</tr>
</table>
<p>
<table border="0" width=80%>
<caption align=left><b>对学生作业的要求</b></caption>
<tr>
<td width=20%>递交方式</td>
<td>
<select name="submit_homework_type">
<option value="F">在线交文件</option>
<option value="W">在线做</option>
<option value="L">交超链接网址</option>
<option value="E">email交</option>
<option value="Z">其它方式</option>
</select>
</td>
</tr>
<tr>
<td>文件大小</td>
<td>
<input type="text" name="file_size" size="10" value="1">M (如要学生"在线交文件",请输入文字最大容量,必须是数字)
</td>
</tr>
<tr>
<td>截止时间</td>
<td><input type="text" name="end_date" size=10 value="<%=cdate(date()+7)%>">(一定要按这种格式,年-月-日)</td>
</tr>
</table>
<p><input type="submit" name="submit" value=" 提 交 " >  <input type=submit name=submit value=" 取 消 ">
</form>
</center>
<%
If request("submit")=" 取 消 " Then
response.redirect "index.asp?lesson_id=" &lesson_id
End If
If request("title")<>"" Then
dim title,body,submit_date,end_date,homework_type,submit_homework_type,file_size
title=request.form("title")
body=request.form("body")
submit_date=date
end_date=request.form("end_date")
homework_type="H"
file_size=request.form("file_size")
submit_homework_type=request.form("submit_homework_type")
Dim SQL,sValues
SQL = "Insert into homework(lesson_id"
sValues = "values('" & lesson_id & "'"
SQL = SQL & ",title"
sValues = sValues & "," & "'" & title & "'"
If request("body")<>"" Then
SQL = SQL & ",body"
sValues = sValues & "," & "'" & myReplace(body) & "'"
End If
SQL = SQL & ",submit_date"
sValues = sValues & "," & "'" & submit_date & "'"
SQL = SQL & ",end_date"
sValues = sValues & "," & "'" & end_date & "'"
SQL = SQL & ",homework_type"
sValues = sValues & "," & "'" & homework_type & "'"
SQL = SQL & ",file_size"
sValues = sValues & "," & file_size
SQL = SQL & ",open_flag"
sValues = sValues & ",1"
SQL = SQL & ",submit_homework_type"
sValues = sValues & "," & "'" & submit_homework_type & "'"
SQL = SQL & ") " & sValues & ")"
response.write sql
DB.Execute(SQL)
if request.form("append")="Y" then
sql="select homework_id from homework where lesson_id ='" & lesson_id & "'"
sql=sql+" order by homework_id desc"
set rs=db.execute(sql)
dim temp_url
temp_url="add_file.asp?homework_id=" & rs("homework_id") & "&lesson_id=" & lesson_id
rs.close
set rs=nothing
db.close
set db=nothing
response.redirect temp_url
else
db.close
set db=nothing
response.redirect "index.asp"
end if
End If
%>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -