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

📄 emp_od.inc

📁 物业管理和办公自动化系统
💻 INC
字号:
<%
function EmpInfor()
	dim sAccountId, sEmpNo, sEmpName, sGender, sBirthday
	dim sPos, sTitle, sDept, sPost
	dim sWorkDate, sTelecomDate, sEmpDate

	dim sSQL
	sSQL = "select t1.emp_id, t1.emp_no, t1.name, t2.gender_desc as gender, t1.birthday, " & _
				" t1.work_date, t1.telecom_date, t1.emp_date, " & _
				" t4.position_desc as pos, t5.title_desc as title, t6.parent_node_id as depart_id, t6.node_name as post" & _
				" from t_employee t1" & _
				" left join t_gender t2 on t1.gender = t2.gender_id" & _
				" left join t_position t4 on t1.pos = t4.position_id" & _
				" left join t_title t5 on t1.title = t5.title_id" & _
				" left join t_node t6 on t1.node_id = t6.node_id" & _
				" where serial = " & pEmpSerial & _
				" and t1.co_id = " & GetCoId & " and t1.isdummy = 0 and dismissed = 0"
	dim crs, rs
	set crs = New CRecordset
	set rs = crs.Open(dbLocal, sSQL)
	
	'' 若找不到相应的记录,则跳转到出错页面
	if rs.EOF then
			Response.Clear
			Server.Transfer("../common/error.asp")
			Response.end
	end if

	sAccountId = crs.GetValue("emp_id")			'' 用户名
	sEmpNo = crs.GetValue("emp_no")			'' 工号
	sEmpName = crs.GetValue("name")			'' 姓名
	sGender = crs.GetValue("gender")			'' 性别
	sBirthday = crs.GetValue("birthday")		'' 出生日期

	sPos = crs.GetValue("pos")						'' 职务
	sTitle = crs.GetValue("title")					'' 职称
	sDept = crs.GetValue("depart_id")		'' 部门标识
	sPost = crs.GetValue("post")					'' 现任岗位

	sWorkDate = crs.GetValue("work_date")				'' 参加工作年月
	sTelecomDate = crs.GetValue("telecom_date")		'' 进邮电年月
	sEmpDate = crs.GetValue("emp_date")				'' 进本单位年月


	'' 部门名称
	if CStr(sDept <> "") then sDept = DLookUp(dbLocal, "t_node", "node_name", "node_id=" & sDept)
	
	EmpInfor = _
		"<table cellspacing=1 cellpadding=3 bgcolor=""silver"" width=600 border=0 style=""table-layout:fixed"">" & vbLF & _
		"	<tr style=""display:none"">" & vbLF & _
		"	<td width=85 nowrap>这一行仅用于控制表格宽度</td><td width=75></td>" & vbLF & _
		"	<td width=75></td><td width=110></td>" & vbLF & _
		"	<td width=65></td><td width=60></td>" & vbLF & _
		"	<td width=90></td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr style=""color:white;font-weight:600"">" & vbLF & _
		"		<td colspan=7 align=center background=""../images/bg/bnbg.gif"">员 工 基 本 情 况 表</td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white height=25>" & vbLF & _
		"		<td align=center>姓 名</td><td class=tdValue title=""" & sEmpName & """ nowrap>" & sEmpName & "</td>" & vbLF & _
		"		<td align=center>所在部门</td><td class=tdValue title=""" & sDept & """ nowrap>" & sDept & "</td>" & vbLF & _
		"		<td align=center>现任岗位</td><td class=tdValue title=""" & sPos & """ nowrap>" & sPos & "</td>" & vbLF & _
		"		<td rowspan=5><img border=1 width=85 height=110 src=""photo/s10072.gif""></td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white height=25>" & vbLF & _
		"		<td align=center>工 号</td><td class=tdValue title=""" & sEmpNo & """ nowrap>" & sEmpNo & "&nbsp;</td>" & vbLF & _
		"		<td align=center>出生年月</td><td class=tdValue title=""" & sBirthday & """ nowrap>" & sBirthday & "</td>" & vbLF & _
		"		<td align=center>性 别</td><td class=tdValue title=""" & sGender & """ nowrap>" & sGender & "</td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white height=25>" & vbLF & _
		"		<td align=center>职 务</td><td class=tdValue title=""" & sPos & """ nowrap>" & sPos & "</td>" & vbLF & _
		"		<td align=center>职 称</td><td class=tdValue title=""" & sTitle & """ colspan=3 nowrap>" & sTitle & "</td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white height=25>" & vbLF & _
		"		<td align=center>参加工作年月</td><td class=tdValue title=""" & sWorkDate & """ nowrap>" & sWorkDate & "</td>" & vbLF & _
		"		<td align=center>进邮电年月</td><td colspan=3 class=tdValue title=""" & sTelecomDate & """ nowrap>" & sTelecomDate & "</td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white height=25>" & vbLF & _
		"		<td align=center>进本单位年月</td><td class=tdValue title=""" & sEmpDate & """ nowrap>" & sEmpDate & "</td>" & vbLF & _
		"		<td align=center>&nbsp;</td><td colspan=3 class=tdValue>&nbsp;</td>" & vbLF & _
		"	</tr>" & vbLF & _
		"</table>" & vbLF & "<br>"
end function

function FormDismiss()
'	dim sDismissDate, sDismissInfor
	FormDismiss = _
		"<form method=post name=formDismiss action=""emp_od.asp"">" & vbLF & _
		"<input type=""hidden"" name=""emp_serial"" value=""" & pEmpSerial & """>" & vbLF & _
		"<table cellspacing=1 cellpadding=3 bgcolor=""silver"" width=600 border=0>" & vbLF & _
		"	<tr bgcolor=""#0040a0"" style=""color:white;font-weight:600"">" & vbLF & _
		"		<td colspan=2 align=center>填 写 离 职 信 息</td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white height=25>" & vbLF & _
		"		<td width=83 align=center>离职时间</td>" & vbLF & _
		"		<td width=""*""><input type=""text"" name=""dismiss_date"" value=""" & sDismissDate & """ size=81 maxlength=20></td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white height=25>" & vbLF & _
		"		<td width=83 align=center>补充说明</td>" & vbLF & _
		"		<td width=""*""><textarea name=""dismiss_infor"" cols=80 rows=9>" & sDismissInfor & "</textarea></td>" & vbLF & _
		"	</tr>" & vbLF & _
		"</table>" & vbLF & _
		"<table cellspacing=1 cellpadding=3 bgcolor=white width=600 border=0>" & vbLF & _
		"	<tr><td align=center>" & vbLF & _
		"			<img style=""cursor:hand"" border=0 src=""../images/button/dismiss.gif"" name=""btnDismiss"">" & vbLF & _
		"			&nbsp;&nbsp;&nbsp;&nbsp;" & vbLF & _
		"			<img style=""cursor:hand"" border=0 src=""../images/button/cancel.gif"" onclick=""location.href='emp_op.asp?emp_serial=" & pEmpSerial & "';"">" & vbLF & _
		"			</td></tr>" & vbLF & _
		"</table>" & vbLF & _
		"</form>" & vbLF
end function

sub DismissEmp()
	dim sSQL, crs, rs
	dim sDept, sPost, sAccountId, sEmpNo, sEmpName, sBirthday, sGender, sFolk, sEducation, sGraduateDate, sGraduateSchool, sSpeciality, sPolitical, sPos, sTitle, sMarriage, sHAddr, sHZip, sHPhone, sMobile, sWorkDate, sTelecomDate, sEmpDate, sEmail, sRemark, sNative
	dim sId	'' 身份证号码

	sSQL = "select t1.emp_id, t1.emp_no, t1.name, t1.id, t2.gender_desc as gender, t1.birthday, t3.education_desc as education, " & _
				" t1.graduate_date, t1.graduate_school, t1.specialty, t1.home_address, home_phone, home_zip, " & _
				" t1.mobile, t1.work_date, t1.telecom_date, t1.emp_date, t1.co_email as email, " & _
				" t4.position_desc as pos, t5.title_desc as title, t6.parent_node_id as dept_id, t6.node_name as post, " & _
				" t7.folk_desc as folk, t8.political_desc as political, t9.marriage_desc as marriage, t1.remark, t1.native" & _
				" from t_employee t1" & _
				" left join t_gender t2 on t1.gender = t2.gender_id" & _
				" left join t_education t3 on t1.education = t3.education_id" & _
				" left join t_position t4 on t1.pos = t4.position_id" & _
				" left join t_title t5 on t1.title = t5.title_id" & _
				" left join t_node t6 on t1.node_id = t6.node_id" & _
				" left join t_folk t7 on t1.folk = t7.folk_id" & _
				" left join t_political t8 on t1.political = t8.political_id" & _
				" left join t_marriage t9 on t1.marriage = t9.marriage_id" & _
				" where serial = " & pEmpSerial & _
				" and t1.co_id = 1 and t1.isdummy = 0"
	set crs = New CRecordset
	set rs = crs.Open(dbLocal, sSQL)
	
	'' 若找不到相应的记录,则跳转到出错页面
	if rs.EOF then
			Response.Clear
			Server.Transfer("../common/error.asp")
			Response.end
	end if

	sAccountId = crs.GetValue("emp_id")			'' 用户名
	sEmpNo = crs.GetValue("emp_no")			'' 工号
	sEmpName = crs.GetValue("name")			'' 姓名
	sGender = crs.GetValue("gender")			'' 性别
	sBirthday = crs.GetValue("birthday")		'' 出生日期
	sEducation = crs.GetValue("education")	'' 教育程度
	sGraduateDate = crs.GetValue("graduate_date")			'' 毕业时间
	sGraduateSchool = crs.GetValue("graduate_school")		'' 毕业学校
	sSpeciality = crs.GetValue("specialty")		'' 专业
	sPos = crs.GetValue("pos")						'' 职务
	sTitle = crs.GetValue("title")					'' 职称
	sDept = crs.GetValue("dept_id")				'' 部门标识
	sPost = crs.GetValue("post")					'' 现任岗位
	sFolk = crs.GetValue("folk")					'' 民族
	sPolitical = crs.GetValue("political")			'' 政治面貌
	sMarriage = crs.GetValue("marriage")		'' 婚姻状况
	sHAddr = crs.GetValue("home_address")	'' 家庭地址
	sHZip = crs.GetValue("home_zip")			'' 邮政编码
	sHPhone = crs.GetValue("home_phone")	'' 住宅电话
	sMobile = crs.GetValue("mobile")				'' 移动电话
	sWorkDate = crs.GetValue("work_date")				'' 参加工作年月
	sTelecomDate = crs.GetValue("telecom_date")		'' 进邮电年月
	sEmpDate = crs.GetValue("emp_date")				'' 进本单位年月
	sId = crs.GetValue("id")							'' 身份证号码
	sRemark = crs.GetValue("remark")			'' 补充信息
	sNative = crs.GetValue("native")

	sEmail = sAccountId & "@infortower.com"

	'' 部门名称
	if CStr(sDept) <> "" then sDept = DLookUp(dbLocal, "t_node", "node_name", "node_id=" & sDept)

	sSQL = "update t_employee set dismissed = 1 where serial = " & pEmpSerial
	''response.write sSQL & "<br><br>"
	call ExecuteSQL(dbLocal, sSQL)

	sSQL = "update t_account set status = 1 where account_id = " & ToSQL(sAccountId, "Text")
	''response.write sSQL & "<br><br>"
	call ExecuteSQL(dbLocal, sSQL)


	sSQL = "insert into t_empdismissed(emp_serial, account_id, emp_no, name, gender, birthday, id, " & _
				" folk, native, home_phone, home_address, home_zip, mobile," & _
				" specialty, education, graduate_date, graduate_school, marriage, political, " & _
				" dept, post, pos, title, work_date, telecom_date, emp_date, " & _
				" co_email, co_name, remark, dismiss_date, dismiss_infor, dismiss_op)" & _
				" values(" & pEmpSerial & ", " & ToSQL(sAccountId, "Text") & ", " & ToSQL(sEmpNo,"Text") & ", " & ToSQL(sEmpName,"Text") & _
				", " & ToSQL(sGender,"Text") & ", " & ToSQL(sBirthday, "Text") & ", " & ToSQL(sId, "Text") & ", " & ToSQL(sFolk,"Text") & _
				", " & ToSQL(sNative, "Text") & ", " & ToSQL(sHPhone, "Text") & ", " & ToSQL(sHAddr,"Text") & ", " & ToSQL(sHZip,"Text") & _
				", " & ToSQL(sMobile, "Text") & ", " & ToSQL(sSpeciality, "Text") & ", " & ToSQL(sEducation, "Text") & ", " & ToSQL(sGraduateDate, "Text") & _
				", " & ToSQL(sGraduateSchool, "Text") & ", " & ToSQL(sMarriage, "Text") & ", " & ToSQL(sPolitical, "Text") & "," & ToSQL(sDept, "Text") & _
				", " & ToSQL(sPost, "Text") & ", " & ToSQL(sPos, "Text") & ", " & ToSQL(sTitle, "Text") & ", " & ToSQL(sWorkDate, "Text") & _
				", " & ToSQL(sTelecomDate, "Text") & ", " & ToSQL(sEmpDate, "Text") & ", " & ToSQL(sEmail, "Text") & ", " & ToSQL(GetCoName, "Text") & _
				", " & ToSQL(sRemark, "Text") & ", " & ToSQL(sDismissDate, "Text") & ", " & ToSQL(sDismissInfor, "Text") & ", " & ToSQL(GetUserName, "Text") & _
				")"
	call ExecuteSQL(dbLocal, sSQL)
	Response.Redirect("emp_odl.asp")
	Response.End
end sub


Function TableLink()
	TableLink = _
		"<table width=600 cellspacing=0 cellpadding=0 border=0 align=center>" & _
		"<tr height=10>" & _ 
		"	<td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & _
		"</tr>" & _
		"<tr>" & _
		"	<td width=600>&nbsp;" & _
		"		<img src=""../images/goto.gif"">&nbsp;<a href=""emp_ol.asp"">在职员工查询</a>" & _
		"		&nbsp;&nbsp;&nbsp;" & _
		"		<img src=""../images/goto.gif"">&nbsp;<a href=""emp_odl.asp"">离职员工查询</a></td>" & _
		"</tr>" & _
		"</table>"
End Function

%>

⌨️ 快捷键说明

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