<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../inc/charsetasp.asp"-->
<!DOCTYPE html>
<html>
<head>
<title>会员中心在线充值-<%=application(siternd & "55trsitetitle")%></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<!--#include file="../core/Conn.asp"-->
<!--#include file="../core/fun/fun.asp"-->
<!--#include file="../core/fun/core.asp"-->
<!--#include file="../core/md5.asp"-->
<!--#include file="../crinc/czsetinc170824.asp"-->
<!--#include file="../inc/czcj170824f8ir85.asp"-->

<%
funpath = "../"
Const dbpath = "../"

username = tr_killstr(request.querystring("username"), 5, 128, 2, "", "", "", "", 2)
if isuzdy170824=1 then
zdyje = tr_killstr(request.querystring("zdyje"), 3, 8, 1, "", "", "", "", 1)
payfor = tr_killstr(request.querystring("rmbv"), 1, 8, 1, "", "", "", "", 1)
else
zdyje=""
payfor = tr_killstr(request.querystring("rmbv"), 1, 8, 1, "", "", "", "", 2)
end if
if zdyje="" then zdyje=0
if zdyje>0 then payfor=zdyje
if zdyje=0 and payfor="" then Call contrl_message ("请回到充值页面选择充值金额。", "", "", "", "")
usernamemd5=trmd5(username)
everyjf=getuserallczjf170824(payfor,czjifen170824,cztype170824,czbili170824,czextra170824,isuzdy170824)
speveryjf=split(everyjf,",")
ubeveryjf=ubound(speveryjf)
czgivejf=formatnum2w170824(csng(speveryjf(0)))
ewgivejf=0
allgivejf=0
if ubeveryjf>0 then
ewgivejf=formatnum2w170824(csng(speveryjf(1)))
showewjfstr="赠"&ewgivejf&""
end if
if ubeveryjf>1 then
allgivejf=formatnum2w170824(csng(speveryjf(2)))
end if
showczjfstr="充"&czgivejf&""
showgivejfstr="共"&allgivejf&"积分"

if ewgivejf>0 then 
ordername=sitename&"用户["&username&"]充值"&payfor&"元["&showgivejfstr&"，"&showczjfstr+showewjfstr&"]"
else
ordername=sitename&"用户["&username&"]充值"&payfor&"元["&showgivejfstr&"]"

end if
payfor=FormatNumber(payfor,2)
If InStr(payfor, ".") = 1 Then payfor = "0"&payfor
if instr(payfor,",")>0 then payfor=replace(payfor,",","")
ndup = 0
sql = "select * from tr_orderlist170820 where usernamemd5 = '"&usernamemd5&"' and isdel=0 and truepay="&payfor&" and ispass = 0 "
'response.write sql
rs.Open sql, conn, 0, 1
If Not rs.EOF Then
ndup = 0'有订单记录
ordernum = rs("ordernum")
Else
ordernum = crordernum170824()
ndup = 1'没有订单记录
End If
rs.Close

If ndup = 1 Then

  id = GetMaxValue("tr_orderlist170820", "id") + 1
  sql = "select * from tr_orderlist170820 where usernamemd5 = '"&usernamemd5&"' and isdel=0 and truepay="&payfor&" and ispass = 0 "
  rs.Open sql, conn, 1, 3
  If rs.EOF Then
    rs.addnew()
    Rs("id") = id
    Rs("ordernum") = ordernum
    Rs("truepay") = payfor
    Rs("ordername") = ordername
    Rs("username") = username
    Rs("usernamemd5") = usernamemd5
    Rs("alipayordernum") = ""
    Rs("alipayid") = ""
    Rs("alipayuname") = ""
    Rs("paytype") = 1
    Rs("leaveword") = ""
    Rs("ip") = getip()
    Rs("addtime") = FormatDate(Now(), 1)
    Rs("ispass") = 0
    Rs("isdel") = 0
    Rs("buytime") = null
    Rs("truejf") = allgivejf

  ElseIf Rs("ispass") = 0 Then
'    Rs("id") = id
'    Rs("ordernum") = ordernum
    Rs("truepay") = payfor
    Rs("ordername") = ordername
    Rs("username") = username
    Rs("ip") = getip()
    Rs("truejf") = allgivejf
  End If
  rs.update
  rs.Close
End If


%>
<link rel="stylesheet" type="text/css" href="<%=funpath%>skin/default/style.css" />
<%if 1=2 then%>
<link rel="stylesheet" type="text/css" href="../skin/default/style.css" />
<%end if%>
<style type="text/css">
body{background:#f5f5f5;}


</style>

</head>
<body>
<div class="box170831 clearfix">
<div class="buyz clearfix">
<div class="buyztt"> <%=sitename170824%>在线支付订单确认 </div>
<div class="buyznr">
<p class="ddnotice">订单已生成，点击下方的支付按钮，付款后系统会自动充值到您账户</p>
<p>商品名称：<%=ordername%></p>
<p>支付金额：<span class="payfor"><%=payfor%> 元</span></p>
<p>用 户 名：<%=username%>
<p>订单编号：<%=ordernum%></p>
<p>选择支付方式：</p>
</div>
<div class="subbt">
<table border="0" align="center">
<tr>
<td align="center" >
<form name="alipayment" action="" method="post" target="_self" style="margin-right:50px;width:180px;height:180px;float:left;">
<input size="30" name="WIDout_trade_no" value="<%=ordernum%>" type="hidden" />
<%'商户订单号%>
<input size="30" name="WIDsubject" value="<%=ordername%>" type="hidden"/>
<%'订单名称%>
<input size="30" name="WIDtotal_fee" value="<%=payfor%>" type="hidden" />
<%'付款金额%>
<input size="30" name="WIDbody" value="" type="hidden" />
<%'商品描述%>
<button class="bt2" type="submit"></button>
</form>
<form name="wxpayment" action="" method="post" target="_self" style="margin-right:50px;width:180px;height:180px;float:left;">
<input size="30" name="ordernum" value="<%=ordernum%>" type="hidden" />
<%'商户订单号%>
<button class="bt1" type="submit"></button>
</form>


</td>
</tr>
</table>
<div class="" style="width:90%; padding:10px; background:#FFF2F5;">温馨提示：尊敬的站长朋友，此功能需要付费用户才能解锁使用，感谢支持</div>
</div>
<br>
<br>
</div>
<span style="display:none"><%=application(siternd&"55tr"&"statisticscode")%></span> 
<script language="javascript">
//function showid(trid,trid2)
//{
//document.getElementById(trid).style.display = "block";	
//document.getElementById(trid2).style.display = "block";	
//}
</script>
</div>
</body>
</html>
<%
%>