<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
|
<%Session.CodePage=65001%>
|
<%Response.Buffer = True
|
Server.ScriptTimeOut=240000
|
'On Error Resume Next
|
%>
|
<!--#include virtual="/inc/odbc.asp"-->
|
<!--#include virtual="/inc/function.asp"-->
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no">
|
<title>记录中..</title>
|
</head>
|
<%
|
'-------------------------------------------------------------记录客户评价
|
ServiceOrdID = SafeRequest(trim(request.form("ServiceOrdID")))
|
DispatchOrdID = SafeRequest(trim(request.form("DispatchOrdID")))
|
Guest_openid = SafeRequest(trim(request.form("openid")))
|
if ServiceOrdID="" or DispatchOrdID="" or Guest_openid="" then
|
'Response.Redirect "/OrdEvaluateError.asp"
|
'Response.End()
|
end If
|
Guest_PointE = SafeRequest(trim(request.form("Guest_PointE")))
|
Guest_Reward = SafeRequest(trim(request.form("amount")))
|
If Guest_Reward="-1" Then Guest_Reward=SafeRequest(trim(request.form("other_amount")))
|
Guest_Point = SafeRequest(trim(request.form("point")))
|
Guest_Evaluate = SafeRequest(trim(request.form("contents")))
|
Guest_Impression= ""
|
If Guest_Reward="" Then Guest_Reward=0
|
If Guest_Point="" Then Guest_Point=1
|
|
Set rs = Server.CreateObject("ADODB.Recordset")
|
sql="select ServiceOrdID from ServiceOrder where Guest_Point=0 and ServiceOrdID="&ServiceOrdID
|
rs.open sql,objConn,1,1
|
if rs.Eof then
|
Response.Redirect "/OrdEvaluateError.asp?ErrorID=2"
|
Response.End()
|
end if
|
rs.close()
|
|
'重复评价检查
|
If Guest_openid<>"" then
|
sql="select count(ServiceOrdID) from ServiceOrder where Guest_openid='"&Guest_openid&"' and Guest_Time>=dateadd(Month,-1,GETDATE())"
|
rs.open sql,objConn,1,1
|
OldInt=rs(0)
|
rs.close()
|
If CInt(OldInt)>=3 Then
|
Response.Redirect "/OrdEvaluateError.asp?ErrorID=1"
|
Response.End()
|
End If
|
sql="select id from dictionary where vtitle='966120_OA_openid' and vType>=1 and vtext='"&Guest_openid&"'"
|
rs.open sql,objConn,1,1
|
If Not rs.eof Then
|
Response.Redirect "/OrdEvaluateError.asp?ErrorID=1"
|
Response.End()
|
End If
|
rs.close()
|
End If
|
|
If Guest_PointE="1" Then
|
sql="update DispatchOrd_Entourage set Guest_PointE=',9' from DispatchOrd_Entourage where EntourageState<>4 and DispatchOrdIDDt="&DispatchOrdID
|
objConn.Execute sql
|
else
|
EId = SafeRequest(trim(request.form("EId")))
|
EIdSP = SPLIT(EId,", ")
|
for i = 0 to UBOUND(EIdSP)
|
EId = EIdSP(i)
|
If EId<>"" Then
|
EntourageName = SafeRequest(trim(request.form("EntourageName_"&EId)))
|
Guest_PointE = SafeRequest(trim(request.form("Guest_PointE_"&EId)))
|
If Guest_PointE="1" Then
|
Guest_PointE=",9"
|
ElseIf Guest_PointE="2" Then
|
Guest_PointE=",1"
|
ElseIf Guest_PointE="3" Then
|
Guest_PointE=",2"
|
Else
|
Guest_PointE=",8"
|
End If
|
If EntourageName="司机" And DispatchOrdID<>"" Then
|
sql="update DispatchOrd_Entourage set Guest_PointE='"&Guest_PointE&"' from DispatchOrd_Entourage,dictionary where vtitle='DispatchOrdEntourage' and EntourageID=vID and EntourageState<>4 and DispatchOrdIDDt="&DispatchOrdID&" and vtext='司机'"
|
objConn.Execute sql
|
Else
|
sql="update DispatchOrd_Entourage set Guest_PointE='"&Guest_PointE&"' where id="&EId
|
objConn.Execute sql
|
End If
|
End if
|
Next
|
End If
|
|
sql="update ServiceOrder set Guest_openid='"&Guest_openid&"',Guest_Point=1,Guest_Impression='"&Guest_Impression&"',Guest_Evaluate='"&Guest_Evaluate&"',Guest_Time=getdate() where ServiceOrdID="&ServiceOrdID
|
objConn.Execute sql
|
|
'生成100元优惠券
|
'CouponNO=DDateID()&DTimeID()
|
'CouponMoney=100
|
'CouponRemarks=""
|
'sql="Insert into Coupon (CouponNO,CouponMoney,CouponDate_Ent,CouponRemarks,ServiceOrdIDPK) values ('"&CouponNO&"',"&CouponMoney&",getdate()+365,'"&CouponRemarks&"',"&ServiceOrdID&")"
|
'objConn.Execute sql
|
|
'Response.Redirect "/OrdEvaluateOK.asp"
|
If Guest_Reward>0 Then
|
Response.Redirect "/pay/weixin_pay.asp?attach=打赏&DispatchOrdID="&DispatchOrdID&"&ServiceOrdID="&ServiceOrdID&"&openid="&Guest_openid&"&Total_fee="&Guest_Reward&"&CouponNO="&CouponNO
|
Else
|
Response.Redirect "/OrdEvaluateOK.asp?ServiceOrdID="&ServiceOrdID&"&DispatchOrdID="&DispatchOrdID&"&CouponNO="&CouponNO
|
End If
|
Response.End%>
|