📄 admin_special_modi.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'=========================================================
' 学校机房作业管理系统 V 1.0 [创建于200812122100]
' 授权发布网站:清远ABC-http://www.qyabc.com/
' 客服QQ:418322257 E-Mail:qystu@163.com
' 注意:如想得到关于本程序免费的技术支持,
' 必须承诺使用一周后,用平邮回寄“相关文件”文件夹中的“学校机房作业管理系统调查反馈表”表格。
' 作者博客:http://www.qyabc.com/u/qin/Default.aspx
'=========================================================
%>
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="5,6,7"
MM_authFailedURL="login.asp?error=3"
MM_grantAccess=false
If session("QYABC_userid") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
<!--#include file="inc/config.asp" -->
<!--#include file="Connections/master.asp" -->
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
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
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables
If (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then
MM_editConnection = MM_master_STRING
MM_editTable = "special_list"
MM_editColumn = "special_id"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = "admin_special_modi_success.asp"
MM_fieldsStr = "special_id|value|class_name|value|class_explain|value"
MM_columnsStr = "special_index|',none,''|special_list|',none,''|special_remark|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Update Record: construct a sql update statement and execute it
If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then
' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId
If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim class_modi__MMColParam
class_modi__MMColParam = "1"
If (Request.QueryString("id") <> "") Then
class_modi__MMColParam = Request.QueryString("id")
End If
%>
<%
Dim class_modi
Dim class_modi_numRows
Set class_modi = Server.CreateObject("ADODB.Recordset")
class_modi.ActiveConnection = MM_master_STRING
class_modi.Source = "SELECT * FROM special_list WHERE special_id = " + Replace(class_modi__MMColParam, "'", "''") + ""
class_modi.CursorType = 0
class_modi.CursorLocation = 2
class_modi.LockType = 1
class_modi.Open()
class_modi_numRows = 0
%>
<%
Dim special_list
Dim special_list_numRows
Set special_list = Server.CreateObject("ADODB.Recordset")
special_list.ActiveConnection = MM_master_STRING
special_list.Source = "SELECT * FROM special_list ORDER BY special_index ASC"
special_list.CursorType = 0
special_list.CursorLocation = 2
special_list.LockType = 1
special_list.Open()
special_list_numRows = 0
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改专业-<%=WebName%></title>
<link rel="SHORTCUT ICON" href="favicon.ico"/>
<link href="<%= SysCss %>" rel="stylesheet" type="text/css">
<script language="JavaScript">
<!--
function checkform(){
if(document.form1.subject_name.value=="")
{
alert("必须填写科目名称!");
document.form1.subject_name.focus();
return false;
}
if(document.form1.subject_explain.value=="")
{
alert("必须填写科目说明!");
document.form1.subject_explain.focus();
return false;
}
}
//-->
</script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="16%" valign="top"><table width="97%" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td> </td>
</tr>
<tr>
<td align="center"><a href="admin_class_add.asp">添加班级</a><a href="admin_news_index.asp"></a></td>
</tr>
<tr>
<td align="center"><a href="admin_class_list.asp">班级列表</a></td>
</tr>
<tr>
<td align="center"><a href="admin_special_add.asp">添加科组</a><a href="admin_news_add.asp"></a></td>
</tr>
<tr>
<td align="center"><a href="admin_special_list.asp">科组列表</a><a href="admin_news_add.asp"></a></td>
</tr>
<tr>
<td align="center"><a href="admin_news_add.asp"></a></td>
</tr>
</table></td>
<td width="84%" valign="top"><form ACTION="<%=MM_editAction%>" METHOD="POST" name="form1" onsubmit="return checkform()">
<table width="80%" align="center" cellpadding="5" bgcolor="#FFFFFF">
<tr valign="baseline">
<td nowrap align="right">专业序列:</td>
<td><label>
<input name="special_id" type="text" id="special_id" value="<%=(class_modi.Fields.Item("special_index").Value)%>" size="32">
</label></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">专业名称:</td>
<td><input name="class_name" type="text" id="class_name" value="<%=(class_modi.Fields.Item("special_list").Value)%>" size="32"> </td>
</tr>
<tr>
<td nowrap align="right" valign="top">专业说明:</td>
<td valign="baseline"><textarea name="class_explain" cols="50" rows="5" id="class_explain"><%=(class_modi.Fields.Item("special_remark").Value)%></textarea> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><a href="admin_special_list.asp">返回科组列表</a></td>
<td align="right"><input name="submit" type="submit" value="修改班级"> </td>
</tr>
</table>
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="MM_recordId" value="<%= class_modi.Fields.Item("special_id").Value %>">
</form></td>
</tr>
</table>
<p> </p>
<!--#include file="inc/bot.asp" -->
</body>
</html>
<%
class_modi.Close()
Set class_modi = Nothing
%>
<%
special_list.Close()
Set special_list = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -