asp投票系統一

來源:互聯網
上載者:User
 代碼如下 複製代碼

<%
Dim voteid, Choose, nowid, i, Rs,SQL
If Not IsObject(Conn) Then ConnectionDatabase

If IsNumeric(Request("voteid")) Then
 voteid = CLng(Request("voteid"))
Else
 voteid = 0
End If
If voteid = 0 Then
 SQL = "SELECT TOP 1 * FROM NC_Vote WHERE isLock<>1 ORDER BY id DESC"
Else
 SQL = "SELECT * FROM NC_Vote WHERE id="& voteid
End If
Set Rs = Conn.Execute(SQL)
If Rs.EOF Then
 Response.Write("串連資料發生錯誤")
 Response.End
Else
 For i = 1 To 5
  If IsNull(Rs("Choose_"&i)) Then Exit For
 Next

 nowid = Rs("id")

 Response.ContentType = "text/xml"
 'Response.Expires = -1
 Response.Write "<?xml version=""1.0"" encoding=""GB2312""?> " & vbNewLine
 Response.Write "<vote>" & vbNewLine
 Response.Write " <system>" & vbNewLine
 Response.Write "  <voteid>"
 Response.Write Rs("id")
 Response.Write "</voteid>" & vbNewLine
 Response.Write "  <Topic><![CDATA["
 Response.Write Rs("Topic")
 Response.Write "]]></Topic>" & vbNewLine
 Response.Write "  <VoteNum>"
 Response.Write Rs("VoteNum")
 Response.Write "</VoteNum>" & vbNewLine
 Response.Write "  <votebgcolor><![CDATA["
 Response.Write Rs("bgcolor")
 Response.Write "]]></votebgcolor>" & vbNewLine
 Response.Write "  <votewordcolor><![CDATA["
 Response.Write Rs("FontColor")
 Response.Write "]]></votewordcolor>" & vbNewLine
 Response.Write "  <Topicunt>"
 Response.Write i - 1
 Response.Write "</Topicunt>" & vbNewLine
 Response.Write "  <FontSize>"
 Response.Write Rs("FontSize")
 Response.Write "</FontSize>" & vbNewLine
 Response.Write "  <VoteType>"
 Response.Write CBool(Rs("VoteType"))
 Response.Write "</VoteType>" & vbNewLine
 Response.Write " </system>" & vbNewLine

 For i = 2 To 6
  If IsNull(Rs(i)) Then Exit For
  Response.Write " <Choose>" & vbNewLine
  Response.Write "  <csco><![CDATA["
  Response.Write Rs(i)
  Response.Write "]]></csco>" & vbNewLine
  Response.Write "  <Choosenum>"
  Response.Write Rs(i + 5)
  Response.Write "</Choosenum>" & vbNewLine
  Response.Write " </Choose>" & vbNewLine
 Next
End If
Rs.Close
Set Rs = Nothing
Response.Write " <prenext>" & vbNewLine
Response.Write "  <next>"
SQL = "SELECT * FROM NC_Vote WHERE id>"& nowid &" And isLock<>1"
Set Rs = Conn.Execute(SQL)
If Not (Rs.BOF And Rs.EOF) Then
 Response.Write Rs("id")
End If
Rs.Close
Set Rs = Nothing
Response.Write "</next>" & vbNewLine
Response.Write "  <pre>"
SQL = "SELECT * FROM NC_Vote WHERE id<"& nowid &" And isLock<>1 ORDER BY id DESC"
Set Rs = Conn.Execute(SQL)
If Not (Rs.BOF And Rs.EOF) Then
 Response.Write Rs("id")
End If
Rs.Close
Set Rs = Nothing
Response.Write "</pre>" & vbNewLine
Response.Write " </prenext>" & vbNewLine
Response.Write "</vote>" & vbNewLine

CloseConn
%>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.