📄 ck_zy.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/conn.asp" -->
<%
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
%>
<%
If (CStr(Request("MM_update")) = "form") Then
If (Not MM_abortEdit) Then
' execute the update
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_conn_STRING
MM_editCmd.CommandText = "UPDATE buzhi SET zy_title = ?, zy_xztime = ?, zy_km = ?, zy_teacher = ? WHERE id = ?"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 203, 1, 536870910, Request.Form("zy_title")) ' adLongVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 50, Request.Form("zy_xztime")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 50, Request.Form("zy_km")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 50, Request.Form("zy_teacher")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 5, 1, -1, MM_IIF(Request.Form("MM_recordId"), Request.Form("MM_recordId"), null)) ' adDouble
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "updateok.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("id") <> "") Then
Recordset1__MMColParam = Request.QueryString("id")
End If
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_conn_STRING
Recordset1_cmd.CommandText = "SELECT * FROM buzhi WHERE id = ?"
Recordset1_cmd.Prepared = true
Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1", 5, 1, -1, Recordset1__MMColParam) ' adDouble
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<html>
<head>
<title>添 加 作 业 题</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.text { font-size: 12px; color: #000000}
.t3 {
color: #000000;
background-color: #eaf1fb;
border: 1px solid #3d5a83;
font-size: 12px;
}
-->
</style>
<link href="../Admin_Style.css" rel="stylesheet" type="text/css">
<script language="jscript">
function Check()
{
var NotNull
NotNull=true
if(document.form.zy_title.value=="")
{
window.alert("请输入作业题目")
NotNull=false
return NotNull
}
if(document.form.zy_cs.value=="")
{
window.alert("请输入作业次数")
NotNull=false
return NotNull
}
if(document.form.zy_km.value=="")
{
window.alert("请输入作业所属科目")
NotNull=false
return NotNull
}
if(document.form.zy_teacher.value=="")
{
window.alert("请输入作业发布人")
NotNull=false
return NotNull
}
return NotNull
}
</script>
<style type="text/css">
<!--
body {
background-color: #D6DFF7;
}
-->
</style></head>
<body text="#000000">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="topbg">
<td height="22" colspan="2" align="center"><strong> 作 业 系 统 管 理</strong></td>
</tr>
</table>
<br>
<form ACTION="<%=MM_editAction%>" METHOD="POST" name="form">
<div align="center"><strong>添 加 作 业 题</strong>
<br>
<br>
</div>
<table width="100%" border="0" cellspacing="1" cellpadding="2" class="border">
<tr>
<td height="20" width="216">
<div align="left">作业题目:</div></td>
<td height="20" width="500"><textarea name="zy_title" class="t3" cols="60" rows="10"><%=(Recordset1.Fields.Item("zy_title").Value)%></textarea></td>
</tr>
<tr>
<td height="20" width="216">
<div align="left">作业次数:</div></td>
<td height="20" width="500"> 第
<label></label>
<%=(Recordset1.Fields.Item("zy_cs").Value)%>次</td>
</tr>
<tr>
<td height="20" width="216">
<div align="left">作业提交限制时间:</div></td>
<td height="20" width="500"><input type="text" name="zy_xztime" class="t3" size="30" value="15天"> </td>
</tr>
<tr>
<td height="20" width="216">
<div align="left">作业所属科目:</div></td>
<td height="20" width="500"><label>
<input name="zy_km" type="text" id="zy_km" value="<%=(Recordset1.Fields.Item("zy_km").Value)%>">
</label></td>
</tr>
<tr>
<td height="20" width="216">
<div align="left">作业发布人:</div></td>
<td height="20" width="500"><label>
<input name="zy_teacher" type="text" id="zy_teacher" value="<%=(Recordset1.Fields.Item("zy_teacher").Value)%>">
</label></td>
</tr>
<tr>
<td height="20">
<input type="submit" name="add" value="修改" class="t3"></td>
<td> <input type="reset" name="clear" value="清除" class="t3"></td>
</tr>
<tr class="title"></tr>
</table>
<input type="hidden" name="MM_update" value="form">
<input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("id").Value %>">
</form>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -