📄 user_emoney.asp
字号:
<!-- #include file="include/con_user.asp" -->
<!-- #include file="include/jk_md5.asp" -->
<!-- #include file="include/joekoe_pay.asp" -->
<%
dim unit_num,emoney_1,chk,errs,is_converion,is_virement,min_amount
unit_num=dim_num(7)
min_amount=dim_num(25)
if not isnumeric(min_amount) then min_amount=1
if min_amount<1 then min_amount=1
chk=joekoe_cms.chk()
errs=""
is_converion=true
if cstr(format_mid_num(11))<>"1" then
is_converion=false
if action="converion" then action=""
end if
is_virement=true
if cstr(format_mid_num(12))<>"1" then
is_virement=false
if action="virement" then action=""
end if
tit="虚拟货币"
call web_head(2,0,0,0,0)
'----------------------------左边 开始----------------------------
call user_left("")
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------
call emoney_main()
'----------------------------中间 结束----------------------------
call web_end(0,0)
sub emoney_pay_chk()
dim pay_amount,pay_emoney,pay_ordernum,p_order_true,price_head
price_head=""
pay_amount=trim(request.form("pay_amount"))
if not joekoe_cms.int_true(pay_amount) then
response.write "<tr><td height=30><font class=red2>购买失败:</font>请输入一个大于0的正整数! <input type=button name=go_back value='返回上一页' onclick=""javascript:history.back(1);""></td></tr>"
exit sub
end if
if csng(pay_amount)<csng(min_amount) then
response.write "<tr><td height=30><font class=red2>购买失败:</font>您输入的人民币数额(<font class=red><b>"&pay_amount&"</b></font>元)低于当前的最低消费额(<font class=red><b>"&min_amount&"</b></font>元)! <input type=button name=go_back value='返回上一页' onclick=""javascript:history.back(1);""></td></tr>"
exit sub
end if
pay_emoney=pay_amount*dim_num(8)
pay_emoney=cint(pay_emoney)
pay_ordernum=joekoe_cms.time_type(joekoe_cms.now_time,11)
p_order_true=true
sql="select top 1 e_id from notes_emoney where e_ordernum='"&pay_ordernum&"'"
set rs=joekoe_cms.exec(sql,1)
if not rs.eof then
rs.close
response.write "<tr><td height=30><font class=red>真对不起!当前购买"&joekoe_cms.web_unit&"的用户太多,请稍候再进行购买。</font></td></tr>"
exit sub
end if
rs.close
sql="insert into notes_emoney(e_ordernum,e_username,e_amount,e_emoney,e_tim,e_ispay) " & _
"values('"&pay_ordernum&"','"&login_username&"',"&price_head&pay_amount&","&pay_emoney&",'"&joekoe_cms.now_time&"',0)"
call joekoe_cms.exec(sql,0)
dim obj_pay
set obj_pay=new joekoe_pay
obj_pay.pay_sort="emoney"
obj_pay.pay_username=login_username
obj_pay.pay_carry=pay_emoney&joekoe_cms.web_unit&",换算率:1:"&dim_num(8)
obj_pay.back_url=joekoe_cms.own_http()&"pay_return_emoney.asp"
obj_pay.pay_ordernum=pay_ordernum
obj_pay.pay_amount=pay_amount
obj_pay.frm_target=false
call obj_pay.pay_frm(1)
set obj_pay=nothing
response.write "<tr><td height=30>您支付的 <font class=red2><b>"&fm_price(pay_amount,1)&"</b></font> 元人民币可以购买 <font class=red2><b>"&pay_emoney&"</b></font> "&joekoe_cms.web_unit&" <input type=button value='在线支付' onClick=""javascript:joekoe_online_pay();""></td></tr>"
end sub
sub emoney_main()
dim emoneys,emoney_2,emoney_3,emoney_pe,e_num,e_all,c_name,c_pass,c_emoney,c_id
emoney_2=0
c_id=0
emoney_1=login_integral\unit_num
if action<>"virement" and action<>"card" and action<>"converion" then action="pay"
if (action="converion" or action="virement") and chk=true then
e_num=trim(request.form("e_num"))
e_all=trim(request.form("e_all"))
emoneys=emoney_1
if action="virement" then emoneys=login_emoney
if e_all="yes" then
emoney_2=emoneys
else
if not(isnumeric(e_num)) then
errs="no"
else
if instr(1,e_num,".")>0 then
errs="no"
else
if int(e_num)<1 or int(e_num)>int(emoneys) then
errs="no"
else
emoney_2=e_num
end if
end if
end if
end if
if action="virement" then
emoney_pe=emoney_2*dim_num(22)/100
emoney_pe=joekoe_cms.fix_num(emoney_pe,1)
emoney_3=emoney_pe+emoney_2
if int(login_emoney)<int(emoney_3) then
emoney_2=emoney_2-(emoney_3-login_emoney)
emoney_3=login_emoney
end if
end if
if action="converion" and int(emoney_2)>0 then
call joekoe_cms.exec("update user_data set integral=integral-"&emoney_2*unit_num&",emoney=emoney+"&emoney_2&" where username='"&login_username&"'",0)
login_integral=login_integral-emoney_2*unit_num
login_emoney=login_emoney+emoney_2
emoney_1=emoney_1-emoney_2
response.write joekoe_cms.js_put("alert(""您已成功换算了 "&emoney_2&" "&joekoe_cms.web_unit&"!\n\n您的积分消耗了:"&emoney_2*unit_num&" 分\n\n目前的积分换算率为:每 "&unit_num&" 分可换算 1 "&joekoe_cms.web_unit&""");",1)
end if
if action="virement" and int(emoney_2)>0 then
dim username2
username2=trim(request.form("username2"))
if symbol_name(username2)<>true then
errs="no"
else
set rs=joekoe_cms.exec("select username from user_data where username='"&username2&"'",1)
if rs.eof then errs="no"
rs.close
end if
if errs="" then
call joekoe_cms.exec("update user_data set emoney=emoney-"&emoney_3&" where username='"&login_username&"'",0)
call joekoe_cms.exec("update user_data set emoney=emoney+"&emoney_2&" where username='"&username2&"'",0)
login_emoney=login_emoney-emoney_3
response.write joekoe_cms.js_put("alert(""您已成功的给 "&username2&" 转帐了 "&emoney_2&" "&joekoe_cms.web_unit&"!\n\n您拥有的"&tit&"也减少了:"&emoney_3&" "&joekoe_cms.web_unit&"\n\n转帐手续费为:"&emoney_pe&" "&joekoe_cms.web_unit&""");",1)
sql="insert into user_mail(send_u,accept_u,topic,word,tim,types,isread) " & _
"values('"&login_username&"','"&username2&"','[系统]货币转帐信息提示','"&login_username&" 已成功的给 您 转帐了 "&emoney_2&" "&joekoe_cms.web_unit&"!','"&joekoe_cms.now_time&"',1,0)"
call joekoe_cms.exec(sql,0)
end if
end if
end if
if action="card" and chk=true then
c_name=joekoe_cms.code_form(trim(request.form("c_name")))
c_pass=joekoe_cms.code_form(trim(request.form("c_pass")))
if len(c_name)<1 or len(c_pass)<1 then errs="no"
if errs="" then
sql="select c_id,c_emoney from cards where c_name='"&c_name&"' and c_pass='"&c_pass&"' and c_hidden=0"
set rs=joekoe_cms.exec(sql,1)
if rs.eof then
errs="no"
else
c_id=rs("c_id")
c_emoney=rs("c_emoney")
end if
rs.close
end if
if errs="" then
dim ok_msg
ok_msg=""
call joekoe_cms.exec("update cards set c_hidden=1 where c_id="&c_id,0)
sql="update user_data set emoney=emoney+"&c_emoney
if int(login_modep)>3 and int(format_mid_num(13)) then
sql=sql&",power='"&format_power2(format_mid_num(14),1)&"'"
ok_msg="\n\n您也同时升级为 "&format_power2(format_mid_num(14),2)&"!"
end if
sql=sql&" where username='"&login_username&"'"
call joekoe_cms.exec(sql,0)
login_emoney=login_emoney+c_emoney
response.write joekoe_cms.js_put("alert(""您已成功的用会员卡(卡号:"&c_name&")给您充值了 "&c_emoney&" "&joekoe_cms.web_unit&"!"&ok_msg&""");",1)
end if
end if
call emoney_top()
select case action
case "converion"
call emoney_converion()
call emoney_virement()
call emoney_card()
call emoney_pay()
case "virement"
call emoney_virement()
call emoney_card()
call emoney_pay()
call emoney_converion()
case "card"
call emoney_card()
call emoney_pay()
call emoney_converion()
call emoney_virement()
case else
call emoney_pay()
if not chk then
call emoney_converion()
call emoney_virement()
call emoney_card()
end if
end select
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr><td class=td> <%response.write img_skin("m_user")%>相关说明</td></tr>
<tr class=bg_td><td align=center>
<table border=0 class=tablew>
<tr><td><font class=red>注意:</font></td><td>您输入的换算的<%response.write joekoe_cms.web_unit%>数值不能超过您目前可以换算的最大值(<font class=red><%response.write emoney_1&"</font> "&joekoe_cms.web_unit%>)</td></tr>
<tr><td></td><td>您输入的要转帐的<%response.write joekoe_cms.web_unit%>数值不能超过您目前拥有的最大值(<font class=red><%response.write login_emoney&"</font> "&joekoe_cms.web_unit%>)</td></tr>
<tr><td></td><td>您在这里进行的<font class=blue>积分换算</font>和<font class=blue>货币转帐</font>为<font class=red>不可逆操作</font>!请在操作前注意一下。</td></tr>
</table>
</td></tr>
</table>
<%
response.write ukong
end sub
sub emoney_pay()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -