📄 newcomplaint.inc
字号:
<%
'************************************************************************************************
' 函数名 : FormComplaintTable(iComplaintid)
' 输 入 : iComplaintid:客户意见id,如果是新增客户意见,那么iComplaintid=0,表示一张空的表
' 输 出 : 一张客户意见信息表(新的或者是旧的供修改的),可以提交
' 功能描述: 根据客户意见id,将相应的客户意见信息显示出来
' 调用模块: newcomplaint.inc
' 作 者 : 魏霖
' 日 期 : 2002-10-31
' 版 本 :
'************************************************************************************************
Function FormComplaintTable(iComplaintid)
'------------------------------------
' 根据iComplaintid,显示相应的商户信息,供修改
'------------------------------------
dim sSQL
dim sTemp, sTempButtons
dim rs, sError, rs1, rs2
dim sCustomername,sContent,sComplaint,sChief,sDealopinion,iWorksheetid
'rs: 返回t_customer_complaints表中关于当前客户意见的记录
sSQL = "select * from T_customer_complaints where complaint_id = "& iComplaintid
set rs = openRS(conn,sSQL)
if not rs.eof then
'存在该客户意见,显示该客户意见信息
sCustomername=GetValue(rs,"customer_name")
sContent=GetValue(rs,"content")
sComplaint=GetValue(rs,"complaint")
sChief=GetValue(rs,"chief")
sDealopinion=GetValue(rs,"deal_opinion")
iWorksheetid=GetValue(rs,"worksheet_id")
if iWorksheetid="" then
sTemp="<img border=0 src=""../images/arrowr.gif""> <a href=""../worksheet/newworksheet.asp?complaintid="&iComplaintid&""">生成工作单</a>"
else
sTemp="<img border=0 src=""../images/arrowr.gif""> <a href=""../worksheet/worksheet.asp?worksheetid="&iWorksheetid&""">查看工作单</a>"
end if
if iRight=2 then
sTempButtons=_
" <img border=0 src=""../images/button/update.gif"" style=""cursor:hand"" onclick=""btnUpdate_onclick()"">" & _
" <img border=0 src=""../images/button/return.gif"" style=""cursor:hand"" name=btnReturn>"
else
sTempButtons=""
end if
FormComplainttable=_
TableTitle("客 户 意 见 信 息 表", 600, "", "#0040a0") & _
"<table cellspacing=1 cellpadding=3 bgcolor=""silver"" width=""600"" border=0 style=""table-layout:fixed"">" & vbLF & _
"<form name=""frmnewcomplaint"" method=post action=""newcomplaint.asp"">" &_
" <tr style=""display:none"">" & vbLF & _
" <td width=95>这一行仅用于控制每一栏的宽度</td><td width=""16%"">这一行仅用于控制每一栏的宽度</td>" & vbLF & _
" <td width=95>这一行仅用于控制每一栏的宽度</td><td width=""*"">这一行仅用于控制每一栏的宽度</td>" & vbLF & _
" <td width=90>这一行仅用于控制每一栏的宽度</td><td width=""16%"">这一行仅用于控制每一栏的宽度</td>" & vbLF & _
" </tr>" & vbLF & _
" <tr bgcolor=white height=25>" & vbLF & _
" <td align=center>客户名称</td>" & vbLF & _
" <td class=tdValue colspan=3 nowrap><input type=""text"" name=""customername"" value=""" & sCustomername & """ size=50 maxlength=25></td>" & vbLF & _
" <td colspan=2 align=right>"&sTemp&" </td>"&_
" </tr>" & vbLF & _
" <tr bgcolor=white>" & vbLF & _
" <td align=center>客户投诉内容</td>" & vbLF & _
" <td valign=center colspan=5 style=""word-wrap:break-word;""><textarea name='content' cols=80 rows=6 onkeypress='this.style.color=red' onchange='this.style.color=red'>"&sContent&"</textarea></td>" & vbLF &_
" <tr bgcolor=white height=25>" & vbLF & _
" <td align=center>投 诉 人</td>" & vbLF & _
" <td class=tdValue colspan=2 nowrap><input type=""text"" name=""complaint"" value=""" & sComplaint & """ size=28 maxlength=10></td>" & vbLF & _
" <td align=center>负 责 人</td>" & vbLF & _
" <td class=tdValue colspan=2 nowrap><input type=""text"" name=""chief"" value=""" & sChief & """ size=28 maxlength=10></td>" & vbLF & _
" </tr>" & vbLF & _
" <tr bgcolor=white>" & vbLF & _
" <td align=center>处理意见</td>" & vbLF & _
" <td valign=center colspan=5 style=""word-wrap:break-word;""><textarea name='dealopinion' cols=80 rows=6 onkeypress='this.style.color=red' onchange='this.style.color=red'>"&sDealopinion&"</textarea></td>" & vbLF
FormComplaintTable = FormComplaintTable & _
"<tr height=30 bgcolor=white>" & _
" <td colspan=6 align=center>" & sTempButtons &_
" </td>" & _
"</tr>" & _
"<tr bgcolor=white><td colspan=6 align=center>" & _
" <input type=hidden name=formaction>" & _
" <input type=hidden name=page value="""&iPage&""">" & _
" <input type=hidden name=complaintid value="""&iComplaintid&""">" & _
"</td></tr>" & _
"</form>" & _
"</table>"
else
'不存在该角色,显示空的角色信息
sTempButtons=_
" <img border=0 src=""../images/button/submit.gif"" style=""cursor:hand"" name=btnSubmit>" & _
" <img border=0 src=""../images/button/clear.gif"" style=""cursor:hand"" name=btnCancel>"
FormComplainttable=_
TableTitle("新增客户意见", 600, "", "#0040a0") & _
"<table cellspacing=1 cellpadding=3 bgcolor=""silver"" width=""600"" border=0 style=""table-layout:fixed"">" & vbLF & _
"<form name=""frmnewcomplaint"" method=post action=""newcomplaint.asp"">"&_
" <tr style=""display:none"">" & vbLF & _
" <td width=95>这一行仅用于控制每一栏的宽度</td><td width=""16%"">这一行仅用于控制每一栏的宽度</td>" & vbLF & _
" <td width=95>这一行仅用于控制每一栏的宽度</td><td width=""*"">这一行仅用于控制每一栏的宽度</td>" & vbLF & _
" <td width=90>这一行仅用于控制每一栏的宽度</td><td width=""16%"">这一行仅用于控制每一栏的宽度</td>" & vbLF & _
" </tr>" & vbLF & _
" <tr bgcolor=white height=25>" & vbLF & _
" <td align=center>客户名称</td>" & vbLF & _
" <td class=tdValue colspan=5 nowrap><input type=""text"" name=""customername"" size=80 maxlength=25></td>" & vbLF & _
" </tr>" & vbLF & _
" <tr bgcolor=white>" & vbLF & _
" <td align=center>客户投诉内容</td>" & vbLF & _
" <td valign=center colspan=5 style=""word-wrap:break-word;""><textarea name='content' cols=80 rows=6 onkeypress='this.style.color=red' onchange='this.style.color=red'></textarea></td>" & vbLF &_
" <tr bgcolor=white height=25>" & vbLF & _
" <td align=center>投 诉 人</td>" & vbLF & _
" <td class=tdValue colspan=2 nowrap><input type=""text"" name=""complaint"" size=28 maxlength=10></td>" & vbLF & _
" <td align=center>负 责 人</td>" & vbLF & _
" <td class=tdValue colspan=2 nowrap><input type=""text"" name=""chief"" size=28 maxlength=10></td>" & vbLF & _
" </tr>" & vbLF & _
" <tr bgcolor=white>" & vbLF & _
" <td align=center>处理意见</td>" & vbLF & _
" <td valign=center colspan=5 style=""word-wrap:break-word;""><textarea name='dealopinion' cols=80 rows=6 onkeypress='this.style.color=red' onchange='this.style.color=red'></textarea></td>" & vbLF
FormComplaintTable = FormComplaintTable & _
"<tr bgcolor=white height=30>" & _
" <td colspan=6 align=center>" & sTempButtons & _
" </td>" & _
"</tr>" & _
"<tr bgcolor=white ><td colspan=6>" & _
" <input type=hidden name=formaction>" & _
" <input type=hidden name=complaintid value="""&iComplaintid&""">" & _
"</td ></tr>" & _
"</form>" & _
"</table>"
end if
CloseRS(rs)
End Function
'************************************************************************************************
' 函数名 : UpdateComplaint()
' 输 入 :
' 输 出 :
' 功能描述: 新增、更新、删除
' 调用模块: newComplaint.asp
' 作 者 : 魏霖
' 日 期 : 2002-10-31
' 版 本 :
'************************************************************************************************
Sub UpdateComplaint()
' 定义变量
dim sSQL, sError, sFormaction, crs, rs, sCustomername,sContent,sComplaint,sChief,sDealopinion,iWorksheetid
dim newid, temp
' 获取表单的数据
sFormaction=GetParam("formaction")
sCustomername = GetParam("customername")
sContent = GetParam("content")
sComplaint = GetParam("complaint")
sChief = GetParam("chief")
sDealopinion = GetParam("dealopinion")
select case sFormaction
case "add"'新增客户意见
'检查有没有相同的商户名称,如果有的话,给出消息,不允许相同
sSQL = "insert into T_customer_complaints(customer_name,content,complaint,chief,deal_opinion) values("&ToSQL(sCustomername,"text")&","&ToSQL(sContent,"text")&","&ToSQL(sComplaint,"text")&","&ToSQL(sChief,"text")&_
","&ToSQL(sDealopinion,"text")&" )"
'执行新增商户到t_customer_complaints表中
conn.Execute(sSQL)
sError=ProcessError(conn)
if sError <> "" then
response.write "<script language=""javascript"">alert('对不起,新增客户意见失败!')</script>"
else
response.write "<script language=""javascript"">alert('新增客户意见成功!')</script>"
'要得到刚插入记录的id
end if
' response.end
response.write "<script language=vbscript>window.navigate(""newcomplaint.asp"")</script>"
'response.write "<script language=vbscript>window.navigate(""newworksheet.asp?complaintid="&inewid&""")</script>"
case "upd"'更新客户意见
sSQL = "select * from T_customer_complaints where complaint_id = "&iComplaintid
set rs = openRS(conn,sSQL)
if not rs.eof then
'定义更新的sSQL语句
sSQL = "update T_customer_complaints set customer_name = "& ToSQL(sCustomername,"text") &_
",content="& ToSQL(sContent,"text") &_
",complaint="& ToSQL(sComplaint,"text") &_
",chief="& ToSQL(sChief,"text") &_
",deal_opinion="& ToSQL(sDealopinion,"text") &_
" where complaint_id=" & iComplaintid
'执行角色名称的更新
conn.Execute(sSQL)
sError=ProcessError(conn)
if sError <> "" then
response.write "<script language=""javascript"">alert('对不起,客户意见信息更新失败!')</script>"
else
' response.write "<script language=""javascript"">alert('客户意见信息更新成功!')</script>"
end if
response.write "<script language=vbscript>window.navigate(""list_complaint.asp?page="&iPage&""")</script>"
else
response.write "<script language=""javascript"">alert('对不起,不存在该客户意见!')</script>"
response.write "<script language = vbscript>window.navigate(""list_complaint.asp"")</script>"
end if
CloseRS(rs)
end select
End Sub
'************************************************************************************************
' 函数名 : TableLink()
' 输 入 :
' 输 出 :
' 功能描述: 人事管理相关连接
' 调用模块: list_firm.asp
' 作 者 : 魏霖
' 日 期 : 2002-10-31
' 版 本 :
'************************************************************************************************
Function TableLink()
dim sTemp : sTemp = ""
sTemp = _
" <img src=""../images/goto.gif""> <a href=""list_complaint.asp"">客户意见管理</a>" & vbLF & _
" " & vbLF
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>" & vbLF & _
" <td width=600> " & vbLF & _
sTemp & vbLF & _
"</tr>" & vbLF & _
"</table>" & vbLF
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -