📄 user_exchange.asp
字号:
<!--#include file="Cook.asp" -->
<%
If WRMPS.CheckStr(Request("Action"),0) = "Save" Then
Dim Money,Integral,MTOC,ITOC,WM_Money,WM_Integral
Money = WRMPS.CheckStr(Request("Money"),8)
If Money = "" Then Money = 0
Integral = WRMPS.CheckStr(Request("Integral"),8)
If Integral = "" Then Integral = 0
If Integral = 0 and Money = 0 Then Call WRMPS.ErrView("·您没有做任何兑换操作<meta http-equiv=refresh content='1;URL=User_Exchange.asp'>",0)
Set Rs = Conn.Execute("Select WM_Money,WM_Integral From WM_Member Where WM_ID = "&MemID)
If Not Rs.Eof Then
WM_Money = Rs(0)
WM_Integral = Rs(1)
If Money > 0 Then
If WM_Money - Money < 0 Then Call WRMPS.ErrView("·您的人民币余额不足<meta http-equiv=refresh content='1;URL=User_Exchange.asp'>",0)
Call WRDB.SaveConsume(0,MemName,"-"&Money,Int(Money*WR_Other(1)),0,Int(Money)*Int(WR_Faith(5)),Money&"人民币兑换"&Int(Money*WR_Other(1))&WR_Other(0)&"")
End If
If WR_Other(7) > 0 and Integral > 0 Then
If WM_Integral - Integral < 0 Then Call WRMPS.ErrView("·您的账户积分不足<meta http-equiv=refresh content='1;URL=User_Exchange.asp'>",0)
If Instr(Integral*WR_Other(8),".") > 0 Then Call WRMPS.ErrView("·待转换积分请填写为汇率的整数倍<meta http-equiv=refresh content='1;URL=User_Exchange.asp'>",0)
Call WRDB.SaveConsume(0,MemName,0,Int(Integral * WR_Other(8)),"-"&Integral,0,Integral&"积分兑换"&Int(Integral * WR_Other(8))&WR_Other(0)&"")
End If
Else
Call WRMPS.ErrView("·请按规定操作<meta http-equiv=refresh content='1;URL=User_Exchange.asp'>",0)
End If
Rs.Close
Set Rs = Nothing
Call WRMPS.ErrView("·操作成功<meta http-equiv=refresh content='1;URL=User_Exchange.asp'>",1)
End If
Content = Content & PageTop()
Content = Content & UserPath(",<a href=User_Exchange.asp>点券/积分兑换</a>")
Set Rs=server.createobject("adodb.recordset")
Rs.Open "Select WM_Money,WM_Integral From WM_Member Where WM_ID = "&MemID,Conn,1,1
If Not Rs.Eof Then
Content = Content & "<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""3"" class=td1 align=center>" & vbCrlf
Content = Content & "<form method=""POST"" action=""?Action=Save"" name=addform>" & vbCrlf
Content = Content & " <tr><td class=td4 colspan=4>账户"&WR_Other(0)&"兑换</td></tr>" & vbCrlf
Content = Content & " <tr class=td3 align=center><td width=""30%""></td><td width=""20%""><strong>您的账户</strong></td><td width=""20%""><strong>兑换设置</strong></td><td width=""30%""><strong>兑换所得"&WR_Other(0)&"</strong></td></tr>" & vbCrlf
Content = Content & " <tr class=td2>" & vbCrlf
Content = Content & " <td><strong>人民币兑换"&WR_Other(0)&"</strong>"
If Int(WR_Other(2)) = 1 Then Content = Content & " <a href=../Payment/PayOnline.asp target=_blank>现在充值?</a>"
Content = Content & "<br>当前汇率:<strong class=Font2>1</strong> 元人民币 = <strong class=Font2>"&WR_Other(1)&"</strong> "&WR_Other(0)&"</td>" & vbCrlf
Content = Content & " <td><strong class=Font2>"&Rs(0)&"</strong> 人民币</td>" & vbCrlf
Content = Content & " <td><input type=""text"" name=""Money"" size=10 value=0 onKeyUp=""ShowChange(this.value,this,'EndMoney',"&WR_Other(1)&","&Rs(0)&")""></td>" & vbCrlf
Content = Content & " <td><strong><span class=Font2 id=EndMoney>0</span></strong> "&WR_Other(0)&"</td>" & vbCrlf
Content = Content & " </tr>" & vbCrlf
If WR_Other(7) = 1 Then
Content = Content & " <tr class=td2>" & vbCrlf
Content = Content & " <td><strong>积分兑换"&WR_Other(0)&"</strong><br>当前汇率:<strong class=Font2>1</strong> 积分 = <strong class=Font2>"&WR_Other(8)&"</strong> "&WR_Other(0)&"</td>" & vbCrlf
Content = Content & " <td><strong class=Font2>"&Rs(1)&"</strong> 积分</td>" & vbCrlf
Content = Content & " <td><input type=""text"" name=""Integral"" size=10 value=0 onKeyUp=""ShowChange(this.value,this,'EndIntegral',"&WR_Other(8)&","&Rs(1)&")""></td>" & vbCrlf
Content = Content & " <td><strong><span class=Font2 id=EndIntegral>0</span></strong> "&WR_Other(0)&"</td>" & vbCrlf
Content = Content & " </tr>" & vbCrlf
End If
Content = Content & " <tr class=td2><td></td><td colspan=3><input type=""submit"" value=""确定兑换""></td></tr> " & vbCrlf
Content = Content & " <tr class=td2><td colspan=4>注意:兑换时请填写当前汇率的倍数,以免给您造成不必要的损失。</td></tr> " & vbCrlf
Content = Content & "</form>" & vbCrlf
Content = Content & "</table>" & vbCrlf
Content = Content & " <SCRIPT LANGUAGE=""JavaScript"">" & vbCrlf
Content = Content & " <!--" & vbCrlf
Content = Content & " function ShowChange(Ivalue,Iname,ShowID,Sys,User){" & vbCrlf
Content = Content & " if(isNaN(Ivalue)){" & vbCrlf
Content = Content & " Iname.value = 0;" & vbCrlf
Content = Content & " alert('请填写正确的数值!');" & vbCrlf
Content = Content & " }" & vbCrlf
Content = Content & " else{" & vbCrlf
Content = Content & " Ivalue = parseFloat(Ivalue);" & vbCrlf
Content = Content & " Sys = parseFloat(Sys);" & vbCrlf
Content = Content & " User = parseFloat(User);" & vbCrlf
Content = Content & " if (Ivalue>User||Ivalue<0){" & vbCrlf
Content = Content & " Iname.value = 0;" & vbCrlf
Content = Content & " document.getElementById(ShowID).innerHTML = 0;" & vbCrlf
Content = Content & " alert('填写数值超过限制!');" & vbCrlf
Content = Content & " }" & vbCrlf
Content = Content & " else{" & vbCrlf
Content = Content & " document.getElementById(ShowID).innerHTML = parseInt(Sys * Ivalue);" & vbCrlf
Content = Content & " }" & vbCrlf
Content = Content & " }" & vbCrlf
Content = Content & " }" & vbCrlf
Content = Content & " //-->" & vbCrlf
Content = Content & " </SCRIPT>" & vbCrlf
Content = Content & PageButtom()
End If
Rs.Close
Set Rs = Nothing
Call DBConnEnd()
Call ClassEnd()
response.write Content
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -