<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <%Session.CodePage=65001%> <%Response.Buffer = True Server.ScriptTimeOut=240000 'On Error Resume Next %> 记录中.. <% '-------------------------------------------------------------记录客户评价 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_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 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_Point_1 = SafeRequest(trim(request.form("point_1_"&EId))) Guest_Point_2 = SafeRequest(trim(request.form("point_2_"&EId))) Guest_Point_3 = SafeRequest(trim(request.form("point_3_"&EId))) If Guest_Point_1="" Then Guest_Point_1=0 If Guest_Point_2="" Then Guest_Point_2=0 If Guest_Point_3="" Then Guest_Point_3=0 If Guest_Point_1<=4 And Guest_Point_2<=4 And Guest_Point_3<=4 Then Guest_PointE=",9" ElseIf (Guest_Point_1<4 Or Guest_Point_3<4) And Guest_Point_2<4 Then Guest_PointE=",1,2" ElseIf Guest_Point_1<4 Or Guest_Point_3<4 Then Guest_PointE=",1" ElseIf Guest_Point_2<4 Then Guest_PointE=",2" Else Guest_PointE=",8" End If If EntourageName="司机" And DispatchOrdID<>"" Then sql="update DispatchOrd_Entourage set Guest_Point_1="&Guest_Point_1&",Guest_Point_2="&Guest_Point_2&",Guest_Point_3="&Guest_Point_3&",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_Point_1="&Guest_Point_1&",Guest_Point_2="&Guest_Point_2&",Guest_Point_3="&Guest_Point_3&",Guest_PointE='"&Guest_PointE&"' where id="&EId objConn.Execute sql End If End if Next sql="update ServiceOrder set Guest_openid='"&Guest_openid&"',Guest_Point="&Guest_Point&",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%>