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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_Inc/Function.asp" -->
  4. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  5. <!--#include file="../lib/strlib.asp" -->
  6. <!--#include file="../lib/UserCheck.asp" -->
  7. <!--#include file="lib/cls_award.asp"-->
  8. <%'Copyright (c) 2006 Foosun Inc. Code by Einstein.liu
  9. 'no cache
  10. response.expires=0 
  11. response.addHeader "pragma" , "no-cache" 
  12. response.addHeader "cache-control" , "private" 
  13. '-------------------------------------------
  14. Dim ChangeRs,awardObj,currentDate,activeTF
  15. activeTF=false
  16. currentDate=DateValue(Now())
  17. if G_IS_SQL_DB=0 then
  18. Set ChangeRs=User_Conn.execute("Select PrizeID from FS_ME_Prize where datediff('d',dateValue(startDate),'"&currentDate&"')>=0 And datediff('d',DateValue(EndDate),'"&currentDate&"')<0 And isChange=1")
  19. ELse
  20. Set ChangeRs=User_Conn.execute("Select PrizeID from FS_ME_Prize where datediff(d,convert(nvarchar(10),startDate,120),'"&currentDate&"')>=0 And datediff(d,convert(nvarchar(10),EndDate,120),'"&currentDate&"')<0 And isChange=1")
  21. End If
  22. if not ChangeRs.eof then
  23. Set awardObj=New cls_award
  24. activeTF=true
  25. End if
  26. %>
  27. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  28. <html xmlns="http://www.w3.org/1999/xhtml">
  29. <head>
  30. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  31. <title>CMS4.0</title>
  32. <link href="../images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  33. <style type="text/css">
  34. <!--
  35. body {
  36. margin-left: 0px;
  37. margin-top: 0px;
  38. margin-right: 0px;
  39. margin-bottom: 0px;
  40. }
  41. -->
  42. </style>
  43. <script language="javascript" src="../../FS_Inc/ProtoType.js"></script>
  44. </head>
  45. <body class="hback">
  46. <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  47. <tr>
  48. <td class="xingmu" height="20"><img src="../images/award.gif" alt="积分抽奖" border="0">积分兑换 </td>
  49. </tr>
  50. <%if not activeTF then%>
  51. <tr>
  52. <td class="hback"><img src="../images/alert.gif" />暂无兑换活动</td>
  53. </tr>
  54. <%Else%>
  55. <tr>
  56.   <td class="hback">
  57.   <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  58. <tr>
  59. <td>
  60. <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
  61. <%
  62. Dim UserRs,Integral'当前会员积分
  63. '获得当前会员积分--------------------------------
  64. Set UserRs=User_Conn.execute("Select Integral from FS_ME_Users where UserNumber='"&session("FS_UserNumber")&"'")
  65. if not UserRs.eof then
  66. Integral=UserRs("Integral")
  67. Else
  68. Integral=0
  69. End if
  70. '------------------------------------------------
  71. Dim PrizeArray,tr_count,i,joinNumber,action,provider
  72. tr_count=0
  73. while not ChangeRs.eof
  74. awardObj.getPrizeInfo(ChangeRs("prizeID"))
  75. joinNumber=User_Conn.execute("Select count(prizeID) from  FS_ME_User_Prize where prizeID="&ChangeRs("prizeID"))(0)
  76. if trim(awardObj.provider)<>"" then
  77. provider=awardObj.provider
  78. Else
  79. provider="本站"
  80. End if
  81. if  tr_count Mod 4=0 then
  82. Response.Write("<tr>"&vbcrlf)
  83. End if
  84. if Clng(Integral)<Clng(awardObj.prize_NeedPoint) then
  85. action="<img src=""../images/alert.gif""/><font color=""red"">积分不足</font>"
  86. Elseif Clng(joinNumber)>Clng(awardObj.storage) or Clng(joinNumber)=Clng(awardObj.storage) then
  87. action="<img src=""../images/alert.gif""/><font color=""red"">兑换完毕</font>"
  88. Else
  89. action="<a href=""#"" onClick=""changeAward("&ChangeRs("prizeID")&","&awardObj.prize_NeedPoint&")""><img src=""../images/bottomduihuan.gif"" border=""0"" alt=""兑换奖品""/></a>"
  90. End if
  91. Response.Write("<td class=""hback"">"&vbcrlf)
  92. Response.Write("<table bodor=""0""  cellpadding=""1"" cellspacing=""1"" >"&vbcrlf)
  93. Response.Write("<tr>"&vbcrlf)
  94. Response.Write("<td><div><img src="""&awardObj.PrizePic&""" width=""80"" height=""80"" border=""0"" alt=""该奖品由"&provider&"提供""></div></td>")
  95. Response.Write("<td><div><img src=""../images/award.gif""/><font color=""red"">"&awardObj.PrizeName&"</font><img src=""../images/award.gif""/></div><div><img src=""../images/moneyOrPoint.gif"" alt=""抽取该奖品所需要的积分""/>&nbsp;"&awardObj.prize_NeedPoint&" 积分</div><div>参加人数:"&joinNumber&"</div><div>"&action&"</div></td>")
  96. Response.Write("</tr>"&vbcrlf)
  97. Response.Write("</table>"&vbcrlf)
  98. Response.Write("</td>")
  99. tr_count=tr_count+1
  100. if  tr_count Mod 4=0 then
  101. Response.Write("</tr>"&vbcrlf)
  102. End if
  103. ChangeRs.movenext
  104. Wend
  105. if tr_count Mod 4<>0 then
  106. for i=(tr_count Mod 4)+1 to 4
  107. Response.Write("<td class=""hback"">"&vbcrlf)
  108. Response.Write("<table bodor=""0""  cellpadding=""1"" cellspacing=""1"">"&vbcrlf)
  109. Response.Write("<tr>"&vbcrlf)
  110. Response.Write("<td></td>")
  111. Response.Write("</tr>"&vbcrlf)
  112. Response.Write("</table>"&vbcrlf)
  113. Response.Write("</td>")
  114. next
  115. Response.Write("</tr>"&vbcrlf)
  116. End if
  117. %>
  118. </table>
  119. </td>
  120. </tr>
  121.   </table>
  122.   </td>
  123.   </tr>
  124. <%End if%>
  125. </table>
  126. </body>
  127. </html>
  128. <script language="javascript">
  129. <!--
  130. function changeAward(id,Integral)
  131. {
  132. var url="awardAction.asp"
  133. var pars="action=change&Integral="+Integral+"&prizeID="+id+"&rnd="+Math.random();
  134. if(confirm("确定要进行该操作n该次操作将消费积分:"+Integral))
  135. {
  136.  var myAjax = new Ajax.Request(url,{method: 'get', parameters: pars, onComplete: showResponse});
  137. }
  138. function showResponse(originalRequest)
  139. {
  140. var result=originalRequest.responseText;
  141. alert(result);
  142. location="awardChange.asp?rnd="+Math.random();
  143. }
  144. }
  145. -->
  146. </script>
  147. <%
  148. Set Conn=nothing
  149. Set User_Conn=nothing
  150. Set Fs_User = Nothing
  151. %>