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

数据库编程

开发平台:

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/zhupic.asp" -->
  6. <%
  7. Response.Buffer = True
  8. Response.Expires = -1
  9. Response.ExpiresAbsolute = Now() - 1
  10. Response.Expires = 0
  11. Response.CacheControl = "no-cache"
  12. Dim Conn,strShowErr,TID,VS_Sql,VS_RS,VS_RS1,VS_RS2,PerVote,PerHeight,f_ii,InputValue,otherstr,DisMode
  13. PerHeight = 30 
  14. TID = NoSqlHack(request.QueryString("TID"))
  15. if TID="" or not isnumeric(TID) then response.Write("投票主题参数错误!"&TID)  :  response.End()
  16. MF_Default_Conn
  17. %>
  18. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  19. <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
  20. <!--[if !mso]>
  21. <style>
  22. v:*         { behavior: url(#default#VML) }
  23. o:*         { behavior: url(#default#VML) }
  24. .shape       { behavior: url(#default#VML) }
  25. </style>
  26. <![endif]-->
  27. <head>
  28. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  29. <title><%=request.QueryString("Title")%>---投票结果查看</title>
  30. <style>
  31. TD { FONT-SIZE: 9pt}
  32. </style>
  33. </head>
  34. <body>
  35. <%
  36. VS_Sql = "select  * from FS_VS_Steps where TID = "&TID&" order by Steps"
  37. Set VS_RS = CreateObject(G_FS_RS)
  38. VS_RS.Open VS_Sql,Conn,1,1
  39. if VS_RS.eof then 
  40. Call viewmain(TID)
  41. else
  42. do while not VS_RS.eof
  43. response.Write("<table border=0 width=""100%"">")
  44. Call viewmain(VS_RS("QuoteID"))
  45. PerHeight = PerHeight + 280
  46. response.Write("</table>")
  47. VS_RS.movenext
  48. loop
  49. end if
  50. sub viewmain(TIDValue)
  51. f_ii = 1
  52. VS_Sql = "select Theme,DisMode,IID,ItemName,DisMode,B.ItemMode,VoteCount,PicSrc,ItemDetail from FS_VS_Theme A,FS_VS_Items B where A.TID=B.TID AND A.TID ="&TIDValue
  53. Set VS_RS1 = CreateObject(G_FS_RS)
  54. VS_RS1.Open VS_Sql,Conn,1,1
  55. if not VS_RS1.eof then 
  56. DisMode=VS_RS1("DisMode")
  57. if DisMode = 1 then 
  58. '直方图
  59. response.Write("<tr><td height="&PerHeight - 40&" valign=""bottom"" align=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>"&VS_RS1("Theme")&"</b></td></tr>")
  60. redim total(VS_RS1.recordcount,2)
  61. end if
  62. else
  63. response.Write("<tr><td>")
  64. end if
  65. do while not VS_RS1.eof
  66. PerVote = VS_RS1("VoteCount")
  67. '''''''''''''''''''真实票数
  68. VS_Sql = "select count(*) from FS_VS_Items_Result where TID = "& TIDValue &" and IID = "&VS_RS1("IID")
  69. set VS_RS2=Conn.execute(VS_Sql)
  70. if not VS_RS2.eof then 
  71. ''当前选项的票数
  72. PerVote = PerVote + VS_RS2(0)
  73. else
  74. PerVote = 0
  75. end if
  76. VS_RS2.close
  77. ''''''''''''''''''
  78. '''''''''''''''''''额外填写的
  79. VS_Sql = "select ItemValue from FS_VS_Items_Result where TID = "& TIDValue &" and IID = "&VS_RS1("IID")
  80. set VS_RS2=Conn.execute(VS_Sql)
  81. if not VS_RS2.eof then 
  82. ''当前选项的票数
  83. if VS_RS2(0)<>"" then InputValue =  "---"&VS_RS2(0)
  84. else
  85. InputValue = ""
  86. end if
  87. VS_RS2.close
  88. ''''''''''''''''''
  89. 'response.Write(VS_RS1.recordcount&":"&VS_RS1("IID")&":"&PerVote&"<br>")
  90. if VS_RS1("PicSrc")<>"" then 
  91. otherstr = "  style=""cursor:hand"" onClick=""window.open('"&otherstr&"');""" : InputValue = InputValue & " [点击查看大图]"
  92. else
  93. otherstr = "  style=""cursor:help"""
  94. end if
  95. if VS_RS1("DisMode") = 1 then 
  96. '直方图
  97. total(f_ii,1) = PerVote
  98. total(f_ii,2)="<span title="""&VS_RS1("ItemName")&InputValue&""""&otherstr&">"&left(VS_RS1("ItemName"),10)&"</span>"
  99. end if
  100. f_ii = f_ii + 1
  101. VS_RS1.movenext
  102. loop
  103. if f_ii>1 then 
  104. if DisMode = 1 then 
  105. '直方图
  106. response.Write("<tr><td>")
  107. call table1(total,0,PerHeight,10,20,768,200,"A")
  108. response.Write("</td></tr>")
  109. end if
  110. else
  111. response.Write("没有符合条件的记录。</td></tr>")
  112. end if
  113. VS_RS1.close
  114. set VS_RS1 = nothing
  115. 'call table1(total,0,20,10,20,400,200,"A")
  116. 'call table1(total,0,320,10,15,400,250,"B")
  117. end sub
  118. Function HtmEnd(Msg)
  119. response.Write(Msg&vbnewline)
  120. response.Write("</body></html>")
  121. response.End()
  122. End Function
  123. Sub ConnClose()
  124. Set Conn = Nothing
  125. End Sub
  126. %>
  127. </body>
  128. </html>