📄 user_converpoint.asp
字号:
<!--#include file="Inc/Const.asp"-->
<%
Dim BwToCpRate,CpToBwRate,ConverRate,BwItemName,CpItemName,BwColumn,CpColumn
BwToCpRate=5
CpToBwRate=5
BwItemName="论坛金钱"
CpItemName="网站点数"
BwColumn=Db.UserWealth'""
CpColumn=Db.UserPoint'""
Dim Action,rsUser,sqlUser
Dim UserWealth,UserPoint,ConverAmount
Dim ConverType,ConverMsg
Dim sContent,sConPoint,sConRate,sTrueConPoint
Action = Trim(request("Action"))
ConverAmount= Cl.GetClng(Request("ConverAmount"))
ConverType = Cl.GetClng(request("ConverType"))
if ConverType=1 then
ConverRate=CpToBwRate
else
ConverRate=BwToCpRate
end If
Header
Select Case Action
Case "DoConver"
Call DoConver()
Case Else
Call Main()
End Select
Footer
Sub DoConver()
if ConverAmount<=0 then Cl.ShowErr("<br /><li>请输入要转换的数量</li>")
Set rsUser=Server.CreateObject("Adodb.RecordSet")
sqlUser="Select " & BwColumn & "," & CpColumn & " from " & Db.UserTable & " where " & Db.UserID & "=" & Cl.UserID & ""
OpenConn_U : rsUser.Open sqlUser,Conn_U,1,3
if rsUser.bof and rsUser.eof then
rsUser.close : set rsUser=nothing
Cl.ShowErr("<br /><li>找不到指定的用户!</li>")
End if
if ConverType=1 then
if ConverAmount>rsUser(1) then
ConverAmount=rsUser(1)*ConverRate
else
ConverAmount=ConverAmount*ConverRate
end if
rsUser(0) = rsUser(0)+ConverAmount
rsUser(1) = rsUser(1)-(ConverAmount\ConverRate)
rsUser.update
sConPoint = ConverAmount\ConverRate
sTrueConPoint = ConverAmount
sConRate = "<font color=#ff0033>"&ConverRate&"</font>:<font color=#0000ff>1</font>"
ConverMsg = "成功将 <font color=#0000ff><b>" & sConPoint & "</b></font> 点点数转换为 <font color=#ff0033><b>" & sTrueConPoint & "</b></font> 点论坛金钱!<br />"
else
if ConverAmount>rsUser(0) then
ConverAmount=(rsUser(0)\ConverRate)*ConverRate
else
ConverAmount=(ConverAmount\ConverRate)*ConverRate
end if
'Response.write ConverAmount
'Response.end
rsUser(0) = rsUser(0)-ConverAmount
rsUser(1) = rsUser(1)+(ConverAmount\ConverRate)
rsUser.update
sConPoint = ConverAmount
sTrueConPoint = ConverAmount\ConverRate
sConRate = "<font color=#ff0033>1</font>:<font color=#0000ff>"&ConverRate&"</font>"
ConverMsg = "成功将 <font color=#0000ff><b>" & sConPoint & "</b></font> 点论坛金钱转换为 <font color=#ff0033><b>" & sTrueConPoint & "</b></font> 点点数!<br />"
end if
ConverMsg=ConverMsg & "转换后,你的论坛金钱数量为:<font color=#0000ff><b>" & rsUser(0) & "</b></font>;点数为:<font color=#ff0033><b>" & rsUser(1) & "</b></font>。"
rsUser.close : set rsUser=nothing
Call Cl.ShowSuc(ConverMsg)
End Sub
Sub Main()
Set rsUser=Server.CreateObject("Adodb.RecordSet")
sqlUser="Select " & BwColumn & "," & CpColumn & " from " & Db.UserTable & " where " & Db.UserID & "=" & Cl.UserID & ""
OpenConn_U : rsUser.Open sqlUser,Conn_U,1,3
if rsUser.bof and rsUser.eof then
rsUser.close : set rsUser=nothing
Cl.ShowErr("<br /><li>找不到指定的用户!</li>")
End if
%>
<form action="User_ConverPoint.asp" method="post" name="Form1" id="Form1">
<table width="400" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<%if ConverType=1 then%>
<tr align="center" class="title">
<td height="22" colspan="2"><font class="en"><b><%=CpItemName%>转<%=BwItemName%></b></font></td>
</tr>
<%else%>
<tr align="center" class="title">
<td height="22" colspan="2"><font class="en"><b><%=BwItemName%>转<%=CpItemName%></b></font></td>
</tr>
<%end if%>
<tr class="tdbg">
<td width="150" align="right"><b>用 户 名:</b></td>
<td><%=Cl.MemberName%></td>
</tr>
<tr class="tdbg">
<td width="150" align="right"><strong><%=BwItemName%>:</strong></td>
<td><font color="green"><%=rsUser(0)%></font> 点</td>
</tr>
<tr class="tdbg">
<td width="150" align="right"><strong><%=CpItemName%>:</strong></td>
<td><font color="green"><%=rsUser(1)%></font> 点</td>
</tr>
<tr class="tdbg">
<td width="150" align="right"><strong>转换数量:</strong></td>
<td>将<%if ConverType=1 then%>
<input name="ConverAmount" id="ConverAmount" value="<%=rsUser(1)%>" size="10" maxlength="10" />
<%=CpItemName%>转成<%=BwItemName%>
<%else%>
<input name="ConverAmount" id="ConverAmount" value="<%=rsUser(0)%>" size="10" maxlength="10" />
<%=BwItemName%>转成<%=CpItemName%>
<%end if%></td>
</tr>
<tr class="tdbg">
<td width="150" align="right"><strong>提 示:</strong></td>
<td><%if ConverType=1 then
response.write "每<b><font color=blue>1</font></b>点点数可转换为<b><font color=red>" & ConverRate & "</font></b>点论坛金钱"
else
response.write "每<b><font color=red>" & ConverRate & "</font></b>点论坛金钱可转换为<b><font color=blue>1</font></b>点点数。"
end if
%></td>
</tr>
<tr align="center" class="tdbg">
<td height="40" colspan="2">
<input name="Action" type="hidden" id="Action" value="DoConver" />
<input name="ConverType" type="hidden" id="ConverType" value="<%=ConverType%>" />
<input name="Submit" type="submit" id="Submit" value="我要转换" /></td>
</tr>
</table>
</form>
<%
rsUser.close : set rsUser=nothing
End Sub
%>
<%
'===================================================
' CreateLive CMS Version 4.0
' Powered by Aspoo.CoM
'===================================================
' Mail: support@aspoo.cn, Info@aspoo.cn
' Q Q: 3315263, 596197794
' Msn : support@aspoo.cn, Clw866@hotmail.com
' Web : http://www.aspoo.com, http://www.aspoo.net
' Bbs : http://bbs.aspoo.com, http://bbs.aspoo.net
' Copyright (C) 2005-2007 Aspoo.CoM All Rights Reserved.
'===================================================
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -