📄 update.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/conn.asp" -->
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="2"
MM_authFailedURL="admin/accessfail.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" 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
%>
<%
' *** Edit Operations: declare variables
MM_editAction = CStr(Request("URL"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & 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")) <> "" And CStr(Request("MM_recordId")) <> "") Then
MM_editConnection = MM_conn_STRING
MM_editTable = "jg"
MM_editColumn = "ID"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = "ok.asp"
MM_fieldsStr = "name|value|firstxueli|value|xueke|value|birthday|value|firstxlgradufrom|value|mianmao|value|firstxuelidate|value|mianmaotime|value|sex|value|lastxueli|value|workstart|value|mingzu|value|lastxlgradufrom|value|shenfenzheng|value|jiguan|value|lastxldate|value|renshidaili|value|zhuanye|value|zhicheng|value|phone|value|leibie|value|zhichengdate|value|zhiwu|value|zhichpingyongdate|value|renjiaobumen|value|bianzhi|value|bianzhileibie|value|hunyin|value|chengyuan|value|danganhao|value|yibao|value|email|value|chunshen|value|zhuzhi|value|shehui|value|tuxiu|value|biandong|value|teacherzheng|value|jianli|value|gongzu|value|lunwen|value|niankao|value|peixunjl|value|jixujiaoyu|value|jiangcheng|value|beizhu|value"
MM_columnsStr = "name|',none,''|firstxueli|',none,''|xueke|',none,''|birthday|',none,NULL|firstxlgradufrom|',none,''|mianmao|',none,''|firstxuelidate|',none,NULL|mianmaotime|',none,NULL|sex|',none,''|lastxueli|',none,''|workstart|',none,NULL|mingzu|',none,''|lastxlgradufrom|',none,''|shenfenzheng|',none,''|jiguan|',none,''|lastxldate|',none,NULL|renshidaili|',none,''|zhuanye|',none,''|zhicheng|',none,''|phone|',none,''|leibie|',none,''|zhichengdate|',none,NULL|zhiwu|',none,''|zhichpingyongdate|',none,NULL|renjiaobumen|',none,''|bianzhi|',none,''|bianzhileibie|',none,''|hunyin|',none,''|chengyuan|',none,''|danganhao|',none,''|yibao|',none,''|email|',none,''|chushen|',none,''|zhuzhi|',none,''|shehui|',none,''|tuxiu|',none,''|biandong|',none,''|teacherzheng|',none,''|jianli|',none,''|gongzu|',none,''|lunwen|',none,''|niankao|',none,''|peixunjl|',none,''|jixujiaoyu|',none,''|jiangcheng|',none,''|beizhu|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(i+1) = CStr(Request.Form(MM_fields(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 i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),",")
Delim = MM_typeArray(0)
If (Delim = "none") Then Delim = ""
AltVal = MM_typeArray(1)
If (AltVal = "none") Then AltVal = ""
EmptyVal = MM_typeArray(2)
If (EmptyVal = "none") Then EmptyVal = ""
If (FormVal = "") Then
FormVal = EmptyVal
Else
If (AltVal <> "") Then
FormVal = AltVal
ElseIf (Delim = "'") Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''") & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(i) & " = " & 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 RS__MMColParam
RS__MMColParam = "1"
if (Request.QueryString("ID") <> "") then RS__MMColParam = Request.QueryString("ID")
%>
<%
set RS = Server.CreateObject("ADODB.Recordset")
RS.ActiveConnection = MM_conn_STRING
RS.Source = "SELECT * FROM jg WHERE ID = " + Replace(RS__MMColParam, "'", "''") + ""
RS.CursorType = 0
RS.CursorLocation = 2
RS.LockType = 3
RS.Open()
RS_numRows = 0
%>
<html>
<head>
<title>轻燕工作室中学人事管理系统-修改教工信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="files/cssupdate.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" background="files/bgview.gif" leftmargin="0">
<div align="center"><font color="#FF0000"><b><font color="#FF0000"><b><font color="#FF0000"><b><font color="#FF0000"><b><font color="#FF0000"><b><font color="#0000FF"><span class="cssresult"><img src="admin/top.gif" width="777" height="106" usemap="#Map" border="0" align="middle"></span></font></b></font></b></font></b></font><font color="#FF0000"><b><font color="#FF0000"><b><font color="#FF0000"><b><font color="#0000FF"><span class="cssresult">
<map name="Map">
<area shape="rect" coords="7,79,59,104" href="index1.asp" target="_self">
<area shape="rect" coords="62,79,113,106" href="search.asp" target="_self">
<area shape="rect" coords="116,78,208,103" href="add.asp" target="_self">
<area shape="rect" coords="307,76,359,106" href="admin/admuserlogin.asp" target="_self">
<area shape="rect" coords="696,76,748,104" href="admin/loginout.asp" target="_self">
<area shape="rect" coords="639,76,693,102" href="index.asp" target="_self">
<area shape="rect" coords="212,78,303,103" href="view.asp" target="_self">
<area shape="rect" coords="701,11,768,44" href="help.htm" target="_blank">
</map>
</span></font></b></font></b></font></b></font><font color="#0000FF"></font></b></font></b></font><font color="#FF0000"><b><font color="#FF0000"><b><font color="#0000FF"><span class="cssresult">
</span></font></b></font></b></font><font color="#FF0000"><b class="cssupdate"><br>
<br>
修改<font color="#0000FF">[<%=RS("name")%>]</font>老师的信息 </b></font></div>
<form ACTION="<%=MM_editAction%>" METHOD="POST" name="form1">
<table width="777" border="1" cellspacing="0" cellpadding="0" align="center" class="cssupdate" bordercolor="#FFFFFF">
<tr>
<td width="6%" class="cssupdate"><div align="center"><font color="#0000FF">姓名</font></div></td>
<td width="17%" class="cssupdate"> <input type="text" name="name" size="20" value="<%=(RS.Fields.Item("name").Value)%>">
</td>
<td width="18%" class="cssupdate"><font color="#0000FF">第一学历</font></td>
<td width="21%" class="cssupdate"> <select name="firstxueli">
<option value="专科">专科</option>
<option value="本科">本科</option>
<option value="硕士">硕士</option>
<option value="博士">博士</option>
<option value="初中">初中</option>
<option value="高中">高中</option>
<option value="中等专业">中专</option>
<%
While (NOT RS.EOF)
%>
<option value="<%=(RS.Fields.Item("firstxueli").Value)%>" selected ><%=(RS.Fields.Item("firstxueli").Value)%></option>
<%
RS.MoveNext()
Wend
If (RS.CursorType > 0) Then
RS.MoveFirst
Else
RS.Requery
End If
%>
</select> </td>
<td width="15%" class="cssupdate"><font color="#0000FF">任教学科</font></td>
<td width="23%" class="cssupdate"> <select name="xueke">
<option value="语文">语文</option>
<option value="数学">数学</option>
<option value="英语">英语</option>
<option value="物理">物理</option>
<option value="化学">化学</option>
<option value="历史">政治</option>
<option value="地理">地理</option>
<option value="生物">生物</option>
<option value="计算机">计算机</option>
<option value="体育">体育</option>
<option value="美术">美术</option>
<option value="音乐">音乐</option>
<option value="其他">其他</option>
<%
While (NOT RS.EOF)
%>
<option value="<%=(RS.Fields.Item("xueke").Value)%>" selected ><%=(RS.Fields.Item("xueke").Value)%></option>
<%
RS.MoveNext()
Wend
If (RS.CursorType > 0) Then
RS.MoveFirst
Else
RS.Requery
End If
%>
</select> </td>
</tr>
<tr>
<td width="6%" class="cssupdate" height="70">
<div align="center"><font color="#0000FF">出生</font></div></td>
<td width="17%" class="cssupdate" height="70" valign="top"> <br>
<input type="text" name="birthday" size="20" value="<%=(RS.Fields.Item("birthday").Value)%>">
<br>
<font color="#FF0000" class="time"><span class="chusheng">出生请按此时间格式输入(1998-12-6、1998年12月6日、1998/12/6)否则出错</span></font><span class="chusheng"><font color="#FF0000"></font></span><span class="time"><font color="#FF0000">
</font></span> <br>
</td>
<td width="18%" class="cssupdate" height="70"><font color="#0000FF">第一学历毕业学校</font></td>
<td width="21%" class="cssupdate" height="70">
<input type="text" name="firstxlgradufrom" value="<%=(RS.Fields.Item("firstxlgradufrom").Value)%>">
</td>
<td width="15%" class="cssupdate" height="70"><font color="#0000FF">政治面貌</font></td>
<td width="23%" class="cssupdate" height="70">
<select name="mianmao">
<option value="团员">团员</option>
<option value="中共党员">中共党员</option>
<option value="民盟">民盟</option>
<option value="民进">民进</option>
<option value="民革">民革</option>
<%
While (NOT RS.EOF)
%>
<option value="<%=(RS.Fields.Item("mianmao").Value)%>" selected ><%=(RS.Fields.Item("mianmao").Value)%></option>
<%
RS.MoveNext()
Wend
If (RS.CursorType > 0) Then
RS.MoveFirst
Else
RS.Requery
End If
%>
</select> </td>
</tr>
<tr>
<td width="6%" height="14" class="cssupdate"><div align="center"><font color="#0000FF">年龄</font></div></td>
<td width="17%" height="14" class="cssupdate"><%=(RS.Fields.Item("age").Value)%> </td>
<td width="18%" height="14" class="cssupdate"><font color="#0000FF">第一学历毕业时间</font></td>
<td width="21%" height="14" class="cssupdate"> <input type="text" name="firstxuelidate" value="<%=(RS.Fields.Item("firstxuelidate").Value)%>">
</td>
<td width="15%" height="14" class="cssupdate"><font color="#0000FF">入团或党时间</font></td>
<td width="23%" height="14" class="cssupdate"> <input type="text" name="mianmaotime" value="<%=(RS.Fields.Item("mianmaotime").Value)%>">
</td>
</tr>
<tr>
<td width="6%" class="cssupdate"><div align="center"><font color="#0000FF">性别</font></div></td>
<td width="17%" class="cssupdate"> <input type="text" name="sex" size="20" value="<%=(RS.Fields.Item("sex").Value)%>">
</td>
<td width="18%" class="cssupdate"><font color="#0000FF">最后学历</font></td>
<td width="21%" class="cssupdate"> <select name="lastxueli">
<option value="专科">专科</option>
<option value="本科">本科</option>
<option value="硕士">硕士</option>
<option value="博士">博士</option>
<option value="初中">初中</option>
<option value="高中">高中</option>
<option value="中等专业">中专</option>
<%
While (NOT RS.EOF)
%>
<option value="<%=(RS.Fields.Item("lastxueli").Value)%>" selected ><%=(RS.Fields.Item("lastxueli").Value)%></option>
<%
RS.MoveNext()
Wend
If (RS.CursorType > 0) Then
RS.MoveFirst
Else
RS.Requery
End If
%>
</select> </td>
<td width="15%" class="cssupdate"><font color="#0000FF">参加工作时间</font></td>
<td width="23%" class="cssupdate"> <input type="text" name="workstart" value="<%=(RS.Fields.Item("workstart").Value)%>">
</td>
</tr>
<tr>
<td width="6%" class="cssupdate"><div align="center"><font color="#0000FF">民族</font></div></td>
<td width="17%" class="cssupdate"> <input type="text" name="mingzu" size="20" value="<%=(RS.Fields.Item("mingzu").Value)%>">
</td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -