Change_pm.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:9k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../FS_Inc/Const.asp" -->
  3. <!--#include file="../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../FS_Inc/Function.asp" -->
  5. <!--#include file="lib/strlib.asp" -->
  6. <!--#include file="lib/UserCheck.asp" -->
  7. <%
  8. Response.Buffer = True
  9. Response.Expires = -1
  10. Response.ExpiresAbsolute = Now() - 1
  11. Response.Expires = 0
  12. Response.CacheControl = "no-cache"
  13. dim rs_sysobj
  14. set rs_sysobj = User_Conn.execute("select top 1 PointChange From FS_ME_SysPara")
  15. if rs_sysobj.eof then
  16. response.Write "配置信息错误,请与系统管理员联系"
  17. response.end
  18. rs_sysobj.close:set rs_sysobj=nothing
  19. else
  20. PointChange = rs_sysobj(0)
  21. rs_sysobj.close:set rs_sysobj=nothing
  22. end if
  23. Dim PointChangestr,PointChange,PointChangestr1,PointChangestr2,PointChangestr3,frmMoney
  24. frmMoney = Request.Form("money")
  25. if isnull(frmMoney) then frmMoney=0 
  26. frmMoney = left(frmMoney,11)
  27. if not isnumeric(frmMoney) then frmMoney = 0 
  28. if clng(frmMoney)<0 then frmMoney = 0
  29. PointChangestr = split(PointChange,",")
  30. if not isarray(PointChangestr) then
  31. response.Write"错误的参数"
  32. response.end
  33. else
  34. PointChangestr1=PointChangestr(0)
  35. PointChangestr2=PointChangestr(1)
  36. PointChangestr3=PointChangestr(2)
  37. end if
  38. if NoSqlHack(request.Form("Action"))="changepoint_save" then
  39.    if PointChangestr1<>"3" and PointChangestr1<>"2" then
  40. strShowErr = "<li>管理员设定不能兑换积分</li>"
  41. set Conn = nothing
  42. set User_Conn=nothing
  43. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  44. Response.end
  45.    end if
  46.    '开始兑换
  47.    if Fs_User.NumFS_Money<clng(frmMoney) then
  48. strShowErr = "<li>您的金币少于您输入的金币数量</li>"
  49. set Conn = nothing
  50. set User_Conn=nothing
  51. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  52. Response.end
  53.    end if
  54.    User_Conn.execute("Update FS_ME_Users Set Integral=Integral+"&clng(frmMoney)*PointChangestr2&",FS_Money=FS_Money-"&clng(frmMoney)&" where UserNumber='"&Fs_User.UserNumber&"'")
  55.    Call Fs_User.AddLog("兑换",Fs_User.UserNumber,0,clng(frmMoney),"减少金币",1) 
  56.    Call Fs_User.AddLog("兑换",Fs_User.UserNumber,0,clng(frmMoney)*PointChangestr2,"增加积分",0) 
  57. strShowErr = "<li>兑换金币为积分成功</li>"
  58. set Conn = nothing
  59. set User_Conn=nothing
  60. Response.Redirect("lib/success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  61. Response.end
  62. end if
  63. if NoSqlHack(request.Form("Action"))="changemoney_save" then
  64.    if PointChangestr1<>"3" and PointChangestr1<>"1" then
  65. strShowErr = "<li>管理员设定不能兑换金币</li>"
  66. set Conn = nothing
  67. set User_Conn=nothing
  68. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  69. Response.end
  70.    end if
  71.    '开始兑换
  72.    if Fs_User.NumIntegral<clng(frmMoney) then
  73. strShowErr = "<li>您的积分少于您输入的积分数量</li>"
  74. set Conn = nothing
  75. set User_Conn=nothing
  76. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  77. Response.end
  78.    end if
  79.    dim tmp_change
  80.    tmp_change = 1/PointChangestr3
  81.    User_Conn.execute("Update FS_ME_Users Set Integral=Integral-"&clng(frmMoney)&",FS_Money=FS_Money+"&replace(formatnumber(clng(frmMoney)/tmp_change,2,-1),",","")&" where UserNumber='"&Fs_User.UserNumber&"'")
  82.    Call Fs_User.AddLog("兑换",Fs_User.UserNumber,0,clng(frmMoney)*PointChangestr3,"增加金币",0) 
  83.    Call Fs_User.AddLog("兑换",Fs_User.UserNumber,clng(frmMoney),0,"减少积分",1) 
  84. strShowErr = "<li>兑换金币为积分成功</li>"
  85. set Conn = nothing
  86. set User_Conn=nothing
  87. Response.Redirect("lib/success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  88. Response.end
  89. end if
  90. %>
  91. <html xmlns="http://www.w3.org/1999/xhtml">
  92. <title>我的帐户-网站内容管理系统</title>
  93. <meta name="keywords" content="风讯cms,cms,FoosunCMS,FoosunOA,FoosunVif,vif,风讯网站内容管理系统">
  94. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  95. <meta content="MSHTML 6.00.3790.2491" name="GENERATOR" />
  96. <meta name="Keywords" content="Foosun,FoosunCMS,Foosun Inc.,风讯,风讯网站内容管理系统,风讯系统,风讯新闻系统,风讯商城,风讯b2c,新闻系统,CMS,域名空间,asp,jsp,asp.net,SQL,SQL SERVER" />
  97. <link href="images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  98. <head>
  99. <body>
  100. <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  101.   <tr>
  102.     <td>
  103.       <!--#include file="top.asp" -->
  104.     </td>
  105.   </tr>
  106. </table>
  107. <table width="98%" height="135" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  108.   
  109.     <tr class="back"> 
  110.       <td   colspan="2" class="xingmu" height="26"> <!--#include file="Top_navi.asp" --> </td>
  111.     </tr>
  112.     <tr class="back"> 
  113.       <td width="18%" valign="top" class="hback"> <div align="left"> 
  114.           <!--#include file="menu.asp" -->
  115.         </div></td>
  116.       <td width="82%" valign="top" class="hback"><table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  117.           <tr class="hback"> 
  118.             
  119.           <td class="hback"><strong>位置:</strong><a href="../">网站首页</a> &gt;&gt; 
  120.             <a href="main.asp">会员首页</a> &gt;&gt; <a href="MyAccount.asp">我的帐户</a> &gt;&gt; 兑换</td>
  121.           </tr>
  122.         </table>
  123.         <%if noSqlHack(Request.QueryString("action"))="changepoint" then%>
  124.         <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  125.            <form name="form1" method="post" action="">
  126.              <tr>
  127.                <td height="27" colspan="2" class="hback">
  128.      <div align="center">
  129.        <%
  130.    dim not_tf,tmp_str
  131.    if PointChangestr1="3" or PointChangestr1="2" then
  132. if Fs_User.NumFS_Money>1 then
  133. tmp_str = "您可以兑换积分,您准备兑换<input name=""money"" type=""text"" size=""8"" value="""& split(FormatNumber(Fs_User.NumFS_Money,2,-1),".")(0) &""" />个金币"
  134. not_tf=true
  135. elseif Fs_User.NumFS_Money<1 then
  136. not_tf=false
  137. tmp_str = "<span class=""tx"">您的金币不够,不能兑换!</span>"
  138. end if
  139. Response.Write "系统允许您1个金币兑换"& PointChangestr2 &"个积分,您目前金币:"& FormatNumber(Fs_User.NumFS_Money,2,-1) &","& tmp_str &""
  140.    else
  141.     response.Write "系统不允许金币兑换积分!!"
  142. not_tf=false
  143.    end if
  144.    %>
  145.             </div></td>
  146.              </tr>
  147.              <tr>
  148.            <td height="22" colspan="2" class="hback">
  149.               <label></label>              <div align="center">
  150.                 <input type="submit" name="Submit" value="开始兑换积分"<%if not_tf=false then response.Write "disabled"%>>
  151.                 <input name="Action" type="hidden" id="Action" value="changepoint_save">
  152.               </div></td>
  153.           </tr></form>
  154.       </table>
  155.   <%
  156.   elseif noSqlHack(Request.QueryString("action"))="changemoney" then 
  157.   %>
  158.         <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  159.            <form name="form1" method="post" action="">
  160.              <tr>
  161.                <td height="27" colspan="2" class="hback">
  162.      <div align="center">
  163.    <%
  164.    if PointChangestr1="3" or PointChangestr1="1" then
  165. if Fs_User.NumIntegral>=1/PointChangestr3 then
  166. tmp_str = "您可以兑换金币,您准备兑换<input name=""money"" type=""text"" size=""8"" value="""& Fs_User.NumIntegral &""" />个积分"
  167. not_tf=true
  168. elseif Fs_User.NumIntegral<1/PointChangestr3 then
  169. not_tf=false
  170. tmp_str = "<span class=""tx"">您的积分不够,不能兑换!</span>"
  171. end if
  172. Response.Write "系统允许您"& 1/PointChangestr3 &"个积分兑换1个金币,您目前积分:"& FormatNumber(Fs_User.NumIntegral,2,-1) &","& tmp_str &""
  173.    else
  174.     response.Write "系统不允许积分兑换金币!!"
  175. not_tf=false
  176.    end if
  177.    %>
  178.             </div></td>
  179.              </tr>
  180.              <tr>
  181.            <td height="22" colspan="2" class="hback">
  182.               <label></label>              <div align="center">
  183.                 <input type="submit" name="Submit" value="开始兑换金币"<%if not_tf=false then response.Write "disabled"%>>
  184.                 <input name="Action" type="hidden" id="Action" value="changemoney_save">
  185.               </div></td>
  186.           </tr></form>
  187.       </table>
  188.   <%end if%></td>
  189.     </tr>
  190.     <tr class="back"> 
  191.       <td height="20"  colspan="2" class="xingmu"> <div align="left"> 
  192.           <!--#include file="Copyright.asp" -->
  193.         </div></td>
  194.     </tr>
  195.  
  196. </table>
  197. </body>
  198. </html>
  199. <%
  200. Set Fs_User = Nothing
  201. %>
  202. <!--Powsered by Foosun Inc.,Product:FoosunCMS V4.0系列-->