📄 ccard_e.inc
字号:
<%
Function CardForm()
dim sSQL, crs, rs
dim sCardGroup, sName, sAddress, sZip, sContactPerson, sContactPhone, sFax, sEmail, sRemark
dim sActionLinks
'' 如果是更新操作,则根据通讯录的序列号获取详细信息
if sAction = "modify" then
sSQL = "select * from t_customercard where serial = " & iCardSerial
set crs = New CRecordset
set rs = crs.Open(dbLocal, sSQL)
'' 居然找不到通讯录信息的记录,那肯定是个莫名的错误
if rs.EOF then
Server.Transfer("../common/error.asp")
Response.end
end if
'' 获取任务信息的各种数据
sCardGroup = crs.GetValue("card_group")
sName = crs.GetValue("name")
sAddress = crs.GetValue("address")
sZip = crs.GetValue("zip")
sContactPerson = crs.GetValue("contact_person")
sContactPhone = crs.GetValue("contact_phone")
sFax = crs.GetValue("fax")
sEmail = crs.GetValue("email")
sRemark = crs.GetValue("remark")
crs.Close()
end if
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 & _
" " & vbLF & _
" <img border=0 src=""../images/button/delete.gif"" onclick=""btnDelete_OnClick()"" style=""cursor:hand"">" & vbLF & _
" " & 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 & _
" " & vbLF & _
" <img border=0 src=""../images/button/cancel.gif"" onclick=""btnReturn_OnClick()"" style=""cursor:hand"">" & vbLF & _
" </td>" & vbLF & _
"</tr>" & vbLF
end if
CardForm = _
"<form method=""post"" name=""frmEdit"" action=""ccard_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>" & vbLF & _
" <td align=center width=70>类 别:</td>" & vbLF & _
" <td colspan=3><select name=""card_group"" style=""width:200px"">" & vbLF & _
SelectOptions(dbLocal, "t_customercardgroup", "group_id", "group_desp", sCardGroup, "") & vbLF & _
"</select>" & _
"<a href=""ccard_g.asp""> <img border=0 src=""../images/goto.gif""> 类别管理</a>" & vbLF & _
"</td></tr>" & vbLF & _
"<tr bgcolor=white height=30>" & vbLF & _
" <td align=center width=70>公司名称:</td>" & vbLF & _
" <td colspan=3 class=tdvalue><input type=""text"" name=""name"" value=""" & sName & """ size=85 maxlength=25></td></tr>" & vbLF & _
"<tr bgcolor=white height=30>" & vbLF & _
" <td align=center width=70>公司地址:</td>" & vbLF & _
" <td colspan=3 class=tdvalue><input type=""text"" name=""address"" value=""" & sAddress & """ size=85 maxlength=25></td></tr>" & vbLF & _
"<tr bgcolor=white height=30>" & vbLF & _
" <td align=center width=70>邮政编码:</td>" & vbLF & _
" <td colspan=3 class=tdvalue><input type=""text"" name=""zip"" value=""" & sZip & """ size=85 maxlength=8></td></tr>" & vbLF & _
"<tr bgcolor=white height=30>" & vbLF & _
" <td align=center width=70>联系人:</td>" & vbLF & _
" <td class=tdvalue width=200><input type""text"" name=""contact_person"" value=""" & sContactPerson & """ size=31 maxlength=25></td>" & vbLF & _
" <td align=center width=70>联系电话:</td>" & vbLF & _
" <td class=tdvalue width=250><input type=""text"" name=""contact_phone"" value=""" & sContactPhone & """ size=39 maxlength=25></td></tr>" & vbLF & _
"<tr bgcolor=white height=30>" & vbLF & _
" <td align=center width=70>传 真:</td>" & vbLF & _
" <td class=tdvalue width=200><input type""text"" name=""fax"" value=""" & sFax & """ size=31 maxlength=25></td>" & vbLF & _
" <td align=center width=70>电子信箱:</td>" & vbLF & _
" <td class=tdvalue width=250><input type=""text"" name=""email"" value=""" & sEmail & """ size=39 maxlength=50></td></tr>" & vbLF & _
"<tr bgcolor=white height=60>" & vbLF & _
" <td align=center width=70>备注信息:</td>" & vbLF & _
" <td colspan=3 class=tdvalue><textarea name=""remark"" rows=5 cols=84>" & sRemark & "</textarea></td></tr>" & vbLF & _
sActionLinks & vbLF & _
"</table>" & vbLF & _
"</form>" & vbLF & _
"<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> " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""ccard_l.asp"">单位名录信息查询</a>" & vbLF & _
" " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""pcard_l.asp"">通讯录信息查询</a></td>" & vbLF & _
"</tr>" & _
"</table>"
End Function
Function AddCard()
dim sSQL
dim sCardGroup, sName, sAddress, sZip, sContactPerson, sContactPhone, sFax, sEmail, sRemark
sCardGroup = GetParam("card_group")
sName = GetParam("name")
sAddress = GetParam("address")
sZip = GetParam("zip")
sContactPerson = GetParam("contact_person")
sContactPhone = GetParam("contact_phone")
sFax = GetParam("fax")
sEmail = GetParam("email")
sRemark = GetParam("remark")
sSQL = "insert into t_customercard(card_group, name, address, zip, contact_person, contact_phone, fax, email, remark)" & _
" values(" & ToSQL(sCardGroup, "Number") & ", " & ToSQL(sName,"Text") & ", " & ToSQL(sAddress, "Text") & _
", " & ToSQL(sZip, "Text") & ", " & ToSQL(sContactPerson, "Text") & ", " & ToSQL(sContactPhone, "Text") & _
", " & ToSQL(sFax, "Text") & ", " & ToSQL(sEmail, "Text") & ", " & ToSQL(sRemark, "Text") & ")"
call ExecuteSQL(dbLocal, sSQL)
iCardSerial = DLookUp(dbLocal, "t_customercard", "max(serial)", "")
Response.Redirect "ccard_p.asp?serial=" & iCardSerial & "&"
Response.end
End Function
Function UpdateCard()
dim sSQL
dim sCardGroup, sName, sAddress, sZip, sContactPerson, sContactPhone, sFax, sEmail, sRemark
sCardGroup = GetParam("card_group")
sName = GetParam("name")
sAddress = GetParam("address")
sZip = GetParam("zip")
sContactPerson = GetParam("contact_person")
sContactPhone = GetParam("contact_phone")
sFax = GetParam("fax")
sEmail = GetParam("email")
sRemark = GetParam("remark")
sSQL = "update t_customercard" & _
" set card_group = " & ToSQL(sCardGroup, "Number") & _
", name = " & ToSQL(sName, "Text") & _
", address = " & ToSQL(sAddress, "Text") & _
", zip = " & ToSQL(sZip, "Text") & _
", contact_person = " & ToSQL(sContactPerson, "Text") & _
", contact_phone = " & ToSQL(sContactPhone, "Text") & _
", fax = " & ToSQL(sFax, "Text") & _
", email = " & ToSQL(sEmail, "Text") & _
", remark = " & ToSQL(sRemark, "Text") & _
" where serial = " & ToSQL(iCardSerial, "Number")
call ExecuteSQL(dbLocal, sSQL)
Response.Redirect "ccard_p.asp?serial=" & iCardSerial & "&"
Response.end
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -