myAwardRecord.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. <!--#include file="../../FS_Inc/Func_page.asp" -->
  9. <%'Copyright (c) 2006 Foosun Inc. Code by Einstein.liu
  10. 'no cache
  11. response.expires=0 
  12. response.addHeader "pragma" , "no-cache" 
  13. response.addHeader "cache-control" , "private" 
  14. '-------------------------------------------
  15. Dim aType,sql_cmd,awardPeriod,awardObj
  16. Dim awardRs,Rs,tr_count,eofTF,j
  17. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo,i
  18. '---------------------------------分页定义
  19. int_RPP=10 '设置每页显示数目
  20. int_showNumberLink_=8 '数字导航显示数目
  21. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  22. str_nonLinkColor_="#999999" '非热链接颜色
  23. toF_="<font face=webdings title=""首页"">9</font>"   '首页 
  24. toP10_=" <font face=webdings title=""上十页"">7</font>" '上十
  25. toP1_=" <font face=webdings title=""上一页"">3</font>" '上一
  26. toN1_=" <font face=webdings title=""下一页"">4</font>" '下一
  27. toN10_=" <font face=webdings title=""下十页"">8</font>" '下十
  28. toL_="<font face=webdings title=""最后一页"">:</font>" '尾页
  29. '-----------------------------------------
  30. aType=NoSqlHack(request.QueryString("type"))
  31. set awardObj=New cls_award
  32. %>
  33. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  34. <html xmlns="http://www.w3.org/1999/xhtml">
  35. <head>
  36. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  37. <link href="../images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  38. <title>CMS4.0</title>
  39. <script language="javascript" src="../../FS_Inc/prototype.js"></script>
  40. </head>
  41. <body>
  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" />我的中奖记录</td>
  45. </tr>
  46. <tr>
  47. <td class="hback"><a href="myAwardRecord.asp?type=1">积分抽奖</a>&nbsp;|&nbsp;<a href="myAwardRecord.asp?type=2">积分兑换</a></td>
  48. </tr>
  49. </table>
  50. <%if aType<>"2" then%>
  51. <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  52. <tr><td class="hback">
  53. <%
  54. eofTF=false
  55. tr_count=0
  56. Set awardRs=Server.CreateObject(G_FS_RS)
  57. if G_IS_SQL_DB=0 then
  58. sql_cmd="Select awardID from FS_ME_award where opened=1"
  59. Else
  60. sql_cmd="Select awardID from FS_ME_award where opened=1"
  61. End if
  62. awardRs.open sql_cmd,User_Conn,1,1
  63. If Not awardRs.eof then
  64. '分页使用-----------------------------------
  65. awardRs.PageSize=int_RPP
  66. cPageNo=NoSqlHack(Request.QueryString("page"))
  67. If cPageNo="" Then cPageNo = 1
  68. If not isnumeric(cPageNo) Then cPageNo = 1
  69. cPageNo = Clng(cPageNo)
  70. If cPageNo<=0 Then cPageNo=1
  71. If cPageNo>awardRs.PageCount Then cPageNo=awardRs.PageCount 
  72. awardRs.AbsolutePage=cPageNo
  73. End if
  74. if awardRs.eof then
  75. eofTF=true
  76. End if
  77. for i=0 to int_RPP
  78. if not awardRs.eof then
  79. Set Rs=User_Conn.execute("Select awardID,prizeID from FS_ME_User_Prize where awardID="&awardRs("awardID")&" And userNumber='"&session("FS_UserNumber")&"' and winner=1")
  80. Response.Write("<table width=""100%"" border=""0"" align=""center"" cellpadding=""1"" cellspacing=""1"" class=""table"">"&vbcrlf)
  81. Response.Write("<tr>"&vbcrlf)
  82. Response.Write("<td class=""hback"" colspan=""8""><img src=""../images/award.gif""/>第"&awardRs("awardID")&"期</td>"&vbcrlf)
  83. Response.Write("</tr>"&vbcrlf)
  84. while not Rs.eof
  85. awardObj.getPrizeInfo(Rs("PrizeID"))
  86. if tr_count Mod 4=0 then
  87. Response.Write("<tr>"&vbcrlf)
  88. End if
  89. Response.Write("<td class=""hback"" width=""10%"" height=""80""><img src="""&awardObj.PrizePic&""" width=""80"" height=""80""/></td>"&vbcrlf)
  90. Response.Write("<td class=""hback"" width=""90""><Div><img src=""../images/award.gif""/><font color=""red"">"&awardObj.PrizeName&"</font><img src=""../images/award.gif""/></div><div>"&awardObj.PrizeGrade&"等奖</div></td>"&vbcrlf)
  91. tr_count=tr_count+1
  92. if tr_count Mod 4=0 then
  93. Response.Write("</tr>"&vbcrlf)
  94. End if
  95. Rs.movenext
  96. Wend
  97. if tr_count Mod 4<>0 then
  98. for j=(tr_count Mod 4)+1 to 4 
  99. Response.Write("<td class=""hback""></td>"&vbcrlf)
  100. next
  101. Response.Write("</tr>"&vbcrlf)
  102. End if
  103. awardRs.movenext
  104. Response.Write("</table>"&vbcrlf)
  105. End if
  106. next
  107. if eofTF then
  108. Response.Write("<tr>"&vbcrlf)
  109. Response.Write("<td class=""hback""><img src=""../images/alert.gif""/>暂无中奖记录</td>"&vbcrlf)
  110. Response.Write("</tr>"&vbcrlf)
  111. End if
  112. %>
  113. </td>
  114. </tr>  
  115. <%
  116. Response.Write("<tr>"&vbcrlf)
  117. Response.Write("<td align='right' colspan=""8""  class=""hback"">"&fPageCount(awardRs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)&"</td>"&vbcrlf)
  118. Response.Write("</tr>"&vbcrlf)
  119. %>
  120. </table>
  121. <%Elseif aType="2" Then%>
  122. <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  123. <%
  124. int_RPP=20
  125. eofTF=false
  126. tr_count=0
  127. Set awardRs=Server.CreateObject(G_FS_RS)
  128. sql_cmd="Select distinct up.PrizeID from FS_ME_User_Prize as up,FS_ME_Prize as p where up.UserNumber='"&session("FS_UserNumber")&"' and up.winner=1 and isChange=1 and up.PrizeID=p.PrizeId"
  129. awardRs.open sql_cmd,User_Conn,1,3
  130. If Not awardRs.eof then
  131. '分页使用-----------------------------------
  132. awardRs.PageSize=int_RPP
  133. cPageNo=NoSqlHack(Request.QueryString("page"))
  134. If cPageNo="" Then cPageNo = 1
  135. If not isnumeric(cPageNo) Then cPageNo = 1
  136. cPageNo = Clng(cPageNo)
  137. If cPageNo<=0 Then cPageNo=1
  138. If cPageNo>awardRs.PageCount Then cPageNo=awardRs.PageCount 
  139. awardRs.AbsolutePage=cPageNo
  140. End if
  141. if awardRs.eof then
  142. eofTF=true
  143. End if
  144. for i=0 to int_RPP
  145. if awardRs.eof then exit for
  146. awardObj.getPrizeInfo(awardRs("PrizeID"))
  147. if tr_count Mod 4=0 then
  148. Response.Write("<tr>"&vbcrlf)
  149. End if
  150. tr_count=tr_count+1
  151. Response.Write("<td class=""hback"" width=""10%"" height=""80""><img src="""&awardObj.PrizePic&""" width=""80"" height=""80""/></td>"&vbcrlf)
  152. Response.Write("<td class=""hback"" width=""90""><Div><img src=""../images/award.gif""/><font color=""red"">"&awardObj.PrizeName&"</font><img src=""../images/award.gif""/></div><div>积分消费:<img src=""../images/moneyOrPoint.gif""/> "&awardObj.prize_NeedPoint&"</div></td>"&vbcrlf)
  153. if tr_count Mod 4=0 then
  154. Response.Write("<tr>"&vbcrlf)
  155. End if
  156. awardRs.movenext
  157. next
  158. if tr_count Mod 4<>0 then
  159. for j=(tr_count Mod 4)+1 to 4 
  160. Response.Write("<td class=""hback""></td>"&vbcrlf)
  161. Response.Write("<td class=""hback""></td>"&vbcrlf)
  162. next
  163. Response.Write("</tr>"&vbcrlf)
  164. End if
  165. %>
  166. <%
  167. Response.Write("<tr>"&vbcrlf)
  168. Response.Write("<td align='right' colspan=""8""  class=""hback"">"&fPageCount(awardRs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)&"</td>"&vbcrlf)
  169. Response.Write("</tr>"&vbcrlf)
  170. %>
  171. </table>
  172. <%End if%>
  173. </body>
  174. </html>