<!--#include file="head.asp"-->
<!--#include file="subleft.asp"-->
<!--#include virtual="/show/mokuai/sms.asp"-->

<script>document.getElementById('o_5').setAttribute("class", "ed"); document.getElementById("t_5").style.display="";document.getElementById('s_5_1').setAttribute("class", "ed4");</script>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title><%=webname%>-投诉/举报</title>
<%
Function randarr()
Const stringmodarr = "0123456789"
strlength = Len(stringmodarr)
Randomize timer
For i = 1 To 5 
randarr2 = randarr2&Mid(stringmodarr,Int(Rnd * strlength + 1),1)  
Next 
randarr=randarr2
End Function

Function RegTest(str,r,i)
Dim Reg
Set Reg=New RegExp
Reg.IgnoreCase=i'默认值为False(区分大小写)
Reg.Pattern=r
RegTest=Reg.Test(str)
Set Reg=Nothing
End Function

act=SafeRequestform("act")

if act="add" then
call chkwurl()
i=SafeRequestform("i")
con=trim(SafeRequestform("con"))
if con="0" then call PopErr("请选择举报内容") 
xiangxicon=trim(SafeRequestform("xiangxicon"))
jubaodd=trim(SafeRequestform("jubaodd"))
jubaomail=trim(SafeRequestform("jubaomail"))
jubaoname=trim(SafeRequestform("jubaoname"))
ayjupass=trim(SafeRequestform("ayjupass"))
jubaoqq=trim(SafeRequestform("jubaoqq"))

	emailobj=RegTest(trim(jubaomail),"([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}",True)
	if emailobj=false then
	call PopErr("请填写一个正确的邮箱")
	end if

pic1=trim(SafeRequestform("pic1"))
pic2=trim(SafeRequestform("pic2"))
pic3=trim(SafeRequestform("pic3"))
pic4=trim(SafeRequestform("pic4"))
pic5=trim(SafeRequestform("pic5"))

downf=""
if trim(pic1)<>"" then downf=downf&pic1&";"
if trim(pic2)<>"" then downf=downf&pic2&";"
if trim(pic3)<>"" then downf=downf&pic3&";"
if trim(pic4)<>"" then downf=downf&pic4&";"
if trim(pic5)<>"" then downf=downf&pic5&";"

if downf<>"" then downf=mid(downf,1,len(downf)-1)


if jubaoname="" or ayjupass="" or jubaomail="" or jubaodd="" or jubaoqq="" then call PopErr("请填写完整") 

if jubaodd<>"" then

ddku=getddku(jubaodd)

sql="select aydingdansum,aydingdanuser,aydingdanzt,aydingdansj,aydingdanzj from "&ddku&" where aydingdansum='"&jubaodd&"'" 
rs.open sql,conn,1,1
if rs.bof and rs.eof then call PopErr("未找到该订单号，请检查订单号是否正确") 

	if cint(rs("aydingdanzt"))=0 then call PopErr("该订单尚未支付成功,如遇到支付问题请联系平台客服") 
	
	'if i="all" then
	'else
	if datediff("h",rs("aydingdansj"),now())>24 then call PopErr("该订单已超过24小时投诉时效，不再受理投诉问题") 
	'end if
	
aydingdanzj=rs("aydingdanzj")
userid=rs("aydingdanuser")
rs.close
end if

sql="select * from ayjubao where jubaodd='"&jubaodd&"'" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then call PopErr2("该订单已经投诉并受理，请使用查询密码查看投诉进度，再次回复或撤销投诉","tousulist") 
	
rs.addnew
rs("ayjubaocon")=con
if xiangxicon<>"" then rs("ayjubaoxcon")=xiangxicon
if jubaodd<>"" then rs("jubaodd")=jubaodd
rs("jubaomail")=jubaomail
rs("ayjubaouid")=clng(userid)
rs("aydate")=now()
rs("ayjuname")=jubaoname
if downf<>"" then rs("ayjudown")=downf
rs("ayjupass")=ayjupass
rs("jubaoqq")=jubaoqq
rs("jubaomaiid")=request.Cookies("aynameid")
rs("ayjubaozt")=1    '*****开启立即通知 请开启此行  否则请关闭*********
rs.update
rs.close


'立即通知商家
sql="select top 1 * from ayjubao where ayjuname='"&jubaoname&"' and ayjubaosjid=0 order by ayjubaoid desc" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
jid=rs("ayjubaoid")
rs.addnew
rs("ayjubaosjid")=jid
rs("ayjuhuifu")="我们已收到您的投诉,并通知了商家,请耐心等待。请商家积极主动联系买家并处理投诉！24小时未处理将视为自动退款！"
rs("aydate")=now()
rs("ayjuishui")=1
rs("ayjuishuisid")=9
rs.update
end if
rs.close

rs.open "select aynameid,aymail,aytel,wxopenid,ayyue,aydongjie,cwku from ayname where aynameid="&userid&"" ,conn,1,3
if rs.bof and rs.eof then call PopErr("未找到该商户！")
aymail=trim(rs("aymail"))
aytel=trim(rs("aytel"))
wxopenid=trim(rs("wxopenid"))
cwku=trim(rs("cwku"))

if ccur(rs("ayyue"))>=ccur(aydingdanzj) then
	buyuseryue=ccur(rs("ayyue"))-ccur(aydingdanzj)
	rs("ayyue")=ccur(rs("ayyue"))-ccur(aydingdanzj)
	rs("aydongjie")=ccur(rs("aydongjie"))+ccur(aydingdanzj)
	rs.update
	conn.execute "update ayjubao set jine="&aydingdanzj&",jinzt=1 where jubaodd='"&jubaodd&"'"
	
	'创建财务流水
	select case	trim(cwku)
	case "aycaiwu"
	randarrcwku="A"
	case "aycaiwu01"
	randarrcwku="B"
	case "aycaiwu02"
	randarrcwku="C"
	case "aycaiwu03"
	randarrcwku="D"
	case "aycaiwu04"
	randarrcwku="E"
	case "aycaiwu05"
	randarrcwku="F"
	case else
	randarrcwku="A"
	end select
	crandarrlei="C" 	'标示 D订单 C财务
	crandarrhost="A" 	'服务器数据库
	crandarrlast=Right(("00"&Month(Now())),2)&Right(("00"&Day(Now())),2)&Right(("00"&hour(Now())),2)&Right(("00"&minute(Now())),2)&Right(("00"&second(Now())),2)&randarr()
	crandarr=crandarrlei&crandarrhost&randarrcwku&crandarrlast
	conn.Execute("Insert Into "&cwku&"(aycaiwuzt,aycailiushui,aycaiwuleibie,aycaiwuuser,aycaiwudate,aycaiwujine,aycaiwuyue,aycaiwubody,aycwfsjin,aycaiwuzhifu) values('1','"&crandarr&"','11','"&clng(userid)&"','"&now()&"','"&aydingdanzj&"','"&buyuseryue&"','投诉冻结"&jubaodd&"','"&aydingdanzj&"','99')")
end if

rs.close
'conn.Execute("Insert Into mailto(mto,mti,mcon) values('"&trim(jubaomail)&"','我们已经收到了您的投诉申请，并通知了商家','我们已收到您的投诉请求,并通知了商家,请耐心等待')")
'conn.Execute("Insert Into mailto(mbid,code1,mfs,mto,mcon) values('SMS_65920181','-','1','"&trim(jubaoname)&"','我们已经收到了您的投诉申请，并通知了商家,请耐心等待')")

title="来自"&webname&"-收到新的投诉,请在24小时内解决投诉问题,详情登陆平台查看" 
body="收到新的投诉,请在24小时内解决投诉问题,详情登陆平台查看"
conn.Execute("Insert Into mailto(mto,mti,mcon) values('"&trim(aymail)&"','"&trim(title)&"','"&trim(body)&"')")
call mokuai_sms("IK12","2",trim(aytel),body,"","","","")

if wxopenid<>"" then
wxend="买家QQ:"&jubaoqq&"\n"
wxend=wxend&"买家电话:"&jubaoname&"\n"
wxend=wxend&"买家邮箱:"&jubaomail&"\n"
wxend=wxend&"投诉时间:"&now()&"\n"
wxend=wxend&"请在24小时内解决投诉问题,详情登陆平台查看。\n请注意：只有买家可以撤销投诉"
conn.Execute("Insert Into mailto(mfs,wxlei,mto,wxtop,wxtext,wx1,wx2) values('2','3','"&trim(wxopenid)&"','收到新的投诉通知','"&wxend&"','"&jubaodd&"','"&con&"')")
end if
'立即通知商家 结束

call logadd("0",jubaoname&"投诉成功",0,0)
call PopErr2("投诉成功","tousulist")
end if


ka=SafeRequest("ka")
%>
<br>
<DIV id=main2> 
<%call webleft()%>

<DIV id=main_right>
<DIV id=main_right_content>

<H2><SPAN>投诉/举报</SPAN></H2>
<DIV class=main4>
<script language="javascript">
function check_add()
{
if(form1.con.value=="0"){alert("请选择投诉类别");return false}
if(form1.xiangxicon.value==""){alert("请填写投诉内容");return false;}
if(form1.jubaodd.value==""){alert("请填写投诉订单号");return false;}
if(form1.jubaoqq.value==""){alert("请填写一个联系QQ");return false;}
if(form1.jubaoname.value==""){alert("请填写一个联系电话");return false;}
if(form1.jubaomail.value==""){alert("请填写一个联系邮箱");return false;}

var shuzi = /^[-]{0,1}[0-9]{1,}$/; 
if(shuzi.test(form1.jubaoqq.value)==false){alert("联系QQ必须为数字");return false;}

var regu =/^[1][3-8][0-9]{9}$/; 
var re = new RegExp(regu); 
if (re.test(form1.jubaoname.value)==false)
{alert("请正确填写一个手机号码");return false;} 

var jc_mail = /^[-_A-Za-z0-9]+@([_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/;
if(jc_mail.test(form1.jubaomail.value)==false)	
{alert("请正确填写一个投诉邮箱");return false;}

if(form1.ayjupass.value==""){alert("请填写一个投诉查询密码");return false;}
if((form1.ayjupass.value=="123456")||(form1.ayjupass.value=="000000")||(form1.ayjupass.value=="0000000")||(form1.ayjupass.value=="888888")||(form1.ayjupass.value=="112233")||(form1.ayjupass.value=="111111")){alert("投诉查询密码过于简单，请重新填写");return false;}

}
</script>

<link rel="stylesheet" href="/kindeditor/themes/default/default.css" />
<script charset="utf-8" src="/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="/kindeditor/lang/zh-CN.js"></script>
<script>
			KindEditor.ready(function(K) {
				var uploadbutton1 = K.uploadbutton({
					button : K('#uploadButton1')[0],
					fieldName : 'imgFile',
					url : '/kindeditor/asp/upload_jubao.asp?dir=image',
					afterUpload : function(data) { 
						if (data.error === 0) {
							var url = K.formatUrl(data.url, '');
							urlcon=url.replace("/kindeditor/asp/../../","/"); 
							K('#picurl1').val(urlcon);
							con1.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton1.fileBox.change(function(e) {
					uploadbutton1.submit();
				});
			});
			
			KindEditor.ready(function(K) {
				var uploadbutton2 = K.uploadbutton({
					button : K('#uploadButton2')[0],
					fieldName : 'imgFile',
					url : '/kindeditor/asp/upload_jubao.asp?dir=image',
					afterUpload : function(data) { 
						if (data.error === 0) {
							var url = K.formatUrl(data.url, 'absolute');
							urlcon=url.replace("/kindeditor/asp/../../","/"); 
							K('#picurl2').val(urlcon);
							con2.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton2.fileBox.change(function(e) {
					uploadbutton2.submit();
				});
			});
			
			KindEditor.ready(function(K) {
				var uploadbutton3 = K.uploadbutton({
					button : K('#uploadButton3')[0],
					fieldName : 'imgFile',
					url : '/kindeditor/asp/upload_jubao.asp?dir=image',
					afterUpload : function(data) { 
						if (data.error === 0) {
							var url = K.formatUrl(data.url, 'absolute');
							urlcon=url.replace("/kindeditor/asp/../../","/"); 
							K('#picurl3').val(urlcon);
							con3.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton3.fileBox.change(function(e) {
					uploadbutton3.submit();
				});
			});
			
			KindEditor.ready(function(K) {
				var uploadbutton4 = K.uploadbutton({
					button : K('#uploadButton4')[0],
					fieldName : 'imgFile',
					url : '/kindeditor/asp/upload_jubao.asp?dir=image',
					afterUpload : function(data) { 
						if (data.error === 0) {
							var url = K.formatUrl(data.url, 'absolute');
							urlcon=url.replace("/kindeditor/asp/../../","/"); 
							K('#picurl4').val(urlcon);
							con4.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton4.fileBox.change(function(e) {
					uploadbutton4.submit();
				});
			});
			
			KindEditor.ready(function(K) {
				var uploadbutton5 = K.uploadbutton({
					button : K('#uploadButton5')[0],
					fieldName : 'imgFile',
					url : '/kindeditor/asp/upload_jubao.asp?dir=image',
					afterUpload : function(data) { 
						if (data.error === 0) {
							var url = K.formatUrl(data.url, 'absolute');
							urlcon=url.replace("/kindeditor/asp/../../","/"); 
							K('#picurl5').val(urlcon);
							con5.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton5.fileBox.change(function(e) {
					uploadbutton5.submit();
				});
			});
		</script>

<%
rs.open "select aymail,ayqq,aytel,aynameid from ayname where aynameid="&request.Cookies("aynameid")&"" ,conn,1,1
uaymail=trim(rs("aymail"))
uayqq=rs("ayqq")
uaytel=rs("aytel")
rs.close
%>

<form name="form1" id="form1" method="post" action="" onSubmit="return check_add()">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<%
	if pichost<>"/" then
		if trim(weburl)<>pichost then
		response.Redirect ""&pichost&"jubao?cact=tscx&ddh="&ka&""
		response.end
		end if
	end if

	if ka<>"" then
	
		ddku=getddku(ka)

		rs.open "select * from "&ddku&" where aydingdansum='"&ka&"'" ,conn,1,1
		if rs.bof and rs.eof then call PopErr("未找到该订单号ERR1") 
		userid=rs("aydingdanuser")
		rs.close
		
		rs.open "select aynameid,aywebname from ayname where aynameid="&userid&"" ,conn,1,1
		if not(rs.bof and rs.eof) then
		%>
          <tr>
            <td width="212" height="50" align="center" class="regtext">投诉商家：</td>
            <td width="311">
            <span style="font-size:14px"><%=trim(rs("aywebname"))%></span>  
            <input name="userid" type="hidden" id="userid" value="<%=rs("aynameid")%>" />  
            </td>
            <td width="512"></td>
          </tr>
        <%
		else
		call PopErr2("未找到投诉商家信息","tousu") 
		end if
		rs.close
	
	end if

%>


  <tr>
    <td width="212" height="50" align="center" class="regtext">投诉类别：</td>
    <td width="311">
<select name="con" id="con">
      <option value="0">请选择投诉内容</option>
      <option value="商品虚假">商品虚假</option>
      <option value="卡密失效">卡密失效</option>
      <option value="卡密失效">无法联系到商家</option>
      <option value="商家存在欺诈行为">商家存在欺诈行为</option>
      <option value="商品涉及非法内容">商品涉及非法内容</option>
    </select>
    </td>
    <td  width="512"><div id="pass1d" class="regts" >请选择一个投诉类别</div></td>
  </tr>
  <tr style="line-height:25px;font-size:13px;">
    <td height="50" align="center" class="regtext">投诉订单：</td>
    <td>
      <input name="jubaodd" type="text" id="jubaodd"  value="<%if ka<>"" then response.Write server.HTMLEncode(ka)%>" size="37" maxlength="18">
    </td>
    <td><div id="pass1d" class="regts" >请填写需要投诉的订单号</div></td>
    </tr>
  <tr>
    <td height="50" align="center" class="regtext">投诉内容：</td>
    <td><textarea name="xiangxicon" style="width:290px" rows="6" id="xiangxicon"></textarea></td>
    <td><div id="pass1d" class="regts" >请填写详细内容</div></td>
  </tr>
  <tr>
    <td height="50" align="center" class="regtext">联系QQ：</td>
    <td><input name="jubaoqq" type="text" id="jubaoqq"  maxlength="15" size="37"  value="<%=uayqq%>"></td>
    <td><div id="pass1d" class="regts" >请填写可以联系到你的真实常用QQ号码</div></td>
  </tr>
  <tr>
    <td height="50" align="center" class="regtext">联系手机：</td>
    <td><input name="jubaoname" type="text" id="jubaoname"  maxlength="11" size="37" value="<%=uaytel%>"></td>
    <td><div id="pass1d" class="regts" >请填写可以联系到你的真实常用手机号码</div></td>
  </tr>
  <tr>
    <td height="50" align="center" class="regtext">联系邮箱：</td>
    <td><input name="jubaomail" type="text" id="jubaomail" value="<%=uaymail%>" size="37"></td>
    <td><div id="pass1d" class="regts" >请填写可以联系到你的真实常用邮箱</div></td>
  </tr>
  <tr>
    <td height="50" align="center" class="regtext"><span style="color:#F30">设置投诉密码：</span></td>
    <td><input name="ayjupass" type="text" id="ayjupass" maxlength="6" size="37"></td>
    <td><div id="pass1d" class="regts" style="color:#F30" >请设置一个6位用于撤销投诉的投诉密码</div></td>
  </tr>
  <tr>
    <td height="50" align="center" class="regtext">上传截图：</td>
    <td colspan="2" valign="bottom">
      <input name="pic1" type="hidden" class="ke-input-text" id="picurl1" value="" readonly="readonly" /> <input type="button" id="uploadButton1" value="上传截图1" />
      <input name="pic2" type="hidden" class="ke-input-text" id="picurl2" value="" readonly="readonly" /> <input type="button" id="uploadButton2" value="上传截图2" />
      <input name="pic3" type="hidden" class="ke-input-text" id="picurl3" value="" readonly="readonly" /> <input type="button" id="uploadButton3" value="上传截图3" />
      <input name="pic4" type="hidden" class="ke-input-text" id="picurl4" value="" readonly="readonly" /> <input type="button" id="uploadButton4" value="上传截图4" />
      <input name="pic5" type="hidden" class="ke-input-text" id="picurl5" value="" readonly="readonly" /> <input type="button" id="uploadButton5" value="上传截图5" />
      <br><span id="con1"></span>&nbsp;<span id="con2"></span>&nbsp;<span id="con3"></span>&nbsp;<span id="con4"></span>&nbsp;<span id="con5"></span>
    </td>
    </tr> 
  <tr>
    <td height="50" class="regtext">&nbsp;</td>
    <td>(图片格式：jpg gif png 图片大小不超过500K)</td>
    <td></td>
  </tr>
  <tr>
    <td height="69" class="regtext">&nbsp;</td>
    <td align="left"><input style="cursor:pointer" name="tijiao" type="submit" class="logindlreg" id="tijiao" value=" 提交投诉 "></td>
    <td><input name="act" type="hidden" id="act" value="add" /><input name="i" type="hidden" id="i" value="<%=i%>" /></td>
  </tr>
  </table>
  
<div class="mzsmbox conter">
<strong>重要提示：</strong><br>
恶意投诉，无理投诉，将被列入买家黑名单，将无法在平台再次购买任何商品！<br>
请根据你遇到的问题，如实投诉，文明投诉，并上传证实存在问题的相关截图证据或聊天记录！<br>
如果商家在24小时内未回复或未解决投诉问题 平台会直接退款给买家！<br>
</div>

</form>

  <br>
</DIV>


</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>


	<!--#include virtual="/show/foot.asp"-->


