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

📄 basic.inc

📁 物业管理和办公自动化系统
💻 INC
字号:
<%
function TableFormEmp()
	dim sDepartmentId, sEmpId, sEmpNo, sEmpName, sBirthday, sGender, sFolk, sEducation, sGraduateDate, sGraduateSchool, sSpeciality, sPolitical, sPos, sTitle, sMarriage, sHAddr, sHZip, sHPhone, sMobile, sWorkDate, sTelecomDate, sEmpDate, sEmail

	dim sNative, sPersonalId

	dim sSQL
	sSQL = "select t1.emp_id, t1.emp_no, t1.name, t1.gender, t1.birthday, t1.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, " & _
				" t1.pos, t1.title, t6.parent_node_id as department_id, t1.node_id as position_id, t6.node_name as position_name, " & _
				" t1.folk, t1.native, t1.id, t1.political, t1.marriage" & _
				" from t_employee t1" & _
				" left join t_node t6 on t1.node_id = t6.node_id" & _
				" where serial = " & pEmpSerial & _
				" and t1.co_id = 1 and t1.isdummy = 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

	sDepartmentId = crs.GetValue("department_id")		'' 部门标识
	sPositionId = crs.GetValue("position_id")			'' 岗位标识
	sEmpid = 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")					'' 职称

	sFolk = crs.GetValue("folk")					'' 民族
	sNative = crs.GetValue("native")				'' 籍贯
	sPersonalId = crs.GetValue("id")		'' 身份证号码
	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")				'' 进本单位年月

	sEmail = sEmpId & "@infortower.com"

	crs.Close()



	' 根据该员工的岗位获取其所在部门之下所有的岗位信息
	sDepartment = ""
	sSQL = "select node_id, node_name from t_node" & _
			" where parent_node_id = (select parent_node_id from t_node where node_id = " & ToSQL(sPositionId, "Number") & ")" & _
			" order by node_name"
	set crs = New CRecordset
	set rs = crs.Open(dbLocal, sSQL)

	while not rs.EOF 
		if sDepartment <> "" then sDepartment = sDepartment & "&"
		sDepartment = sDepartment & crs.GetValue("node_id") & "?" & crs.GetValue("node_name")
		rs.MoveNext
	wend
	crs.Close()

	if sDepartment <> "" then sDepartment = sDepartmentId & ":" & sDepartment
		
	TableFormEmp = _
		"	<tr bgcolor=white>" & vbLF & _
		"		<td width=77 align=center>姓 名</td>" & vbLF & _
		"		<td width=93><input type=""text"" name=""name"" value=""" & sEmpName & """ size=12 maxlength=10></td>" & vbLF & _
		"		<td width=77 align=center>部 门</td>" & vbLF & _
		"		<td width=100><select name=""department_id"" style=""width:96"">" & _
						DepartPosiSelectOptions(dbLocal, sDepartment) & _
						"</select></td>" & vbLF & _
		"		<td width=60 align=center>岗 位</td>" & vbLF & _
		"		<td width=113><select name=""position_id"" style=""width:106"">" & vbLF & _
		"				<option value=""-1"" style=""color:red"">-请选择岗位-</option>" & vbLF & _
						"</select></td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white>" & vbLF & _
		"		<td width=77 align=center>工 号</td>" & vbLF & _
		"		<td width=93><input type=""text"" name=""emp_no"" value=""" & sEmpNo & """ size=12 maxlength=15></td>" & vbLF & _
		"		<td width=77 align=center>出生年月</td>" & vbLF & _
		"		<td><input type=""text"" name=""birthday"" value=""" & sBirthday & """ size=14 maxlength=25></td>" & vbLF & _
		"		<td width=60 align=center>性 别</td>" & vbLF & _
		"		<td><select name=""gender"" style=""width:106"">" & _
						selectOptions(dbLocal, "t_gender", "gender_id", "gender_desc", sGender, "") & vbLF & _
						"</select></td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white>" & vbLF & _
		"		<td width=77 align=center>民 族</td>" & vbLF & _
		"		<td width=93><select name=""folk"" style=""width:86"">" & vbLF & _
						selectOptions(dbLocal, "t_folk", "folk_id", "folk_desc", sFolk, "") & vbLF & _
						"</select></td>" & vbLF & _
		"		<td width=77 align=center>籍 贯</td>" & vbLF & _
		"		<td><input type=""text"" name=""native"" value=""" & sNative & """ size=14 maxlength=20></td>" & vbLF & _
		"		<td width=60 align=center>身份证号</td>" & vbLF & _
		"		<td><input type=""text"" name=""creditid"" value=""" & sPersonalId & """ size=16 maxlength=20></td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white>" & vbLF & _
		"		<td width=77 align=center>最高学历</td>" & vbLF & _
		"		<td colspan=2><select name=""education"" style=""width:86"">" & vbLF & _
						selectOptions(dbLocal, "t_education", "education_id", "education_desc", sEducation, "") & vbLF & _
						"</select></td>" & vbLF & _
		"		<td align=center>学历取得时间</td>" & vbLF & _
		"		<td colspan=2><input type=""text"" name=""graduate_date"" value=""" & sGraduateDate & """ size=27 maxlength=20></td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white>" & vbLF & _
		"		<td width=77 align=center>原毕业学校</td>" & vbLF & _
		"		<td colspan=2><input type=""text"" name=""graduate_school"" value=""" & sGraduateSchool & """ size=27 maxlength=25></td>" & vbLF & _
		"		<td align=center>所学专业</td>" & vbLF & _
		"		<td colspan=2><input type=""text"" name=""specialty"" value=""" & sSpeciality & """ size=27 maxlength=25></td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white>" & vbLF & _
		"		<td width=77 align=center>职 务</td>" & vbLF & _
		"		<td width=93><select name=""pos"" style=""width:86"">" & vbLF & _
						selectOptions(dbLocal, "t_position", "position_id", "position_desc", sPos, "") & vbLF & _
						"</select></td>" & vbLF & _
		"		<td width=77 align=center>职 称</td>" & vbLF & _
		"		<td><select name=""title"" style=""width:96"">" & vbLF & _
						selectOptions(dbLocal, "t_title", "title_id", "title_desc", sTitle, "") & vbLF & _
						"</select></td>" & vbLF & _
		"		<td width=60 align=center>政治面貌</td>" & vbLF & _
		"		<td><select name=""political"" style=""width:106"">" & vbLF & _
						selectOptions(dbLocal, "t_political", "political_id", "political_desc", sPolitical, "") & vbLF & _
						"</select></td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white>" & vbLF & _
		"		<td width=77 align=center>家庭地址</td>" & vbLF & _
		"		<td colspan=3><input type=""text"" name=""home_address"" value=""" & sHAddr & """ size=45 maxlength=25></td>" & vbLF & _
		"		<td width=60 align=center>邮政编码</td>" & vbLF & _
		"		<td><input type=""text"" name=""home_zip"" value=""" & sHZip & """ size=16 maxlength=8></td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white>" & vbLF & _
		"		<td width=77 align=center>家庭电话</td>" & vbLF & _
		"		<td width=93><input type=""text"" name=""home_phone"" value=""" & sHPhone & """ size=12 maxlength=25></td>" & vbLF & _
		"		<td width=77 align=center>手机或BP机</td>" & vbLF & _
		"		<td><input type=""text"" name=""mobile"" value=""" & sMobile & """ size=14 maxlength=25></td>" & vbLF & _
		"		<td width=60 align=center>婚姻状况</td>" & vbLF & _
		"		<td><select name=""marriage"" style=""width:106"">" & vbLF & _
						selectOptions(dbLocal, "t_marriage", "marriage_id", "marriage_desc", sMarriage, "") & vbLF & _
						"</select></td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white>" & vbLF & _
		"		<td width=77 align=center>参加工作年月</td>" & vbLF & _
		"		<td colspan=2><input type=""text"" name=""work_date"" value=""" & sWorkDate & """ size=27 maxlength=25></td>" & vbLF & _
		"		<td align=center>进邮电年月</td>" & vbLF & _
		"		<td colspan=3><input type=""text"" name=""telecom_date"" value=""" & sTelecomDate & """ size=27 maxlength=25></td>" & vbLF & _
		"	</tr>" & vbLF & _
		"	<tr bgcolor=white>" & vbLF & _
		"		<td width=77 align=center>进本单位年月</td>" & vbLF & _
		"		<td colspan=2><input type=""text"" name=""emp_date"" value=""" & sEmpDate & """ size=27 maxlength=25></td>" & vbLF & _
		"		<td align=center>电子信箱</td>" & vbLF & _
		"		<td colspan=2 wrap title=""" & sEmail & """>" & Bref(sEmail, 28) & "</td>" & vbLF & _
		"	</tr>"
end function

'************************************************************************************************
' 函数名 : DepartmentPositionSelectOptions
' 输 入 : conn	: 数据库连接对象
'	      : sql	: 获取数据的sql语句 
'	      : sSelectedDeptValue	: 选中的部门包含岗位信息的值
' 输 出 : <option></option>对。
'		其中option的value值中不仅包含了部门标识,还包括部门下所有岗位的标识和名称,option的显示值为部门名称
' 功能描述: 部门和岗位
' 调用模块: 
' 作 者 : 周秋舫
' 日 期 : 2002-07-16
' 版 本 : 
'************************************************************************************************
function DepartPosiSelectOptions(db, sSelectedDeptValue)
	dim sSQL, rsDepart, rsPosi, crsDepart, crsPosi
	dim iDepartmentId, sDepartmentName			'' 部门标识、部门名称
	dim iPositionId, sPositionName						'' 岗位标识、岗位名称
	dim sPositions', sTemp
	dim sDeptValue
	dim iCounter
	dim sTemp

	sSQL = "select node_id, node_name from t_node" & _
				" where co_id = " & GetCoId & _
				" and node_level = 2" & _
				" order by node_name"

	iCounter = 0
	set crsDepart = New CRecordset
	set rsDepart = crsDepart.Open(db, sSQL)
	while Not rsDepart.EOF
		iCounter = iCounter + 1
		iDepartmentId		= crsDepart.GetValue("node_id")
		sDepartmentName	= crsDepart.GetValue("node_name") 

		sSQL = "select node_id, node_name from t_node" & _
						" where parent_node_id = " & iDepartmentId & _
						" order by node_name"
		set crsPosi = New CRecordset
		set rsPosi = crsPosi.Open(db, sSQL)
		sPositions = ""
		while Not rsPosi.EOF
				iPositionId = crsPosi.GetValue("node_id")
				sPositionName = crsPosi.GetValue("node_name")
				if sPositions <> "" then sPositions = sPositions & "&"
				sPositions = sPositions & iPositionId & "?" & sPositionName
				rsPosi.MoveNext
		wEnd
		rsPosi.close
		Set rsPosi = nothing

		if sPositions <> "" then 
				sDeptValue = iDepartmentId & ":" & sPositions
		else
				sDeptValue = iDepartmentId
		end if

		if LCase(CStr(sDeptValue)) = LCase(CStr(sSelectedDeptValue)) then
			sTemp = sTemp & "<option value=""" & sDeptValue & ":" & sPositions & """ selected>" & sDepartmentName & "</option>" & vbLF
		else
			sTemp = sTemp & "<option value=""" & sDeptValue & ":" & sPositions & """>" & sDepartmentName & "</option>" & vbLF
		end if
		rsDepart.MoveNext
	wEnd
	rsDepart.close
	Set rsDepart = nothing

	if sSelectedDeptValue = "" then sTemp = "<option value=""-1"" style=""color:red"">—请选择部门—</option>" & vbLF & sTemp

	DepartPosiSelectOptions  = sTemp
end function


function UpdateBasic()
	dim sEmpSerial, sName, sNodeId, sEmpNo, sBirthday, sGender, sFolk, sNative, sId, sEducation, sGraduateDate, sGraduateSchool, sSpecialty
	dim sPos, sTitle, sPolitical, sHAddr, sHZip, sHPhone, sMobile, sMarriage, sWorkDate, sTeleDate, sEmpDate
	dim sSQL
	sEmpSerial = GetParam("emp_serial")		'' 标识号
	sName = GetParam("name")					'' 员工姓名
	sNodeId = GetParam("position_id")			'' 岗位
	sEmpNo = GetParam("emp_no")				'' 工号
	sBirthday = GetParam("birthday")			'' 出生年月
	sGender = GetParam("gender")				'' 性别
	sFolk = GetParam("folk")						'' 民族
	sNative = GetParam("native")					'' 籍贯
	sId = GetParam("creditid")						'' 身份证号
	sEducation = GetParam("education")		'' 最高学历
	sGraduateDate = GetParam("graduate_date")			'' 毕业时间
	sGraduateSchool = GetParam("graduate_school")		'' 毕业学校
	sSpecialty = GetParam("specialty")			'' 所学专业
	sPos = GetParam("pos")							'' 职务
	sTitle = GetParam("title")						'' 职称
	sPolitical = GetParam("political")				'' 政治面貌
	sHAddr = GetParam("home_address")		'' 家庭地址
	sHZip = GetParam("home_zip")				'' 邮政编码
	sHPhone = GetParam("home_phone")		'' 家庭电话
	sMobile	= GetParam("mobile")				'' 手机或BP机
	sMarriage = GetParam("marriage")			'' 婚姻状况
	sWorkDate = GetParam("work_date")		'' 参加工作年月	
	sTeleDate = GetParam("telecom_date")	'' 进邮电年月
	sEmpDate = GetParam("emp_date")		'' 进本单位年月

	sSQL = "update t_employee set name = " & ToSQL(sName, "Text") & _
		", node_id = " & ToSQL(sNodeId, "Number") & _
		", emp_no = " & ToSQL(sEmpNo, "Text") & _
		", birthday = " & ToSQL(sBirthday, "Text") & _
		", gender = " & ToSQL(sGender, "Number") & _
		", folk = " & ToSQL(sFolk, "Number") & _
		", native = " & ToSQL(sNative, "Text") & _
		", id = " & ToSQL(sId, "Text") & _ 
		", education = " & ToSQL(sEducation, "Number") & _
		", graduate_date = " & ToSQL(sGraduateDate, "Text") & _
		", graduate_school = " & ToSQL(sGraduateSchool, "Text") & _
		", specialty = " & ToSQL(sSpecialty, "Text") & _
		", pos = " & ToSQL(sPos, "Number") & _
		", title = " & ToSQL(sTitle, "Number") & _
		", political = " & ToSQL(sPolitical, "Number") & _
		", home_address = " & ToSQL(sHAddr, "Text") & _
		", home_zip = " & ToSQL(sHZip, "Text") & _
		", home_phone = " & ToSQL(sHPhone, "Text") & _
		", mobile = " & ToSQL(sMobile, "Text") & _
		", marriage = " & ToSQL(sMarriage, "Text") & _
		", work_date = " & ToSQL(sWorkDate, "Text") & _
		", telecom_date = " & ToSQL(sTeleDate, "Text") & _
		", emp_date = " & ToSQL(sEmpDate, "Text") & _
		" where serial = " & ToSQL(sEmpSerial, "Number")

	'response.write sSQL & "<br>"
	call ExecuteSQL(dbLocal, sSQL)
end function
%>

⌨️ 快捷键说明

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