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

数据库编程

开发平台:

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 awardRs,awardObj,currentDate,currentAwardID
  15. currentAwardID=0
  16. currentDate=DateValue(Now())
  17. Set awardRs=User_Conn.execute("Select awardID from FS_ME_award where opened=0")
  18. if not awardRs.eof then
  19. currentAwardID=awardRs("awardID")
  20. Set awardObj=New cls_award
  21. awardObj.getAwardInfo(currentAwardID)
  22. End if
  23. %>
  24. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  25. <html xmlns="http://www.w3.org/1999/xhtml">
  26. <head>
  27. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  28. <title>CMS4.0</title>
  29. <link href="../images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  30. <script language="javascript" src="../../FS_Inc/ProtoType.js"></script>
  31. <style type="text/css">
  32. <!--
  33. body {
  34. margin-left: 0px;
  35. margin-top: 0px;
  36. margin-right: 0px;
  37. margin-bottom: 0px;
  38. }
  39. -->
  40. </style></head>
  41. <body class="hback">
  42. <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  43. <tr>
  44. <td class="xingmu" height="20"><img src="../images/award.gif" alt="积分抽奖" border="0">积分抽奖</td>
  45. </tr>
  46. <%if currentAwardID=0 then%>
  47. <tr>
  48. <td class="hback"><img src="../images/alert.gif" />暂无抽奖活动</td>
  49. </tr>
  50. <%Else%>
  51. <tr>
  52.   <td class="hback">
  53.   <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  54.    <tr>
  55. <td class="hback" width="400" height="120"><div id="awardPic" align="center"><img src="<%=awardObj.AwardPic%>" width="400" height="120" alt="第 <%=awardObj.awardid%> 期积分抽奖主题图片" /></div></td>
  56. <td class="hback" valign="top">
  57. <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
  58.               <tr>
  59.                 <td class="hback" align="center"><strong>第 <%=awardObj.awardid%> 期</strong></td>
  60.               </tr>
  61.               <tr>
  62.                 <td class="hback" align="center"><strong>主题:<%=awardObj.awardName%></strong></td>
  63.               </tr>
  64.               <tr>
  65.                 <td class="hback" align="center">活动时间从<%=awardObj.award_startDate%>到<%=awardObj.award_EndDate%></td>
  66.               </tr>
  67. <tr>
  68.                 <td class="hback" align="center">离结束时间还有<font color="#FF0000"><%=(DateValue(awardObj.award_EndDate)-DateValue(Now()))%></font>天</td>
  69.               </tr>
  70.             </table></td>
  71. </tr>
  72. <tr>
  73. <td colspan="2">
  74. <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
  75. <%
  76. Dim UserRs,Integral'当前会员积分
  77. Dim onceMoreTF
  78. onceMoreTF=false
  79. '获得当前会员积分--------------------------------
  80. Set UserRs=User_Conn.execute("Select Integral from FS_ME_Users where UserNumber='"&session("FS_UserNumber")&"'")
  81. if not UserRs.eof then
  82. Integral=UserRs("Integral")
  83. Else
  84. Integral=0
  85. End if
  86. '------------------------------------------------
  87. Dim PrizeArray,tr_count,i,joinNumber,Rs
  88. tr_count=0
  89. PrizeArray=split(awardObj.PrizeIDS,",")
  90. if isArray(PrizeArray) then
  91. for i=0 to Ubound(PrizeArray)
  92. if not isNumeric(PrizeArray(i)) then exit for
  93. awardObj.getPrizeInfo(PrizeArray(i))
  94. joinNumber=User_Conn.execute("Select count(prizeID) from  FS_ME_User_Prize where prizeID="&PrizeArray(i))(0)
  95. if  tr_count Mod 4=0 then
  96. Response.Write("<tr>"&vbcrlf)
  97. End if
  98. Set Rs=User_Conn.execute("Select ID From FS_ME_User_Prize where prizeid="&PrizeArray(i)&" And usernumber='"&session("FS_UserNumber")&"'")
  99. onceMoreTF=false
  100. if not Rs.eof then
  101. onceMoreTF=true
  102. End if
  103. Rs.close
  104. Set Rs=nothing
  105. Response.Write("<td class=""hback"">"&vbcrlf)
  106. Response.Write("<table bodor=""0""  cellpadding=""1"" cellspacing=""1"" >"&vbcrlf)
  107. Response.Write("<tr>"&vbcrlf)
  108. Response.Write("<td><div><img src="""&awardObj.PrizePic&""" width=""80"" height=""80"" border=""0""></div></td>")
  109. Response.Write("<td><div><img src=""../images/award.gif""/><font color=""red"">"&awardObj.PrizeName&"</font><img src=""../images/award.gif""/></div><div><font color=""red"">"&awardObj.PrizeGrade&"</font> 等奖</div><div><img src=""../images/moneyOrPoint.gif"" alt=""抽取该奖品所需要的积分""/> "&awardObj.prize_NeedPoint&" 积分</div><div>参加人数:"&joinNumber&"</div></td>")
  110. Response.Write("</tr>"&vbcrlf)
  111. Response.Write("<tr>"&vbcrlf)
  112. if Clng(Integral)<Clng(awardObj.prize_NeedPoint) then
  113. Response.Write("<td class=""hback"" clospan=""2""><img src=""../images/alert.gif""/><font color=""red"">积分不足</font></td>"&vbcrlf)
  114. Elseif onceMoreTF Then
  115. Response.Write("<td colspan=""2"" class=""hback"">&nbsp;&nbsp;<img src=""../images/alert.gif""/><font color=""red"">已参与过</font></td>")
  116. Else
  117. Response.Write("<td class=""hback"" clospan=""2""><a href=""#"" onclick=""joinAward("&PrizeArray(i)&","&awardObj.prize_NeedPoint&","&awardRs("awardID")&")""><img src=""../images/joinaward.bmp"" border=""0""/></a></td>"&vbcrlf)
  118. End if
  119. Response.write("</tr>"&vbcrlf)
  120. Response.Write("</table>"&vbcrlf)
  121. Response.Write("</td>")
  122. tr_count=tr_count+1
  123. if  tr_count Mod 4=0 then
  124. Response.Write("</tr>"&vbcrlf)
  125. End if
  126. next
  127. if tr_count Mod 4<>0 then
  128. for i=(tr_count Mod 4)+1 to 4
  129. Response.Write("<td class=""hback"">"&vbcrlf)
  130. Response.Write("<table bodor=""0""  cellpadding=""1"" cellspacing=""1"">"&vbcrlf)
  131. Response.Write("<tr>"&vbcrlf)
  132. Response.Write("<td></td>")
  133. Response.Write("</tr>"&vbcrlf)
  134. Response.Write("</table>"&vbcrlf)
  135. Response.Write("</td>")
  136. next
  137. Response.Write("</tr>"&vbcrlf)
  138. End if
  139. End if
  140. %>
  141. </table>
  142. </td>
  143. </tr>
  144.   </table>
  145.   </td>
  146.   </tr>
  147. <%End if%>
  148. </table>
  149. </body>
  150. </html>
  151. <script language="javascript">
  152. <!--
  153. function checkIT(Obj)
  154. {
  155. Obj.firstChildNode.checked=true;
  156. }
  157. function joinAward(id,Integral,awardID)
  158. {
  159. var url="awardAction.asp"
  160. var pars="action=join&awardID="+awardID+"&Integral="+Integral+"&prizeID="+id+"&rnd="+Math.random();
  161. if(confirm("确定要进行该操作n该次抽奖将消费积分 :"+Integral))
  162. {
  163.  var myAjax = new Ajax.Request(url,{method: 'get', parameters: pars, onComplete: showResponse});
  164. }
  165. function showResponse(originalRequest)
  166. {
  167. var result=originalRequest.responseText;
  168. var joinNumber;
  169. alert(result);
  170. location="awardPane.asp?rnd="+Math.random();
  171. }
  172. }
  173. -->
  174. </script>
  175. <%
  176. Set Conn=nothing
  177. Set User_Conn=nothing
  178. Set Fs_User = Nothing
  179. %>