<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include virtual="/inc/conn.asp"-->
<!--#include virtual="/inc/sitecon.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>向平台付款</title>

<script src="/Template/newbuy/css/jquery.min.js" type="text/javascript"></script>
<script src="/inc/layer/layer.js" type="text/javascript"></script>

<style type="text/css">
a{text-decoration : none}
</style>

</head>

<body>

	<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)
    {
    //document.location.href="err2.asp";
    }
    else
    {
    cc.innerHTML = "请在"+minute+"分"+second+"秒内支付"; 
    }
    } 
    </script> 
    
<%
total_fee=SafeRequestform("total_fee")
out_trade_no=SafeRequestform("out_trade_no")
contact=SafeRequestform("contact")
act=SafeRequestform("act")
shouid=SafeRequestform("shouid")
jjjin=SafeRequestform("jjjin")
allname=SafeRequestform("allname")
	
'total_fee="1050"
'out_trade_no="DAA000000000000001"
'shouid=SafeRequestform("shouid")
'picname="alisaobjik.jpg"
'act="ali"
'jjjin=SafeRequestform("jjjin")
	
if shouid=""  then
response.Write "缺少参数shouid"
response.End()
end if

if total_fee=""  then
response.Write "缺少参数total_fee"
response.End()
end if

if out_trade_no="" then
response.Write "缺少参数out_trade_no"
response.End()
end if

if act="" then
response.Write "缺少参数act"
response.End()
end if


if act<>"ali" and act<>"wei" and act<>"qq" then 
response.Write "场景错误"
response.End()
end if

'收款码ID
sql="select * from ayshoukuan where ayshoukuanid="&shouid&"" 
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
picname=trim(rs("pic"))
else
response.Write "通道参数有误"
response.End()
end if
rs.close



if showtel="yes" then

	if ccur(total_fee)=ccur(jjjin) then
	tishi="款项由平台收取，交易安全有保障！<br>平台客服QQ："&fuwuqq&"<br>平台电话："&fuwutel&""
	else
	tishi="系统为了识别订单，您可能会多支付1至9分钱！均属于正常！<br><br>请按页面第2步提示的金额付款！<br>否则系统无法识别订单将无法提卡！<br><br>平台客服QQ："&fuwuqq&"<br>平台电话："&fuwutel&""
	end if

else

	if ccur(total_fee)=ccur(jjjin) then
	tishi="款项由平台收取，交易安全有保障！<br>平台客服QQ："&fuwuqq&""
	else
	tishi="系统为了识别订单，您可能会多支付1至9分钱！均属于正常！<br><br>请按页面第2步提示的金额付款！<br>否则系统无法识别订单将无法提卡！<br><br>平台客服QQ："&fuwuqq&""
	end if

end if
%>

<script language="javascript">
window.onload = function(){layer.alert('<%=tishi%>',{title: '重要提示',});}
</script>


<%

if act="ali" then
shoukuanid="平台"
quname="支付宝"
%>
<style type="text/css">body {background-color: #2d95e0;}</style>
<%end if%>

<%
if act="wei" then
shoukuanid="平台"
quname="微信"
%>
<style type="text/css">body {background-color: #22ab38;}</style>
<%end if%>

<%
if act="qq" then
shoukuanid="平台"
quname="QQ"
%>
<style type="text/css">body {background-color: #3bc4af;}</style>
<%end if
%>

<div style="margin:0 auto;border-radius:6px;width:500px; height:400px; background-color:#FFF"> 

    <div style="margin:0 auto; padding-top:20px;width:320px; height:60px; font-size:18px; color:333333; text-align:center">
    <span style="font-size:22px; color:#F30">第1步  </span><%=quname%>扫一扫，向<span style="color:#F30;font-weight:bold"><%=shoukuanid%></span>付款
    </div>
    
	<%
	ddku=getddku(out_trade_no)
	dtime=now()
	rs.open "select top 1 aydingdansj,aydingdansum from "&ddku&" where aydingdansum='"&out_trade_no&"'" ,conn,1,1	
	if not(rs.bof and rs.eof) then
    dtime=rs("aydingdansj")
	end if
	rs.close
    overtimi=DateAdd("n",5,dtime)
    %>
	<script language="javascript" type="text/javascript">
    window.setInterval(function(){ShowCountDown('<%=year(overtimi)%>','<%=Month(overtimi)%>','<%=day(overtimi)%>','<%=hour(overtimi)%>','<%=minute(overtimi)%>','time');}, interval);
    </script>
    <div style="margin:0 auto;width:260px;">
    <img src="<%=picname%>" width="260" />
    
	<div style="text-align:center; padding-top:10px;"><span style="font-size:15px;color:#999">全称校验：<%=allname%><br><span id="time"></span></span></div>
    
    </div>

</div>


<div style="margin:0 auto; margin-top:20px;border-radius:6px;width:500px; height:100px; background-color:#FFF"> 

    <div style="margin:0 auto; padding-top:20px;width:320px; height:60px; font-size:18px; color:333333; text-align:center">
    <span style="font-size:22px; color:#F30">第2步  </span>
    <span style=" color:333333">输入金额 </span>
    <span style="font-size:40px; color:#F30;"><i><%=Formatnumber(jjjin,2,true,-1,0)%></i></span>
    </div>

</div>


<div style="margin:0 auto; margin-top:20px;border-radius:6px;width:500px; height:100px; background-color:#FFF"> 

    <div style="margin:0 auto; padding-top:30px;width:420px; height:60px; font-size:18px; color:333333; text-align:center">
    
    
	<%if act="ali" then%>
    
    <span style="font-size:30px;"><a style="color:#108ee9" href="<%=weburl%>chaxun?con=<%=contact%>">3.支付后请等待页面自动跳转！</a></span>
    
	<%elseif act="wei" then%>
    
    <span style="font-size:30px;"><a style="color:#22ab38" href="<%=weburl%>chaxun?con=<%=contact%>">3.支付后请等待页面自动跳转！</a></span>
    
	<%elseif act="qq" then%>
    
    <span style="font-size:30px;"><a style="color:#3bc4af" href="<%=weburl%>chaxun?con=<%=contact%>">3.支付后请等待页面自动跳转！</a></span>
    
    <%end if%>
    
    </div> 
 
</div>
  


<div style="margin:0 auto; padding-top:30px;width:520px; height:60px; font-size:18px; color:333333; text-align:center">

<span style="font-size:13px; color:#ffffff">
<%=tishi%><br><br>

无法提取卡密等任何问题请联系平台客服QQ：<a target="_blank" style="color:#FFF" href="http://wpa.qq.com/msgrd?v=3&uin=<%=fuwuqq%>&site=qq&menu=yes"><%=fuwuqq%></a> 

<%if showtel="yes" then%>
电话：<%=fuwutel%>
<%end if%>
</span>
</div>



			<script type="text/javascript">
                   var timer;
                    $(function(){
                        var handler = function(){
                            $.post("/pay/?act=zishou&id=<%=out_trade_no%>",null,function(msg){
                                if(msg == 'ok'){
                                    document.location.href="/tika?ka=<%=out_trade_no%>";
                                    clearInterval(timer);
                                }
                                if(msg == 'err'){
                                    document.location.href="err.asp?did=<%=out_trade_no%>&jin=<%=Formatnumber(jjjin,2,true,-1,0)%>&contact=<%=contact%>";
                                    clearInterval(timer);
                                }
                                if(msg == 'time'){
                                    document.location.href="err3.asp";
                                    clearInterval(timer);
                                }
                            });
                        } 
                        timer = setInterval(handler , 1000); 
                    });
            </script>


</body>
</html>
