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

📄 pcard_e.inc

📁 物业管理和办公自动化系统
💻 INC
字号:
<%
Function CardForm()
	dim sSQL, crs, rs
	dim sOwner, sCardGroup, sIsPublic, sName, sGender, sPost, sCName, sCAddr, sCZip, sCPhone, sHAddr, sHZip, sHPhone
	dim sFax, sBeep, sMobile, sEmail, sMemo
	dim sActionLinks

	'' 如果是更新操作,则根据通讯录的序列号获取详细信息
	if sAction = "modify" then
			sSQL = "select * from t_personalcard where serial = " & iCardSerial & " and emp_serial = " & iEmpSerial
		
			set crs = New CRecordset
			set rs = crs.Open(dbLocal, sSQL)

			'' 居然找不到通讯录信息的记录,那肯定是个莫名的错误
			if rs.EOF then
				Server.Transfer("../common/error.asp")
				Response.end
			end if

			'' 获取任务信息的各种数据
			sOwner		= crs.GetValue("emp_serial")				'' 名片属主
			sCardGroup = crs.GetValue("card_group")
			sIsPublic	= crs.GetValue("ispublic")
			sName		= crs.GetValue("name")
			sGender	= crs.GetValue("gender")
			sPost			= crs.GetValue("post")
			sCName	= crs.GetValue("company_name")
			sCAddr		= crs.GetValue("company_addr")
			sCZip		= crs.GetValue("company_zip")
			sCPhone	= crs.GetValue("company_phone")
			sHAddr		= crs.GetValue("home_addr")
			sHZip		= crs.GetValue("home_zip")
			sHPhone	= crs.GetValue("home_phone")
			sFax			= crs.GetValue("fax")
			sBeep		= crs.GetValue("beep")
			sMobile		= crs.GetValue("mobile")
			sEmail		= crs.GetValue("email")
			sMemo		= crs.GetValue("memo")
			crs.Close()
	end if
	
	'' 新建时,sOwner肯定为空,和iEmpSerial不可能相等,因此下面这句判断肯定是针对修改名片信息而言
	if sAction = "modify" then	'' 是我自己的名片,有修改和删除的权限,因此显示修改和删除的链接
			sActionLinks = _
					"<tr bgcolor=white height=30>" & vbLF & _
					"	<td colspan=8 align=center>" & vbLF & _
					"		<img border=0 src=""../images/button/update.gif"" onclick=""btnUpdate_OnClick()"" style=""cursor:hand"">" & vbLF & _
					"		&nbsp;&nbsp;&nbsp;&nbsp;" & vbLF & _
					"		<img border=0 src=""../images/button/delete.gif"" onclick=""btnDelete_OnClick()"" style=""cursor:hand"">" & vbLF & _
					"		&nbsp;&nbsp;&nbsp;&nbsp;" & vbLF & _
					"		<img border=0 src=""../images/button/cancel.gif"" onclick=""btnCancel_OnClick()"" style=""cursor:hand"">" & vbLF & _
					"	</td>" & vbLF & _
					"</tr>" & vbLF
	else
		sActionLinks = _
				"<tr bgcolor=white height=30>" & vbLF & _
				"	<td colspan=8 align=center>" & vbLF & _
				"		<img border=0 src=""../images/button/add.gif"" onclick=""btnAdd_OnClick()"" style=""cursor:hand"">" & vbLF & _
				"		&nbsp;&nbsp;&nbsp;&nbsp;" & vbLF & _
				"		<img border=0 src=""../images/button/cancel.gif"" onclick=""btnReturn_OnClick()"" style=""cursor:hand"">" & vbLF & _
				"	</td>" & vbLF & _
				"</tr>" & vbLF
	end if



	'' TableTitle函数定义在../common/commonpage.inc
	CardForm = _
		"<form method=""post"" name=""frmEdit"" action=""pcard_e.asp"">" & vbLF & _
		"<input type=""hidden"" name=""serial"" value=""" & iCardSerial & """>" & vbLF & _
		"<table cellspacing=1 cellpadding=0 width=600 border=0 align=center bgcolor=silver>" & vbLF & _
		"<tr height=20 style=""color:white;font-weight:600"">" & vbLF & _
		"		<td background=""../images/bg/bnbg.gif"" align=center colspan=8>编 辑 通 讯 录 信 息</td></tr>" & _
		"<tr bgcolor=white height=30>" & _
		"		<td width=70 align=center>姓  名:</td>" & vbLF & _
		"		<td width=75><input type=""text"" name=""name"" value=""" & sName & """ size=10 maxlength=10></td>" & vbLF & _
		"		<td width=70 align=center>性  别:</td>" & vbLF & _
		"		<td width=90><select name=""gender"" style=""width:86"">" & _
						SelectOptions(dbLocal, "t_gender", "gender_id", "gender_desc", sGender, "") & _
						"</select></td>" & vbLF & _
		"		<td width=70 align=center>类  别:</td>" & vbLF & _
		"		<td width=90><select name=""card_group"" style=""width:60"">" & _
						SelectOptions(dbLocal, "t_personalcardgroup", "group_id", "group_desp", sCardGroup, "emp_serial=" & iEmpSerial) & _
						"</select></td>" & vbLF & _
		"		<td width=65 align=center>是否公开:</td>" & vbLF & _
		"		<td width=60><input type=""checkbox"" name=""ispublic""></td></tr>" & vbLF & _
		"<tr bgcolor=white height=30>" & vbLF & _
		"		<td align=center>公司名称:</td>" & vbLF & _
		"		<td colspan=7><input type=""text"" name=""company_name"" value=""" & sCName & """ size=85 maxlength=25></td></tr>" & vbLF & _
		"<tr bgcolor=white height=30>" & vbLF & _
		"		<td align=center>公司地址:</td>" & vbLF & _
		"		<td colspan=5><input type=""text"" name=""company_addr"" value=""" & sCAddr & """ size=65 maxlength=32></td>" & vbLF & _
		"		<td align=center>邮政编码:</td>" & _
		"		<td><input type=""text"" name=""company_zip"" value=""" & sCZip & """ size=8 maxlength=8></td></tr>" & vbLF & _
		"<tr bgcolor=white height=30>" & vbLF & _
		"		<td align=center>职务职称:</td>" & vbLF & _
		"		<td><input type=""text"" name=""post"" value=""" & sPost & """ size=10 maxlength=20></td>" & vbLF & _
		"		<td align=center>单位电话:</td>" & _
		"		<td><input type=""text"" name=""company_phone"" value=""" & sCPhone & """ size=13 maxlength=25></td>" & vbLF & _
		"		<td align=center>电子信箱:</td>" & vbLF & _
		"		<td colspan=3><input type=""text"" name=""email"" value=""" & sEmail & """ size=34 maxlength=50></td></tr>" & vbLF & _
		"<tr bgcolor=white height=30>" & vbLF & _
		"		<td align=center>家庭地址:</td>" & vbLF & _
		"		<td colspan=5><input type=""text"" name=""home_addr"" value=""" & sHAddr & """ size=65 maxlength=32></td>" & vbLF & _
		"		<td align=center>邮政编码:</td>" & vbLF & _
		"		<td><input type=""text"" name=""home_zip"" value=""" & sHZip & """ size=8 maxlength=8></td></tr>" & vbLF & _
		"<tr bgcolor=white height=30>" & vbLF & _
		"		<td align=center>住宅电话:</td>" & vbLF & _
		"		<td><input type=""text"" name=""home_phone"" value=""" & sHPhone & """ size=10 maxlength=20></td>" & vbLF & _
		"		<td align=center>移动电话:</td>" & vbLF & _
		"		<td><input type=""text"" name=""mobile"" value=""" & sMobile & """ size=13 maxlength=25></td>" & vbLF & _
		"		<td align=center> BP 机:</td>" & vbLF & _
		"		<td><input type=""text"" name=""beep"" value=""" & sBeep & """ size=13 maxlength=25></td>" & vbLF & _
		"		<td align=center>传  真:</td>" & vbLF & _
		"		<td><input type=""text"" name=""fax"" value=""" & sFax & """ size=8 maxlength=25></td></tr>" & vbLF & _
		"<tr bgcolor=white height=80>" & vbLF & _
		"		<td align=center>备注信息:</td>" & vbLF & _
		"		<td colspan=7><textarea name=""memo"" rows=5 cols=84>" & sMemo & "</textarea></td></tr>" & vbLF & _
		sActionLinks  & vbLF & _
		"</table>" & vbLF & _
		"</form>" & vbLF & _
		"<script>frmEdit.ispublic.checked=" & LCase(CBool(sIsPublic)) & ";</script>" & _
		"<br>"
End Function

Function TableLink()
	TableLink = _
		"<table width=600 cellspacing=0 cellpadding=0 border=0 align=center>" & vbLF & _
		"<tr height=10>" & vbLF & _ 
		"	<td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & vbLF & _
		"</tr>" & vbLF & _
		"<tr height=20>" & _
		"	<td width=600>&nbsp;" & vbLF & _
		"		<img src=""../images/goto.gif"">&nbsp;<a href=""pcard_g.asp"">通讯录类别管理</a>" & vbLF & _
		"		&nbsp;&nbsp;&nbsp;" & vbLF & _
		"		<img src=""../images/goto.gif"">&nbsp;<a href=""pcard_l.asp"">通讯录信息查询</a>" & vbLF & _
		"		&nbsp;&nbsp;&nbsp;" & vbLF & _
		"		<img src=""../images/goto.gif"">&nbsp;<a href=""ccard_l.asp"">单位名录信息查询</a></td>" & vbLF & _
		"</tr>" & _
		"</table>"
End Function


Function AddCard()
	dim sSQL
	dim sName, sGender, sCardGroup, sIsPublic, sPost, sCName, sCAddr, sCZip, sCPhone, sFax
	dim sHAddr, sHZip, sHPhone, sMobile, sBeep, sEmail, sMemo
	sName		= GetParam("name")
	sGender	= GetParam("gender")
	sCardGroup = GetParam("card_group")
	sIspublic	= GetParam("ispublic")
	sPost			= GetParam("post")
	sCName	= GetParam("company_name")
	sCAddr		= GetParam("company_addr")
	sCZip		= GetParam("company_zip")
	sCPhone	= GetParam("company_phone")
	sHAddr		= GetParam("home_addr")
	sHZip		= GetParam("home_zip")
	sHPhone	= GetParam("home_phone")
	sMobile		= GetParam("mobile")
	sBeep		= GetParam("beep")
	sFax			= GetParam("fax")
	sEmail		= GetParam("email")
	sMemo		= GetParam("memo")

	if CStr(sIsPublic) = "on" then sIsPublic = "1" else sIsPublic = "0"

	sSQL = "insert into t_personalcard(emp_serial, name, gender, card_group, ispublic, post," & _
			" company_name, company_addr, company_zip, company_phone," & _
			" home_addr, home_zip, home_phone, mobile, beep, fax, email, memo)" & _
			" values(" & ToSQL(iEmpSerial, "Number") & ", " & ToSQL(sName,"Text") & ", " & ToSQL(sGender, "Number") & _
			", " & ToSQL(sCardGroup, "Number") & _
			", " & ToSQL(sIsPublic, "Number") & ", " & ToSQL(sPost, "Text") & ", " & ToSQL(sCName, "Name") & _
			", " & ToSQL(sCAddr, "Text") & ", " & ToSQL(sCZip, "Text") & ", " & ToSQL(sCPhone, "Text") & _
			", " & ToSQL(sHAddr, "Text") & ", " & ToSQL(sHZip, "Text") & ", " & ToSQL(sHPhone, "Text") & _
			", " & ToSQL(sMobile, "Text") & ", " & ToSQL(sBeep, "Text") & ", " & ToSQL(sFax, "Text") & _
			", " & ToSQL(sEmail, "Text") & ", " & ToSQL(sMemo, "Text") & ")"

	call ExecuteSQL(dbLocal, sSQL)

	iCardSerial = DLookUp(dbLocal, "t_personalcard", "max(serial)", "emp_serial=" & iEmpSerial)
	
	Response.Redirect "pcard_p.asp?serial=" & iCardSerial & "&"
	Response.end
End Function

Function UpdateCard()
	dim sSQL
	dim sSerial, sName, sGender, sCardGroup, sIsPublic, sPost, sCName, sCAddr, sCZip, sCPhone, sFax
	dim sHAddr, sHZip, sHPhone, sMobile, sBeep, sEmail, sMemo
	sSerial		= GetParam("serial")
	sName		= GetParam("name")
	sGender	= GetParam("gender")
	sCardGroup = GetParam("card_group")
	sIsPublic	= GetParam("ispublic")
	sPost			= GetParam("post")
	sCName	= GetParam("company_name")
	sCAddr		= GetParam("company_addr")
	sCZip		= GetParam("company_zip")
	sCPhone	= GetParam("company_phone")
	sHAddr		= GetParam("home_addr")
	sHZip		= GetParam("home_zip")
	sHPhone	= GetParam("home_phone")
	sMobile		= GetParam("mobile")
	sBeep		= GetParam("beep")
	sFax			= GetParam("fax")
	sEmail		= GetParam("email")
	sMemo		= GetParam("memo")

	if CStr(sIsPublic) = "on" then sIsPublic = "1" else sIsPublic = "0"

	sSQL = "update t_personalcard" & _
				" set name = " & ToSQL(sName, "Text") & _
				", gender = " & ToSQL(sGender, "Number") & _
				", card_group = " & ToSQL(sCardGroup, "Number") & _
				", ispublic = " & ToSQL(sIsPublic, "Number") & _
				", post = " & ToSQL(sPost, "Text") & _
				", company_name = " & ToSQL(sCName, "Text") & _
				", company_addr = " & ToSQL(sCAddr, "Text") & _
				", company_zip = " & ToSQL(sCZip, "Text") & _
				", company_phone = " & ToSQL(sCPhone, "Text") & _
				", home_addr = " & ToSQL(sHAddr, "Text") & _
				", home_zip = " & ToSQL(sHZip, "Text") & _
				", home_phone = " & ToSQL(sHPhone, "Text") & _
				", mobile = " & ToSQL(sMobile, "Text") & _
				", beep = " & ToSQL(sBeep, "Text") & _
				", fax = " & ToSQL(sFax, "Text") & _
				", email = " & ToSQL(sEmail, "Text") & _
				", memo = " & ToSQL(sMemo, "Text") & _
				" where serial = " & ToSQL(sSerial, "Number")
	call ExecuteSQL(dbLocal, sSQL)
	Response.Redirect "pcard_p.asp?serial=" & sSerial & "&"
	Response.end
End Function

%>

⌨️ 快捷键说明

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