⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 add_zy.asp

📁 在线教育
💻 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_insert")) = "form") Then
  If (Not MM_abortEdit) Then
    ' execute the insert
    Dim MM_editCmd

    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_conn_STRING
    MM_editCmd.CommandText = "INSERT INTO buzhi (zy_title, zy_cs, zy_xztime, zy_km, zy_teacher) VALUES (?, ?, ?, ?, ?)" 
    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", 5, 1, -1, MM_IIF(Request.Form("zy_cs"), Request.Form("zy_cs"), null)) ' adDouble
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 50, Request.Form("zy_xztime")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 50, Request.Form("zy_km")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202, 1, 50, Request.Form("zy_teacher")) ' adVarWChar
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    ' append the query string to the redirect URL
    Dim MM_editRedirectUrl
    MM_editRedirectUrl = "add_zyok.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
%><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 name="form" method="POST" action="<%=MM_editAction%>">
  <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"></textarea>
      </td>
    </tr>
    <tr>
      <td height="20" width="216">       
      <div align="left">作业次数:</div></td>
      <td height="20" width="500"> 第
        <select name="zy_cs" class="t3">
            <option value="请选择">请选择</option>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
            <option value="13">13</option>
            <option value="14">14</option>
            <option value="15">15</option>
          </select>
        次</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 type="text" name="zy_km" id="zy_km">
      </label></td>
    </tr>
    <tr>
      <td height="20" width="216">      
      <div align="left">作业发布人:</div></td>
      <td height="20" width="500"><label>
        <input type="text" name="zy_teacher" id="zy_teacher">
      </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_insert" value="form">
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -