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


<%
response.Redirect "/tousu?i=all"
response.end

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")
cact=SafeRequest("cact")
isgoodts="yes"

if act="jubao" then
call chkwurl()
leibie1=SafeRequestform("leibie1")
leibie2=SafeRequestform("leibie2")
con=trim(SafeRequestform("con"))
if con="0" then call PopErr("请选择举报内容") 
xiangxicon=trim(SafeRequestform("xiangxicon"))
userid=trim(SafeRequestform("userid"))
goodid=trim(SafeRequestform("goodid"))
ayjupass=trim(SafeRequestform("ayjupass"))

if isNumeric(goodid)=false then 
	rs.open "select aygoodid,aygoodmd5 from aygood where aygoodmd5='"&goodid&"'" ,conn,1,1
	if not(rs.bof and rs.eof) then
	goodid=rs("aygoodid")
	else
	call PopErr("未找到该商品") 
	end if
	rs.close
end if

jubaoname=trim(SafeRequestform("jubaoname"))
'if leibie1="" and leibie2="" then call PopErr("请选择举报类别") 
rs.open "select * from ayjubao" ,conn,1,3
rs.addnew
if leibie1<>"" then rs("ayjubaosh")=1
if leibie2<>"" then rs("ayjubaogood")=1
rs("ayjubaocon")=con
if xiangxicon<>"" then rs("ayjubaoxcon")=xiangxicon
rs("ayjubaouid")=clng(userid)
if goodid<>"" then rs("ayjubaogid")=goodid
rs("aydate")=now()
rs("ayjuname")=jubaoname 
rs("ayjupass")=ayjupass
rs.update
rs.close
call logadd("0",jubaoname&"举报投诉成功",0,0) 
call PopErr2("举报/投诉成功","/") 
end if




if act="add" then
call chkwurl()

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

	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="" then call PopErr("请填写完整") 
if userid="" then call PopErr("请勾选一个举报内容") 


if jubaodd<>"" then

ddku=getddku(jubaodd)

sql="select aydingdansum,aydingdanuser from "&ddku&" where aydingdanuser='"&userid&"' and aydingdansum='"&jubaodd&"'" 
rs.open sql,conn,1,1
if rs.bof and rs.eof then call PopErr("在举报的商户下未找到该订单号，请检查订单号是否正确") 
rs.close
end if

sql="select * from ayjubao where jubaodd='"&jubaodd&"' and ayjuzt=0" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then call PopErr2("该订单已经投诉并受理，请使用查询密码查看投诉进度，再次回复或撤销投诉","/tousu") 
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.update
rs.close
call logadd("0",jubaoname&"投诉成功",0,0)
call PopErr2("投诉成功",weburl)
end if
%>

<script language="javascript">
function check_add()
{
if(form1.con.value=="0"){alert("请选择投诉类别");return false}
if(form1.jubaodd.value==""){alert("请填写投诉订单号");return false;}
if(form1.xiangxicon.value==""){alert("请填写投诉内容");return false;}
if(form1.jubaoname.value==""){alert("请填写一个联系电话");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;} 

if(form1.jubaomail.value==""){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>





<div class="mian">
<div class="regbox conter">
<div class="nyclassbt01 conter">订单投诉</div>
<form name="form1" id="form1" method="post" action="" onSubmit="return check_add()">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="280" height="50" class="regtext">投诉商家：</td>
    <td width="303">
<%
if SafeRequest("userid")<>"" then

		rs.open "select aynameid,aywebname from ayname where aymd5='"&SafeRequest("userid")&"'" ,conn,1,1
		if not(rs.bof and rs.eof) then
		response.Write "<span style=font-size:14px>"&trim(rs("aywebname"))&"</span>"
		userid=rs("aynameid")
		%>
		<input name="userid" type="hidden" id="userid" value="<%=rs("aynameid")%>" />
		<%
		else
		call PopErr2("未找到商户信息","/tousu") 
		end if
		rs.close


end if



if SafeRequest("cact")="tscx" then

	if trim(SafeRequestform("ddh"))<>"" then 
	ddh=trim(SafeRequestform("ddh"))
	else
	ddh=trim(SafeRequest("ddh"))
	end if
	
	if ddh="" then call PopErr("请填写订单号") 

	if pichost<>"/" then
		if trim(weburl)<>pichost then
		response.Redirect ""&pichost&"jubaoadmin?cact=tscx&ddh="&ddh&""
		response.end
		end if
	end if

	ddku=getddku(ddh)
	
	rs.open "select * from "&ddku&" where aydingdansum='"&ddh&"'" ,conn,1,1
	if rs.bof and rs.eof then call PopErr("未找到该订单号") 
	userid=rs("aydingdanuser")
	if cint(rs("aydingdanzt"))=0 then call PopErr("该订单尚未支付成功,如遇到支付问题请联系平台客服") 
	'if datediff("h",rs("aydingdansj"),now())>24 then call PopErr("该订单已超过24小时投诉时效，不再受理投诉问题") 
	rs.close
		
	
		rs.open "select aynameid,aywebname from ayname where aynameid="&userid&"" ,conn,1,1
		if not(rs.bof and rs.eof) then
		response.Write "<span style=font-size:14px>"&trim(rs("aywebname"))&"</span>"
		userid=rs("aynameid")
		%>
		<input name="userid" type="hidden" id="userid" value="<%=rs("aynameid")%>" />
		<%
		else
		call PopErr2("未找到商户信息","/tousu") 
		end if
		rs.close
	
	
	
	
end if
%>	
    </td>
    <td width="452"></td>
  </tr>
  <tr>
    <td height="50" class="regtext">投诉类别：</td>
    <td>
<select name="con" id="con" class="reginput">
      <option value="0">请选择举报内容</option>
      <option value="商家存在欺诈行为">商家存在欺诈行为</option>
      <option value="商品虚假">商品虚假</option>
      <option value="商品涉及非法内容">商品涉及非法内容</option>
      <option value="卡密失效">卡密失效</option>
    </select>
    </td>
    <td><div id="pass1d" class="regts" >请选择一个投诉类别</div></td>
  </tr>
  <tr>
    <td height="50" class="regtext">投诉订单：</td>
    <td><input name="jubaodd" type="text" class="reginput" id="jubaodd"  value="<%=server.HTMLEncode(ddh)%>" maxlength="18"></td>
    <td></td>
  </tr>
  <tr>
    <td height="50" 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" class="regtext">联系手机：</td>
    <td><input name="jubaoname" type="text" class="reginput" id="jubaoname"  maxlength="11"></td>
    <td><div id="pass1d" class="regts" >请填写真实常用手机号码</div></td>
  </tr>
  <tr>
    <td height="50" class="regtext">联系邮箱：</td>
    <td><input name="jubaomail" type="text" class="reginput" id="jubaomail"></td>
    <td><div id="pass1d" class="regts" >请填写真实常用邮箱</div></td>
  </tr>
  <tr>
    <td height="50" class="regtext">查询密码：</td>
    <td><input name="ayjupass" type="text" class="reginput" id="ayjupass" maxlength="18"></td>
    <td><div id="pass1d" class="regts" >请设置一个查询投诉进展的查询密码</div></td>
  </tr>
  <tr>
    <td height="50" class="regtext">上传截图：</td>
    <td colspan="2">
<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>
      <br>(图片格式：jpg gif png 图片大小不超过500K)
  <br> <br>
      <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="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" /></td>
  </tr>
  </table>
</form>
<br>

</div>
</div>



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