<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../inc/charsetasp.asp"-->
<!DOCTYPE html>
<html>
<head>
<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/class/tr_user.asp"-->
<!--#include file="../crinc/ulevstr.asp"-->
<!--#include file="../core/md5.asp"-->
<!--#include file="../crinc/czsetinc170824.asp"-->
<!--#include file="../inc/czcj170824f8ir85.asp"-->

<%
Const funpath = "../"
Const dbpath = "../"
Set ctr_user = New tr_user
uname = ctr_user.truserislogrecharge("user/urecharge.asp")
'response.End()
safemd5 = trmd5(uname)
points=clng(ctr_user.points)
%>
<script type="text/javascript" src="<%=funpath%>inc/isclose.asp?l=<%=funpath%>"></script>
<title>会员中心在线充值-<%=application(siternd & "55trsitetitle")%></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<link rel="stylesheet" type="text/css" href="../skin/default/style.css" />
<style type="text/css">
body { background: #f5f5f5; }
</style>
</head>
<body>
<div class="box170831 clearfix">
<div class="hyzxzxcz"> <%=sitename170824%>会员在线充值 </div>

<%if isopencz170824=0 then%>
<div class="cznr1"> 抱歉，目前暂停充值，请稍候再试 </div>
</div>
</body>
</html>
<%
response.End()
end if%>

<form name="form1" id="form1" action="../pay/usercz.asp" method="get" onSubmit="return checkusercz(this);" target="_blank">
<div class="cznr1"> 登录名：<%=ctr_user.username%>，剩余积分：<%=ctr_user.points%> </div>
<div class="cznr2 "> 请选择充值金额：<br>
<br>
<%if czjifen170824<>"" and instr(czjifen170824,"|")>0 and instr(czjifen170824,",")>0 then

czjifenjegroup=split(czjifen170824,"|")(0)
spczjifenjegroup=split(czjifenjegroup,",")
ubczjifenjegroup=ubound(spczjifenjegroup)
czjifenjfgroup=split(czjifen170824,"|")(1)
spczjifenjfgroup=split(czjifenjfgroup,",")
ubczjifenjfgroup=ubound(spczjifenjfgroup)
if ubczjifenjegroup>ubczjifenjfgroup then 
uball=ubczjifenjfgroup
else
uball=ubczjifenjegroup
end if
'response.write uball
for adri=0 to uball
if spczjifenjegroup(adri)<>"" and spczjifenjfgroup(adri)<>"" then
'response.write isuzdy170824
everyjf=getuserallczjf170824(trim(spczjifenjegroup(adri)),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&"积分"

%>
<label id="v<%=adri%>" class="labelh2cz" >
<input name="rmbv" type="radio" id="rmbv<%=adri%>" onClick="return tcapp(<%=adri%>,'',<%=uball%>);" value="<%=spczjifenjegroup(adri)%>" />
<%=spczjifenjegroup(adri)%>元（<%=showgivejfstr%><%if ewgivejf>0 then%>，<%=showczjfstr&showewjfstr%><%end if%>）</label>
<%
end if
next
end if%>


<%
if userjfstr<>"" then
spuserjfstr=split(userjfstr,",")
nfhypoints=clng(spuserjfstr(1))
zshypoints=clng(spuserjfstr(2))
if not isnumeric(nfhypoints) then nfhypoints=0
if not isnumeric(zshypoints) then zshypoints=0
end if
%>
<%
spuserjfstr = Split(userjfstr, ",")
splevnamestr = Split(levnamestr, ",")
'response.write points
For i = 0 To UBound(spuserjfstr)
  If clng(points)>= clng(spuserjfstr(i)) And clng(points)<clng(spuserjfstr(i + 1)) Then
truselevelstr=splevnamestr(i)
'response.write splevnamestr(i)
    Exit For
  ElseIf clng(points)>= clng(spuserjfstr(UBound(spuserjfstr))) Then
truselevelstr=splevnamestr(UBound(spuserjfstr))
'    response.Write "tmpstr=tmpstr+("""&splevnamestr(UBound(spuserjfstr))&""");"
    Exit For
  End If
Next
'response.write i
%>

<div class="truserczuplevelstr">
您的积分为【<%=ctr_user.points%>】，您的等级为【<%=truselevelstr%>】<br>
<span class="truuplevelstr">
<%
if i<2 then
for li=i+1 to UBound(spuserjfstr)
%>
<%=splevnamestr(li)%>需要【<%=spuserjfstr(li)%>】积分，您还需充值【<%=spuserjfstr(li)-clng(ctr_user.points)%>】积分，即可自动升级为<%=splevnamestr(li)%><br>


<%

next
end if
%>
</span>


</div>
</div>
<%if isuzdy170824=1 and cztype170824=2 then%>
<%'if isuzdy170824=1 then%>
<div class="cznr1">
<p>自定义金额：
<input name="zdyje" id="zdyje" class="zdyje" value=""/>
元，得到<span id="jsjf"> 0 </span>积分 <a href="" id="jfa"   onMouseOver="getzdyjestr()" target="ifr1" style="padding:5px;line-height:25px;background:#09F;color:#fff; text-decoration:none;">计算积分</a></p>
</div>
<%end if%>
<div class="cznr2 "> 
<!--#include file="../crinc/wzjs170824.asp"--> 
</div>
<div class="btdiv">
<input name="submit1" type="submit" id="submit1" class="btbuy" value="提交订单进行付款" />
</div>
<input name="action" type="hidden" id="action" value="usercz"/>
<input name="username" type="hidden" id="username" value="<%=ctr_user.username%>"/>
</form>
<%'body3此行代码供安装插件用勿删改%>
<div class="trdisnone" id="trdisnone"></div>
<!--#include file="../inc/ifr.asp"--> 
</div>
</body>
</html>
<script type="text/javascript">
function getzdyjestr(){
var zdyje
zdyje=parent.document.getElementById("zdyje").value 
parent.document.getElementById("jfa").href="<%=funpath%>inc/jsjfjs.asp?je="+zdyje
}
function tcapp(aid,tcrmb,aidfw) {
for (i=0;i<=aidfw ;i++ ) 
{ if (i!=aid){
document.getElementById('v' + i+'').className = "labelh2cz"
//alert (aid+'|'+i+'|'+aidfw)
}
}
document.getElementById('v'+aid+'').className = "labelh1cz"
}
function checkusercz(frm) {
var flag=0
for(var i=0;i<frm.rmbv.length;i++)
if(frm.rmbv[i].checked==true){
flag=1
break
}
if(flag==0){
//	alert (flag)
  var patrn = /^[0-9]{1,9}$/;
  	if (typeof(frm.zdyje)!="undefined"){
//    alert("请选择或输入整数的充值金额");
  if (!patrn.test(frm.zdyje.value.trim())) {
    alert("请选择或输入整数的充值金额");
    frm.submit1.disabled = 0;
    return false;
  }else{
  frm.submit();
    frm.submit1.disabled = 0;
  return false;
	  
  }
}
alert("请选择充值金额")
return false;
}
  frm.submit1.disabled = "true";
  	if (typeof(frm.action)!="undefined"){
  if (frm.action.value.trim()!="usercz") {
    alert("出现错误，请刷新当前页面");
    frm.action.focus();
    frm.submit1.disabled = 0;
    return false;
  }
}
  frm.submit1.disabled = "true";
  	if (typeof(frm.username)!="undefined"){
  if (frm.username.value.trim()=="") {
    alert("出现错误，请刷新当前页面");
    frm.username.focus();
    frm.submit1.disabled = 0;
    return false;
  }
}

  frm.submit();
    frm.submit1.disabled = 0;
  return false;
}

</script>