<!--#include file="conn.asp"-->
<%
Dim voteid, Choose, nowid, i, Rs
Set Rs = server.CreateObject("adodb.recordset")
voteid = CLng(Request.QueryString("voteid"))
If voteid = 0 Then
	Set rs = conn.Execute("select top 1 * from NC_Vote where isLock<>1 order by id desc")
Else
	Set rs = conn.Execute("select * from NC_Vote where id="&voteid)
End If
If rs.EOF Then
	response.Write("连接数据发生错误")
	Response.End
End If
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""?> "
Response.Write "<vote>"

Response.Write "<system>"
Response.Write "<voteid>"
Response.Write rs("id")
Response.Write "</voteid>"
Response.Write"<Topic><![CDATA["
Response.Write rs("Topic")
Response.Write "]]></Topic>"
Response.Write "<VoteNum>"
Response.Write rs("VoteNum")
Response.Write "</VoteNum>"
Response.Write "<votebgcolor><![CDATA["
Response.Write rs("bgcolor")
Response.Write "]]></votebgcolor>"
Response.Write "<votewordcolor><![CDATA["
Response.Write rs("FontColor")
Response.Write "]]></votewordcolor>"
Response.Write "<Topicunt>"
Response.Write i -1
Response.Write "</Topicunt>"
Response.Write "<FontSize>"
Response.Write rs("FontSize")
Response.Write "</FontSize>"
Response.Write "<VoteType>"
Response.Write CBool(rs("VoteType"))
Response.Write "</VoteType>"
Response.Write "</system>"

For i = 2 To 6
	If IsNull(rs(i)) Then Exit For
	Response.Write "<Choose>"
	Response.Write"<csco><![CDATA["
	Response.Write rs(i)
	Response.Write "]]></csco>"
	Response.Write "<Choosenum>"
	Response.Write rs(i + 5)
	Response.Write "</Choosenum>"
	Response.Write "</Choose>"
Next
rs.Close
Set rs = Nothing
Set rs = conn.Execute("select * from NC_Vote where id>"&nowid&" and isLock<>1 ")
Response.Write "<prenext>"
Response.Write "<next>"
Response.Write rs("id")
Response.Write "</next>"
rs.Close
Set rs = Nothing
Set rs = conn.Execute("select * from NC_Vote where id<"&nowid&" and isLock<>1 order by id desc")
Response.Write "<pre>"
Response.Write rs("id")
Response.Write "</pre>"
rs.Close
Set rs = Nothing
Response.Write "</prenext>"
Response.Write "</vote>"
conn.Close
Set conn = Nothing
%>
