📄 empmain_base_edit.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/EmpMain.asp" -->
<!--#include file="EmpMain_CheckRight.asp"-->
<%call fnCheckRight("GeneralInfo","2")%>
<%
' *** 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 & "?" & 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_EmpMain_STRING
MM_editTable = "EmpGeneralInfo"
MM_editColumn = "ID"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = ""
MM_fieldsStr = "EmpCompID|value|EmpName|value|EmpEnglishName|value|EmpSelfID|value|EmpGender|value|EmpBirthDay|value|EmpNativePlace|value|EmpNativeAddress|value|EmpNowAddress|value|EmpNowTel|value|EmpEvenAddress|value|EmpEvenTel|value|EmpCommAddress|value|EmpZipCode|value|EmpFinallevel|value|EmphireDate|value|EmpTrueDate|value|EmpHireDep|value|EmpTitle|value|isTemp|value|EmpDimissionDate|value|EmpDimssionReson|value"
MM_columnsStr = "EmpCompID|',none,''|EmpName|',none,''|EmpEnglishName|',none,''|EmpSelfID|',none,''|EmpGender|',none,''|EmpBirthDay|',none,NULL|EmpNativePlace|',none,''|EmpNativeAddress|',none,''|EmpNowAddress|',none,''|EmpNowTel|',none,''|EmpEvenAddress|',none,''|EmpEvenTel|',none,''|EmpCommAddress|',none,''|EmpZipcode|',none,''|EmpFinallevel|',none,''|EmphireDate|',none,NULL'|EmpTrueDate|',none,NULL|EmpHireDep|',none,''|EmpTitle|',none,''|IsTemp|',none,''|EmpDimissionDate|',none,NULL|EmpDimissionReson|',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
call fnCreateLog("编辑员工资料")
isEditOk = "1"
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim genInfo__MMColParam
genInfo__MMColParam = "1"
If (Request.QueryString("ID") <> "") Then
genInfo__MMColParam = Request.QueryString("ID")
End If
%>
<%
Dim genInfo
Dim genInfo_numRows
Set genInfo = Server.CreateObject("ADODB.Recordset")
genInfo.ActiveConnection = MM_EmpMain_STRING
genInfo.Source = "SELECT * FROM EmpGeneralInfo WHERE ID = " + Replace(genInfo__MMColParam, "'", "''") + ""
genInfo.CursorType = 0
genInfo.CursorLocation = 2
genInfo.LockType = 1
genInfo.Open()
genInfo_numRows = 0
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>姓名</title>
<link rel="stylesheet" href="CSS/SellWellWeb.css" type="text/css">
<script language="javascript" src="js_Lib/fnCheckForm.js"></script>
<script language="javascript" src="Js_Lib/Calendar.js"></script>
<%if isEditok = "1" then%>
<script>
alert("编辑成功!")
</script>
<%end if%>
<script>
function fndodelete(){
if(confirm("您确定要删除?")){
window.location = "EmpMain_Base_Delete.asp?EmpID=<%= genInfo.Fields.Item("ID").Value %>"
}
}
</script>
</head>
<body class="body">
<form method="POST" action="<%=MM_editAction%>" name="form1">
<fieldset style="padding: 2" class="fiedset">
<legend>基本信息</legend>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="98%" id="AutoNumber1" class="table" align="center">
<tr>
<td nowrap align="right" class="Caption" width="25%"><strong><font color="#FF0000">*</font></strong>编号:</td>
<td class="ValueArea" width="25%"> <input name="EmpCompID" type="text" class="Text" id="EmpCompID" value="<%=(genInfo.Fields.Item("EmpCompID").Value)%>" Need="1"></td>
<td nowrap align="right" class="Caption" width="25%"><strong><font color="#FF0000">*</font></strong>姓名:</td>
<td width="25%" class="ValueArea"> <input name="EmpName" type="text" class="Text" id="EmpName3" value="<%=(genInfo.Fields.Item("EmpName").Value)%>" need="1">
</td>
</tr>
<tr>
<td width="25%" nowrap align="right" class="Caption">英文名:</td>
<td width="25%" class="ValueArea"> <input name="EmpEnglishName" type="text" class="Text" id="EmpEnglishName" value="<%=(genInfo.Fields.Item("EmpEnglishName").Value)%>"></td>
<td width="25%" nowrap align="right" class="Caption"><strong><font color="#FF0000">*</font></strong>身份证号:</td>
<td width="25%" class="ValueArea"> <input name="EmpSelfID" type="text" class="Text" id="EmpSelfID" value="<%=(genInfo.Fields.Item("EmpSelfID").Value)%>" Need="1"></td>
</tr>
<tr>
<td width="25%" nowrap align="right" class="Caption"><strong><font color="#FF0000">*</font></strong>性别:</td>
<td width="25%" class="ValueArea"> <input type="radio" name="EmpGender" value="男" <%if trim(genInfo.Fields.Item("EmpGender").Value) = "男" then%>checked<%end if%>>
男
<input type="radio" name="EmpGender" value="女" <%if trim(genInfo.Fields.Item("EmpGender").Value) = "女" then%>checked<%end if%>>
女</td>
<td width="25%" nowrap align="right" class="Caption"><strong><font color="#FF0000">*</font></strong>出生年月:</td>
<td width="25%" class="ValueArea"> <input name="EmpBirthDay" type="text" class="Text" style="cursor:hand" id="EmpBirthDay" Need="1" value="<%=(genInfo.Fields.Item("EmpBirthDay").Value)%>" readonly onclick="getDate(document.form1.EmpBirthDay,'2')"></td>
</tr>
<tr>
<td width="25%" nowrap align="right" class="Caption">籍贯:</td>
<td width="25%" class="ValueArea"> <input name="EmpNativePlace" type="text" class="Text" id="EmpNativePlace" value="<%=(genInfo.Fields.Item("EmpNativePlace").Value)%>"></td>
<td width="25%" nowrap align="right" class="Caption">户籍地址:</td>
<td width="25%" class="ValueArea"> <input name="EmpNativeAddress" type="text" class="Text" id="EmpNativeAddress" value="<%=(genInfo.Fields.Item("EmpNativeAddress").Value)%>"></td>
</tr>
<tr>
<td width="25%" nowrap align="right" class="Caption">现址:</td>
<td width="25%" class="ValueArea"> <input name="EmpNowAddress" type="text" class="Text" id="EmpNowAddress" value="<%=(genInfo.Fields.Item("EmpNowAddress").Value)%>"></td>
<td width="25%" nowrap align="right" class="Caption">电话:</td>
<td width="25%" class="ValueArea"> <input name="EmpNowTel" type="text" class="Text" id="EmpNowTel" value="<%=(genInfo.Fields.Item("EmpNowTel").Value)%>" DataType="TelNo"></td>
</tr>
<tr>
<td width="25%" nowrap align="right" class="Caption"><strong><font color="#FF0000">*</font></strong>户籍状况:</td>
<td width="25%" class="ValueArea"><select name="EmpEvenAddress" size="1" class="Text" id="Emphuji" style="width:100%" Need="1">
<%=createSel("HuKou",genInfo.Fields.Item("EmpEvenAddress").Value)%>
</select></td>
<td width="25%" nowrap align="right" class="Caption">手机:</td>
<td width="25%" class="ValueArea"> <input name="EmpEvenTel" type="text" class="Text" id="EmpEvenTel" value="<%=(genInfo.Fields.Item("EmpEvenTel").Value)%>" DataType="TelNo"></td>
</tr>
<tr>
<td width="25%" nowrap align="right" class="Caption"><strong><font color="#FF0000">*</font></strong>通讯地址:</td>
<td colspan="3" class="ValueArea"><input name="EmpCommAddress" type="text" class="Text" id="EmpCommAddress" value="<%=(genInfo.Fields.Item("EmpCommAddress").Value)%>" Need="1"></td>
</tr>
<tr>
<td nowrap align="right" class="Caption" width="25%"><strong><font color="#FF0000">*</font></strong>邮政编码:</td>
<td class="ValueArea" width="25%"> <input name="EmpZipCode" type="text" class="Text" id="EmpZipCode" value="<%=(genInfo.Fields.Item("EmpZipcode").Value)%>" need="1" datatype="Number"></td>
<td nowrap align="right" class="Caption" width="25%"><font size="2"><strong><font color="#FF0000">*</font></strong>最终学历:</font></td>
<td width="25%" class="ValueArea"> <select size="1" name="EmpFinallevel" style="width:100%" class="Text" Need="1">
<%=createSel("XueLi",genInfo.Fields.Item("EmpFinallevel").Value)%> </select>
</td>
</tr>
<tr>
<td width="25%" nowrap align="right" height="20" class="Caption"><strong><font color="#FF0000">*</font></strong>进公司时间:</td>
<td width="25%" height="20" class="ValueArea"> <input name="EmphireDate" type="text" class="Text" id="EmphireDate" style="cursor:hand" value="<%=(genInfo.Fields.Item("EmphireDate").Value)%>" Need="1" readonly onclick="getDate(document.form1.EmphireDate,'2')"></td>
<td width="25%" nowrap align="right" height="20" class="Caption"><strong><font color="#FF0000">*</font></strong>部门:</td>
<td width="25%" height="20" class="ValueArea"> <select name="EmpHireDep" size="1" class="select" id="select" Need="1">
<%=createSel("BuMen",genInfo.Fields.Item("EmpHireDep").Value)%> </select></td>
</tr>
<tr>
<td nowrap align="right" height="20" class="Caption">职位:</td>
<td height="20" class="ValueArea"><select name="EmpTitle" size="1" class="select" id="select2">
<%=createSel("zhiwei",genInfo.Fields.Item("EmpTitle").Value)%> </select></td>
<td nowrap align="right" height="20" class="Caption">是否正式员工:</td>
<td height="20" class="ValueArea"><select name="isTemp" size="1" class="select" id="isTemp">
<option />
<option <%if trim(genInfo.Fields.Item("isTemp").Value) = "是" then%>selected<%end if%> value="是">是</option>
<option <%if trim(genInfo.Fields.Item("isTemp").Value) = "否" then%>selected<%end if%> value="否">否</option>
</select></td>
</tr>
<tr>
<td nowrap align="right" class="Caption"><strong><font color="#FF0000">*</font></strong>预转正/转正日期:</td>
<td class="ValueArea"><input name="EmpTrueDate" type="text" class="Text" id="EmpTrueDate" style="width:100%;cursor:hand" readonly onClick="getDate(document.form1.EmpTrueDate,'2')" Need="1" value="<%=(genInfo.Fields.Item("EmpTrueDate").Value)%>"></td>
<td nowrap align="right" class="Caption">离职日期:</td>
<td class="ValueArea"><input name="EmpDimissionDate" type="text" class="Text" style="cursor:hand" id="EmpDimissionDate" value="<%=(genInfo.Fields.Item("EmpDimissionDate").Value)%>" readonly onClick="getDate(document.form1.EmpDimissionDate,'2')"></td>
</tr>
<tr>
<td width="25%" nowrap align="right" class="Caption">离职原因:</td>
<td colspan="3" class="ValueArea"><input name="EmpDimssionReson" type="text" class="Text" id="EmpDimssionReson2" value="<%=(genInfo.Fields.Item("EmpDimissionReson").Value)%>"></td>
</tr>
</table>
</fieldset>
<div align="right">
<input type="button" name="Submit" value="修改" class="button" onclick="fnCheckForm()">
<input type="button" name="Submit" value="删除" class="button" onclick="fndodelete()">
<input type="button" name="back" value="返回" class="button" onclick="window.location='EmpMain_Base_Disp.asp?ID=<%=request("ID")%>'">
</div>
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="MM_recordId" value="<%= genInfo.Fields.Item("ID").Value %>">
</form>
</body>
</html>
<%
genInfo.Close()
Set genInfo = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -