<!--#include virtual="/inc/conn.asp"-->
<!--#include virtual="/inc/sitecon.asp"-->
<%
if SafeRequest("act")="cha" then
id=SafeRequest("id")

	rs.open "select top 1 * from "&trim(getddku(id))&" where aydingdansum='"&id&"'",conn,1,1
	if not(rs.bof and rs.eof) then
	
			if cint(rs("aydingdanzt"))=1 then
				dailikuo=trim(rs("dailikuo"))'代理关系
				dailiku=""					'总代理卡密库 
				if dailikuo<>"" then
				dailistr=split(dailikuo,"|")
				dailiuserstr=split(dailistr(Ubound(dailistr)),",")
				dailiku=trim(dailiuserstr(5))
				end if
					
				yifenpei=getddokkami(trim(rs("aydingdansum")),rs("aydingdanuser"),dailiku)
				
				if ccur(yifenpei)>0 then
				response.Write "ok"
				end if
			else
			response.Write "-"	
			end if
	else
	response.Write "-"		
	end if
	
response.End()
end if
%>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script src="/Template/newbuy/css/jquery.min.js" type="text/javascript"></script>



<%if SafeRequest("c")="buy" then
if trim(SafeRequest("did"))="" then 
response.Write("缺少参数")
response.End()
end if
%>
<title>支付成功，正在跳转</title>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="40%" align="right"><img src="<%=ossurl%>images/payok.gif"></td>
    <td width="60%">&nbsp;<font size="3px">支付成功！正常查询，请稍等... 如果订单状态未支付，请尝试刷新订单！</font></td>
  </tr>
</table>

			<script type="text/javascript">
                   var timer;
                    $(function(){
                        var handler = function(){
                            $.post("/pay/payok.asp?act=cha&id=<%=trim(SafeRequest("did"))%>",null,function(msg){
                                if(msg == 'ok'){
                                    document.location.href="/tika?ka=<%=trim(SafeRequest("did"))%>";
                                    clearInterval(timer);
                                }
                            });
                        } 
                        timer = setInterval(handler , 2000); 
                    });
            </script>

<%
response.end
end if
%>





<%if SafeRequest("c")="ok" then%>
<title>充值成功，正在跳转</title>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="30%" align="right"><img src="<%=ossurl%>images/payok.gif"></td>
    <td width="60%">&nbsp;<font size="3px">充值成功！正在为您跳转，请稍等...如果返回数据有延时，请刷新！</font></td>
  </tr>
</table>
<script language="JavaScript">
function Redir(){
a ="/user/mycaiwu";  
TimerID=setTimeout('window.location.href=a',3000)
}
</script>
<body onLoad="Redir()">
<%
response.end
end if
%>


<%if SafeRequest("c")="pok" then%>
<title>付款成功，正在跳转</title>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="30%" align="right"><img src="<%=ossurl%>images/payok.gif"></td>
    <td width="60%">&nbsp;<font size="3px">付款成功！正在为您跳转，请稍等！如果订单状态未支付，请刷新订单！</font></td>
  </tr>
</table>
<script language="JavaScript">
function Redir(){
a ="/";  
TimerID=setTimeout('window.location.href=a',3000)
}
</script>
<body onLoad="Redir()">
<%
response.end
end if
%>


<%if SafeRequest("c")="ck" then%>
<title>支付成功，正在跳转</title>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="30%" align="right"><img src="<%=ossurl%>images/payok.gif"></td>
    <td width="60%">&nbsp;<font size="3px">支付成功！正在为您跳转，请稍等...如果返回数据有延时，请刷新！</font></td>
  </tr>
</table>
<script language="JavaScript">
function Redir(){
a ="/chaxun";  
TimerID=setTimeout('window.location.href=a',3000)
}
</script>
<body onLoad="Redir()">
<%
response.end
end if
%>




<%
		'财务状态更新

		'商品购买 订单查询入库
		out_trade_no=trim(SafeRequestform("paydd"))
		if out_trade_no="" then call PopErr2("访问已被终止","/")
		trade_no=trim(SafeRequestform("paydd"))
		
		'call payokbuy(out_trade_no,trade_no,"re")
	


%>


