<!--#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_2').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

if SafeRequest("act")="zhuijia" then
sum=SafeRequestform("sum")
zhuicon=SafeRequestform("zhuicon")
if trim(zhuicon)="" then call PopErr("请填写追加内容")
tyiju=SafeRequestform("tyiju")
touid=SafeRequestform("touid")
if tyiju="" or touid="" then call PopErr("参数不完整")

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

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)

sql="select * from ayjubao where ayjubaoid='"&touid&"'" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then

if cint(rs("ayjuzt"))=1 then 
call PopErr2("该投诉已完结","/")
response.End()
end if

ayjubaouid=rs("ayjubaouid")
ayjubaozt=rs("ayjubaozt")

jubaoqq=trim(rs("jubaoqq"))
jubaoname=trim(rs("ayjuname"))
jubaomail=trim(rs("jubaomail"))
aydate=rs("aydate")
jubaodd=trim(rs("jubaodd"))
con=trim(rs("ayjubaocon"))
if cint(rs("jubaojinzhan"))<>4 then rs("jubaojinzhan")=3 '买家回复
rs("jubaoisnew")=1
rs("jubaolastdate")=now()
rs.update
end if
rs.close

sql="select aynameid,aymail,aytel,wxopenid from ayname where aynameid='"&ayjubaouid&"'" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
smail=trim(rs("aymail"))
stel=trim(rs("aytel"))
wxopenid=trim(rs("wxopenid"))
rs.update
end if
rs.close


sql="select * from ayjubao" 
rs.open sql,conn,1,3
rs.addnew
rs("ayjubaosjid")=touid
rs("ayjuhuifu")=zhuicon
rs("aydate")=now()
rs("ayjuishui")=1
rs("ayjuishuisid")=1
if downf<>"" then rs("ayjudown")=downf
rs.update
rs.close

if cint(ayjubaozt)=1 then
title="来自"&webname&"-投诉有了新的进展"     
body="您收到投诉得到了新的回复，请登录后进行查看，请妥善处理投诉，谢谢您的理解与配合"
conn.Execute("Insert Into mailto(mto,mti,mcon) values('"&trim(smail)&"','"&trim(title)&"','"&trim(body)&"')")
call mokuai_sms("IK14","2",trim(stel),body,"","","","")

	if wxopenid<>"" then
	wxend="买家QQ:"&jubaoqq&"\n"
	wxend=wxend&"买家电话:"&jubaoname&"\n"
	wxend=wxend&"买家邮箱:"&jubaomail&"\n"
	wxend=wxend&"投诉时间:"&aydate&"\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

end if

call logadd("0",touid&"投诉追加成功",0,0)
call PopErr2("投诉追加成功！","tousulist")
end if

if SafeRequest("act")="chexiao" then
id=SafeRequest("id")
pass=trim(SafeRequest("pass"))
if id="" or pass="" then call PopErr("缺少投诉ID或投诉依据！")

		rs.open "select * from ayjubao where ayjubaoid="&id&" and ayjupass='"&pass&"'" ,conn,1,3
		if not(rs.bof and rs.eof) then

		if cint(rs("ayjuzt"))=1 then 
		call PopErr2("该投诉已完结","/")
		response.End()
		end if

		rs("ayjuzt")=1
		rs("jinzt")=2
		jine=rs("jine")
		ayjubaouid=rs("ayjubaouid")
		jubaodd=trim(rs("jubaodd"))
		rs.update
		else
		call PopErr("未找到该投诉记录！")
		end if
		rs.close
		
		sql="select * from ayjubao" 
		rs.open sql,conn,1,3
		rs.addnew
		rs("ayjubaosjid")=id
		rs("ayjuhuifu")="[系统自动标注:买家撤销投诉]"
		rs("aydate")=now()
		rs("ayjuishui")=1
		rs("ayjuishuisid")=9
		rs("ayjuzt")=1
		rs.update
		rs.close
		
		rs.open "select * from ayname where aynameid="&ayjubaouid&"",conn,1,3
		if rs.bof and rs.eof then call PopErr("未找到此会员")
		cwku=trim(rs("cwku"))
		buyuseryue=ccur(rs("ayyue"))+ccur(jine)
		rs("ayyue")=ccur(rs("ayyue"))+ccur(jine)
		rs("aydongjie")=ccur(rs("aydongjie"))-ccur(jine)
		rs.update
		rs.close
		
		'创建财务流水
		leibie=0
		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,aycwinjin,aycaiwuzhifu) values('1','"&crandarr&"','"&leibie&"','"&clng(ayjubaouid)&"','"&now()&"','"&Formatnumber(jine,2,true,-1,0)&"','"&Formatnumber(buyuseryue,2,true,-1,0)&"','投诉返还"&jubaodd&"','"&Formatnumber(jin,2,true,-1,0)&"','"&Formatnumber(jine,2,true,-1,0)&"','99')")
				
		
call PopErr2("投诉撤销成功，订单金额已返还商家！","tousulist")

end if
%>
<br>
<DIV id=main2> 
<%call webleft()%>

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

<H2><SPAN>投诉列表</SPAN></H2>
<DIV class=main3>

<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 language="javascript" type="text/javascript"> 
var interval = 1000; 
function ShowCountDown(year,month,day,hour,minute,divname) 
{ 
var now = new Date(); 
var endDate = new Date(year, month-1, day,hour,minute); 
var leftTime=endDate.getTime()-now.getTime(); 
var leftsecond = parseInt(leftTime/1000); 
var day1=Math.floor(leftsecond/(60*60*24)); 
var hour=Math.floor((leftsecond-day1*24*60*60)/3600); 
var minute=Math.floor((leftsecond-day1*24*60*60-hour*3600)/60); 
var second=Math.floor(leftsecond-day1*24*60*60-hour*3600-minute*60); 
var cc = document.getElementById(divname); 
if(day1<0)
{
cc.innerHTML = "已超过24小时"; 
}
else
{
cc.innerHTML = day1+"天"+hour+"小时"+minute+"分"+second+"秒"; 
}
} 
</script> 
  <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0"  class="table_style_a1">
<%
sql="select * from ayjubao where jubaomaiid="&request.Cookies("aynameid")&" order by ayjuzt asc,ayjubaoid desc" 
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
n=1
do while not rs.eof

					set rsu=server.CreateObject("adodb.recordset")
					sqlu="select aynameid,aywebname,aymail,ayqq,aytel,ayweixinid,ayusermiaoshu from ayname where aynameid="&rs("ayjubaouid")&"" 
					rsu.open sqlu,conn,1,1
					if not(rsu.bof and rsu.eof) then
					aymail=trim(rsu("aymail"))
					ayqq=rsu("ayqq")
					aytel=rsu("aytel")
					ayweixinid=trim(rsu("ayweixinid"))
					ayusermiaoshu=trim(rsu("ayusermiaoshu"))
					aywebname=trim(rsu("aywebname"))
					end if
					rsu.close

%>
  <tr>
    <td height="30" align="center" class="border_bottom border_right" style="font-weight: bold">投诉订单号</td>
    <td align="center" class="border_bottom border_right" style="font-weight: bold">投诉商家</td>
    <td align="center" class="border_bottom border_right" style="font-weight: bold">商家QQ</td>
    <td align="center" class="border_bottom border_right" style="font-weight: bold">商家微信</td>
    <td align="center" class="border_bottom border_right" style="font-weight: bold">商家电话</td>
    <td align="center" class="border_bottom border_right" style="font-weight: bold">商家邮箱</td>
    <td align="center" class="border_bottom " style="font-weight: bold">投诉状态</td>
  </tr>
<form action="?act=zhuijia" method="post" name="form<%=n%>" id="form<%=n%>">

  <tr style="background-color: #D2FFFF">
    <td height="30" align="center" class="border_bottom border_right">
      <%if trim(rs("jubaodd"))<>"" then %>
      <strong><%=trim(rs("jubaodd"))%></strong>
      <%else
	response.Write "-"
	end if%>
    </td>
    <td align="center" class="border_bottom border_right"><%=aywebname%></td>
    <td align="center" class="border_bottom border_right"><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=<%=ayqq%>&site=qq&menu=yes"><%=ayqq%></a></td>
    <td align="center" class="border_bottom border_right">
                    <%
					if ayweixinid<>"" then
					response.Write ayweixinid
					else
					response.Write "-"
					end if
					%>
    </td>
    <td align="center" class="border_bottom border_right"><%=aytel%></td>
    <td align="center" class="border_bottom border_right"><%=aymail%></td>
    <td align="center" class="border_bottom ">
      <%if cint(rs("ayjuzt"))=0 then response.Write "<span style=color:#FF0000>处理中</span>"
	if cint(rs("ayjuzt"))=1 then response.Write "<span style=color:#00CC00>处理完毕</span>"
	%>    </td>
  </tr>
  <tr><td height="30" colspan="7" align="center">
  <table width="99%" border="0" cellpadding="0" cellspacing="0">
  
				<tr>
				<td width="106" align="center" valign="middle" bgcolor="#FFF2DF"><span style="font-weight: bold;color:#F60">商家公告：</span></td>
			    <td width="844" align="left" style="line-height:25px;"  bgcolor="#FFF2DF">
				<%
                if trim(ayusermiaoshu)<>"" then 
				response.Write server.HTMLEncode(trim(ayusermiaoshu))
				else
				response.Write "暂无公告！"
				end if
                %>
                </td>
				</tr>
  
    <tr>
      <td width="100" align="center"><span style="font-weight: bold">详细内容：</span></td>
      <td width="824" align="left" style="line-height:25px;"><br>
					<%ntime=DateAdd("h",24,rs("aydate"))%>
                    <script language="javascript" type="text/javascript">window.setInterval(function(){ShowCountDown('<%=year(ntime)%>','<%=Month(ntime)%>','<%=day(ntime)%>','<%=hour(ntime)%>','<%=minute(ntime)%>','t<%=rs("ayjubaoid")%>');}, interval);</script> 
                      <span style="color:#390">投诉时间：<%=rs("aydate")%> 【24小时未解决 由平台退款 剩余时间：<span  id="t<%=rs("ayjubaoid")%>"></span>】</span>
                      <span style="color:#390">【订单金额<%=Formatnumber(rs("jine"),2,true,-1,0)%>元&nbsp;
					  <%
					  if cint(rs("jinzt"))=0 then response.Write "未冻结"
					  if cint(rs("jinzt"))=1 then response.Write "已冻结"
					  if cint(rs("jinzt"))=2 then response.Write "已返还商家"
					  if cint(rs("jinzt"))=3 then response.Write "已返还买家"
					  %>】</span>
                       <br>
      
	  <%
	if trim(rs("ayjubaoxcon"))<>"" then
	response.Write "<span style=color:#69C>["&rs("aydate")&"]&nbsp;买家："&server.HTMLEncode(rs("ayjubaoxcon"))&"&nbsp;</span>"
	
	if trim(rs("ayjudown"))<>"" then
	picstr=split(rs("ayjudown"),";")
	For pic=0 To Ubound(picstr) %>
	<a href="<%=server.HTMLEncode(picstr(pic))%>" style="color:#69C" target="_blank">【截图查看】</a>&nbsp;
	<%next
	end if
	response.Write("<br>")
	end if
	
	set rsf=server.CreateObject("adodb.recordset")
	sqlf="select * from ayjubao where ayjubaosjid="&rs("ayjubaoid")&" order by ayjubaoid asc" 
	rsf.open sqlf,conn,1,1
	if not(rsf.bof and rsf.eof) then
	do while not rsf.eof
	
	if cint(rsf("ayjuishuisid"))=0 then response.Write "<span style=color:#F60>["&rsf("aydate")&"]&nbsp;商家: "
	if cint(rsf("ayjuishuisid"))=1 then response.Write "<span style=color:#69C>["&rsf("aydate")&"]&nbsp;买家: "
	if cint(rsf("ayjuishuisid"))=9 then response.Write "<span style=color:#F60>["&rsf("aydate")&"]&nbsp;管理员: "
	response.Write server.HTMLEncode(rsf("ayjuhuifu"))&"&nbsp;</span>"
	
	if trim(rsf("ayjudown"))<>"" then
	picstr=split(rsf("ayjudown"),";")
	For pic=0 To Ubound(picstr) %>
	<a href="<%=server.HTMLEncode(picstr(pic))%>" <%if cint(rsf("ayjuishuisid"))=0 then response.Write "style=color:#F60":else: response.Write "style=color:#69C":end if%> target="_blank">【截图查看】</a>&nbsp;
	<%next
	end if
	
	response.Write("<br>")
	rsf.movenext  
	loop
	end if
	rsf.close
	%>
	 <br>
			 <input name="isdel" type="hidden" id="isdel" />
			 <input name="iszhuijia" type="hidden" id="iszhuijia" />
			 <input name="tyiju" type="hidden" id="tyiju" value="<%=trim(rs("ayjupass"))%>" />
			 <input name="touid" type="hidden" id="touid" value="<%=rs("ayjubaoid")%>" />
			 <input name="sum" type="hidden" id="sum" value="<%=n%>" />
     
	 <%if cint(rs("ayjuzt"))=0 then%> 
<script>
			KindEditor.ready(function(K) {
				var uploadbutton1<%=n%> = K.uploadbutton({
					button : K('#uploadButton1<%=n%>')[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<%=n%>').val(urlcon);
							con1<%=n%>.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton1<%=n%>.fileBox.change(function(e) {
					uploadbutton1<%=n%>.submit();
				});
			});
			
			
			KindEditor.ready(function(K) {
				var uploadbutton2<%=n%> = K.uploadbutton({
					button : K('#uploadButton2<%=n%>')[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('#picurl2<%=n%>').val(urlcon);
							con2<%=n%>.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton2<%=n%>.fileBox.change(function(e) {
					uploadbutton2<%=n%>.submit();
				});
			});
			
		
			KindEditor.ready(function(K) {
				var uploadbutton3<%=n%> = K.uploadbutton({
					button : K('#uploadButton3<%=n%>')[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('#picurl3<%=n%>').val(urlcon);
							con3<%=n%>.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton3<%=n%>.fileBox.change(function(e) {
					uploadbutton3<%=n%>.submit();
				});
			});
			
			KindEditor.ready(function(K) {
				var uploadbutton4<%=n%> = K.uploadbutton({
					button : K('#uploadButton4<%=n%>')[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('#picurl4<%=n%>').val(urlcon);
							con4<%=n%>.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton4<%=n%>.fileBox.change(function(e) {
					uploadbutton4<%=n%>.submit();
				});
			});
			
			KindEditor.ready(function(K) {
				var uploadbutton5<%=n%> = K.uploadbutton({
					button : K('#uploadButton5<%=n%>')[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('#picurl5<%=n%>').val(urlcon);
							con5<%=n%>.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton5<%=n%>.fileBox.change(function(e) {
					uploadbutton5<%=n%>.submit();
				});
			});
		</script>
	 <textarea name="zhuicon" cols="80" rows="4" id="zhuicon"></textarea>
	 <br>
	  <input name="pic1<%=n%>" type="hidden" class="ke-input-text" id="picurl1<%=n%>" value="" readonly="readonly" /> <input type="button" id="uploadButton1<%=n%>" value="上传截图1" />
      <input name="pic2<%=n%>" type="hidden" class="ke-input-text" id="picurl2<%=n%>" value="" readonly="readonly" /> <input type="button" id="uploadButton2<%=n%>" value="上传截图2" />
      <input name="pic3<%=n%>" type="hidden" class="ke-input-text" id="picurl3<%=n%>" value="" readonly="readonly" /> <input type="button" id="uploadButton3<%=n%>" value="上传截图3" />
      <input name="pic4<%=n%>" type="hidden" class="ke-input-text" id="picurl4<%=n%>" value="" readonly="readonly" /> <input type="button" id="uploadButton4<%=n%>" value="上传截图4" />
      <input name="pic5<%=n%>" type="hidden" class="ke-input-text" id="picurl5<%=n%>" value="" readonly="readonly" /> <input type="button" id="uploadButton5<%=n%>" value="上传截图5" />
      <br><span id="con1<%=n%>"></span>&nbsp;<span id="con2<%=n%>"></span>&nbsp;<span id="con3<%=n%>"></span>&nbsp;<span id="con4<%=n%>"></span>&nbsp;<span id="con5<%=n%>"></span>
      <br>
		<table width="713" border="0">
		<tr>
		<td width="323" align="center"><input type="submit" name="Submit" class="logindlreg" style="cursor:pointer" value=" 追加内容 "/></td>
		<td width="287"><a class="logindlreg" style="color:#FFF" onClick="javascript:return confirm('撤销投诉意味着你的投诉问题已解决，撤销投诉后的一切问题平台概不负责，您确定要撤销投诉吗？');" href="?act=chexiao&id=<%=rs("ayjubaoid")%>&pass=<%=Server.UrlEncode(trim(rs("ayjupass")))%>">撤销投诉</a></td>
		</tr>
		</table>
	 <%end if%>
	 </td>
    </tr>
  </table></td></tr>
  
  <tr><td height="30" colspan="7" align="center" class="border_bottom">&nbsp;</td></tr>
  </form>
<%
n=n+1
rs.movenext  '指针向下移动
loop
else
%>
  <tr>
    <td height="30" colspan="7" align="center" class="border_bottom border_right">没有投诉记录</td>
    </tr>
<%end if%> 
</table>
<br><br>
			<div class="mzsmbox conter">
			<strong>重要提示：</strong><br>
			不要轻信商家以各种理由，让买家先撤销投诉再退款之类的话！<br>
			同一订单只能投诉一次，撤销投诉后，将不能再次投诉！<br>
			如果撤销了投诉，意味着你的投诉问题已经解决并处理好，撤销投诉后的后续问题平台概不负责！<br>
			</div>
  <br>
</DIV>


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


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


