📄 update.asp
字号:
<%@ Language=VBScript %>
<%
'文件功能:新增、修改员工信息
'版权所有:万户网络
'编写人员:房鹏
'编写时间:2003-8-12
'修改人员:房鹏
'修改时间:2003-8-18
'修改目的:设立权限控制
%>
<!-- #include file="../Common/Cls_DbProcess2.1.asp" -->
<!-- #include file="../wh_employees/Cls_wh_employees.asp" -->
<!-- #include file="../pub/conn.asp" -->
<!-- #include file="../pub/fun.asp" -->
<%call checklogin()%>
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="WindSoft Programmer3">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=gb2312">
<TITLE>员工信息--维护</TITLE>
<%
dim mStr_WINDCallType
mStr_WINDCallType = trim(request.querystring("WINDCallType")) '调用方式
dim mStr_WINDURL '请将需要全局传递的变量链接到本变量上,使用方法参见WINDCallType,多个变量之间采用&链接
mStr_WINDURL = "WINDCallType="+Server.URLEncode(mStr_WINDCallType)
'下列为全局变量
dim mStr_PK_employee_id '主鍵
dim mStr_employee_name '姓名
dim mStr_employee_pwd '密码
dim mStr_employee_type '类型
dim mStr_employee_edu '学历
dim mStr_employee_joindate '参加工作时间
dim mStr_employee_birth '生日
dim mStr_employee_memo '备注
dim mStr_employee_right '权限
dim mStr_dpt_id '部门ID
call InitData()
%>
</HEAD>
<BODY>
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD>
<FONT CLASS="locationhead">您的位置:</FONT>
<A CLASS="locationdata" HREF="Main.asp?<% =mStr_WINDURL%>">员工信息</A>>>
<A CLASS="locationlastdata" HREF="javascript:window.location.reload()"><%if mStr_PK_employee_id="" then Response.write "新增" else Response.write "修改"%></A>
</TD>
</TR>
</TABLE>
<FORM ACTION="Post_Update.asp?<% =mStr_WINDURL%>" ID="Frm_Update" METHOD="post">
打<FONT COLOR=RED>**</FONT>的栏位为必须填写
<TABLE WIDTH="80%" <% Response.write GetTableBorder()%>>
<COLGROUP>
<COL 1 CLASS="TABLEHEAD" WIDTH="100" ALIGN="RIGHT">
<COL 1 CLASS="TABLEDATA">
</COLGROUP>
<TR>
<TD>姓名 </TD>
<TD>
<% if (mStr_PK_employee_id="") then%>
<INPUT STYLE="WIDTH:200px" NAME="employee_name" VALUE='<% Response.write mStr_employee_name%>'>
<%else%>
<INPUT STYLE="WIDTH:200px" NAME="employee_name" VALUE='<% Response.write mStr_employee_name%>' readonly>
<%end if%>
<FONT COLOR=RED>**</FONT>
</TD>
</TR>
<TR>
<TD>密码 </TD>
<TD>
<% if mStr_PK_employee_id="" then%>
<INPUT STYLE="WIDTH:200px" NAME="employee_pwd" VALUE='<% Response.write mStr_employee_pwd%>'>
<FONT COLOR=RED>**</FONT>
<%else%>
<INPUT STYLE="WIDTH:200px" NAME="employee_pwd" >
<FONT COLOR=RED>若不修改密码则请勿填写</FONT>
<%end if%>
</TD>
</TR>
<TR>
<TD>类型 </TD>
<TD>
<SELECT STYLE="HEIGHT:100px;WIDTH:200px" NAME="employee_type">
<OPTION VALUE='员工' <%if mStr_employee_type="员工" then response.write(" selected")%>>员工</OPTION>
<OPTION VALUE='兼职' <%if mStr_employee_type="兼职" then response.write(" selected")%>>兼职</OPTION>
<OPTION VALUE='临时' <%if mStr_employee_type="临时" then response.write(" selected")%>>临时</OPTION>
</SELECT>
<FONT COLOR=RED>**</FONT>
</TD>
</TR>
<TR>
<TD>学历 </TD>
<TD>
<SELECT STYLE="HEIGHT:100px;WIDTH:200px" NAME="employee_edu">
<OPTION VALUE='专科' <%if mStr_employee_edu="专科" then response.write(" selected")%>>专科</OPTION>
<OPTION VALUE='本科' <%if mStr_employee_edu="本科" then response.write(" selected")%>>本科</OPTION>
<OPTION VALUE='研究生' <%if mStr_employee_edu="研究生" then response.write(" selected")%>>研究生</OPTION>
</SELECT>
<FONT COLOR=RED>**</FONT>
</TD>
</TR>
<TR>
<TD>参加工作时间 </TD>
<TD>
<SELECT NAME="employee_joindateYear" ONCHANGE='javascript:window.Frm_Update.employee_joindate.value=ConvertToDate(window.Frm_Update.employee_joindateYear.value,window.Frm_Update.employee_joindateMonth.value,window.Frm_Update.employee_joindateDay.value)'>
<OPTION VALUE='' SELECTED>请选择</OPTION>
<%
if (FormatDate(mStr_employee_joindate,"yyyy")="") then
Call ShowOptionList(Year(Date())-5-gInt_BeginYear,Year(Date())-5,11,Year(Date()))
else
Call ShowOptionList(Val(FormatDate(mStr_employee_joindate,"yyyy"))-5-gInt_BeginYear,Val(FormatDate(mStr_employee_joindate,"yyyy"))-5,11,Val(FormatDate(mStr_employee_joindate,"yyyy")))
end if
%>
</SELECT>年
<SELECT NAME="employee_joindateMonth" ONCHANGE='javascript:window.Frm_Update.employee_joindate.value=ConvertToDate(window.Frm_Update.employee_joindateYear.value,window.Frm_Update.employee_joindateMonth.value,window.Frm_Update.employee_joindateDay.value)'>
<OPTION VALUE='' SELECTED>请选择</OPTION>
<% Call ShowOptionList(1,1,12,FormatDate(mStr_employee_joindate,"mm")) %>
</SELECT>月
<SELECT NAME="employee_joindateDay" ONCHANGE='javascript:window.Frm_Update.employee_joindate.value=ConvertToDate(window.Frm_Update.employee_joindateYear.value,window.Frm_Update.employee_joindateMonth.value,window.Frm_Update.employee_joindateDay.value)'>
<OPTION VALUE='' SELECTED>请选择</OPTION>
<% Call ShowOptionList(1,1,31,FormatDate(mStr_employee_joindate,"dd")) %>
</SELECT>日
<SPAN <%if gInt_BeginYear=0 then response.write "STYLE='DISPLAY:NONE'" %> >
西元:<INPUT STYLE="WIDTH:100px" NAME="employee_joindate" VALUE='<% Response.write mStr_employee_joindate%>' READONLY CLASS="READONLY">
</SPAN>
<FONT COLOR=RED>**</FONT>
</TD>
</TR>
<TR>
<TD>生日 </TD>
<TD>
<SELECT NAME="employee_birthYear" ONCHANGE='javascript:window.Frm_Update.employee_birth.value=ConvertToDate(window.Frm_Update.employee_birthYear.value,window.Frm_Update.employee_birthMonth.value,window.Frm_Update.employee_birthDay.value)'>
<OPTION VALUE='' SELECTED>请选择</OPTION>
<%
if (FormatDate(mStr_employee_birth,"yyyy")="") then
Call ShowOptionList(Year(Date())-40-gInt_BeginYear,Year(Date())-40,51,Year(Date()))
else
Call ShowOptionList(Val(FormatDate(mStr_employee_birth,"yyyy"))-40-gInt_BeginYear,Val(FormatDate(mStr_employee_birth,"yyyy"))-40,51,Val(FormatDate(mStr_employee_birth,"yyyy")))
end if
%>
</SELECT>年
<SELECT NAME="employee_birthMonth" ONCHANGE='javascript:window.Frm_Update.employee_birth.value=ConvertToDate(window.Frm_Update.employee_birthYear.value,window.Frm_Update.employee_birthMonth.value,window.Frm_Update.employee_birthDay.value)'>
<OPTION VALUE='' SELECTED>请选择</OPTION>
<% Call ShowOptionList(1,1,12,FormatDate(mStr_employee_birth,"mm")) %>
</SELECT>月
<SELECT NAME="employee_birthDay" ONCHANGE='javascript:window.Frm_Update.employee_birth.value=ConvertToDate(window.Frm_Update.employee_birthYear.value,window.Frm_Update.employee_birthMonth.value,window.Frm_Update.employee_birthDay.value)'>
<OPTION VALUE='' SELECTED>请选择</OPTION>
<% Call ShowOptionList(1,1,31,FormatDate(mStr_employee_birth,"dd")) %>
</SELECT>日
<SPAN <%if gInt_BeginYear=0 then response.write "STYLE='DISPLAY:NONE'" %> >
西元:<INPUT STYLE="WIDTH:100px" NAME="employee_birth" VALUE='<% Response.write mStr_employee_birth%>' READONLY CLASS="READONLY">
</SPAN>
<FONT COLOR=RED>**</FONT>
</TD>
</TR>
<TR>
<TD>备注 </TD>
<TD>
<TEXTAREA STYLE="HEIGHT:100px;WIDTH:200px" NAME="employee_memo"><% Response.write mStr_employee_memo%> </TEXTAREA>
</TD>
</TR>
<% if mStr_PK_employee_id="" or session("right")=4 then%>
<TR>
<TD>权限 </TD>
<TD>
<SELECT STYLE="HEIGHT:100px;WIDTH:200px" NAME="employee_right">
<OPTION VALUE='1' <%if mStr_employee_right="1" then response.write(" selected")%>>员工</OPTION>
<%if session("right")=2 or session("right")=4 then%>
<OPTION VALUE='2' <%if mStr_employee_right="2" then response.write(" selected")%>>部门经理</OPTION>
<%end if%>
<%if session("right")=3 or session("right")=4 then%>
<OPTION VALUE='3' <%if mStr_employee_right="3" then response.write(" selected")%>>财务</OPTION>
<%end if%>
<%if session("right")=4 then%>
<OPTION VALUE='4' <%if mStr_employee_right="4" then response.write(" selected")%>>总经理</OPTION>
<%end if%>
</SELECT>
<FONT COLOR=RED>**</FONT>
</TD>
</TR>
<%else%>
<TR>
<TD>权限 </TD>
<TD>
<INPUT STYLE="WIDTH:200px" NAME="employee_right2" VALUE='<% Response.write showright(mStr_employee_right)%>' readonly>
<INPUT STYLE="WIDTH:200px" NAME="employee_right" VALUE='<% Response.write (mStr_employee_right)%>' readonly type="hidden">
<FONT COLOR=RED>**</FONT>
</TD>
</TR>
<%end if%>
<TR>
<TD>所属部门 </TD>
<TD>
<SELECT STYLE="HEIGHT:100px;WIDTH:200px" NAME="dpt_id">
<%call listdepartment(mStr_dpt_id)%>
</SELECT>
<FONT COLOR=RED>**</FONT>
</TD>
</TR>
</TABLE>
<TABLE BORDER="0" WIDTH="80%">
<TR>
<TD>
<A HREF="#" ONCLICK="javascript:window.Frm_Update.submit();return false"><IMG SRC="../image/btok.gif" BORDER="0"></A>
<A HREF="#" ONCLICK="javascript:window.Frm_Update.reset();return false"><IMG SRC="../image/btno.gif" BORDER="0"></A>
</TD>
<TD ALIGN="RIGHT">
<% if (mStr_PK_employee_id="") then%>
<INPUT NAME="Continue" TYPE="checkbox" VALUE="1" <% if request.querystring("Continue")<>empty then Response.write "CHECKED"%>>
确定后继续增加资料
<% end if %>
</TD>
</TR>
</TABLE>
<DIV STYLE="DISPLAY:NONE">
<INPUT TYPE="hidden" NAME="PK_employee_id" VALUE='<% Response.write mStr_PK_employee_id%>'>
</DIV>
</FORM>
</BODY>
</HTML>
<%
function InitData()
'初始化
dim Rec_Data '结果集
mStr_PK_employee_id = trim(request.querystring("PK_employee_id"))
if (mStr_PK_employee_id<>"") then
'读取原有数据
set Rec_Data = mCls_wh_employees.GetData(mStr_PK_employee_id)
if (not Rec_Data.eof) then
mStr_employee_name = Server.HTMLEncode(trim(Rec_Data.fields("employee_name") & ""))
mStr_employee_pwd = Server.HTMLEncode(trim(Rec_Data.fields("employee_pwd") & ""))
mStr_employee_type = Server.HTMLEncode(trim(Rec_Data.fields("employee_type") & ""))
mStr_employee_edu = Server.HTMLEncode(trim(Rec_Data.fields("employee_edu") & ""))
mStr_employee_joindate = Server.HTMLEncode(trim(Rec_Data.fields("employee_joindate") & ""))
mStr_employee_birth = Server.HTMLEncode(trim(Rec_Data.fields("employee_birth") & ""))
mStr_employee_memo = Server.HTMLEncode(trim(Rec_Data.fields("employee_memo") & ""))
mStr_employee_right = Server.HTMLEncode(trim(Rec_Data.fields("employee_right") & ""))
mStr_dpt_id = Server.HTMLEncode(trim(Rec_Data.fields("dpt_id") & ""))
end if
Rec_Data.close
if (mStr_PK_employee_id="") then
call ShowMess(16,"对不起,找不到您所要的 [wh_employees]!")
call WindowBack()
end if
else
mStr_employee_name = ""
mStr_employee_pwd = ""
mStr_employee_type = ""
mStr_employee_edu = ""
mStr_employee_joindate = ""
mStr_employee_birth = ""
mStr_employee_memo = ""
mStr_employee_right = ""
mStr_dpt_id = ""
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -