<!--#include file="../inc/conn.asp"-->
<%
PollID=cint(Request.QueryString("TitleID"))
sql="SELECT ID,pid,投票类型,选项内容,票数,投票用户,发布日期,发起日期,到期日期 FROM BBS_Poll where ID="&PollID&" or pid="&PollID&" "

Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.BOF and rs.EOF then
    Pollwrite="" '没有找到相应的投票项目
else
    rs.MoveFirst
    if rs("投票类型")=1 then
        tptype=1
        tptype1="radio"
    else
        tptype=2
        tptype1="checkbox"
    end if
    Pollwrite=rs("选项内容")
    Pollwrite="<form name=tppoll action=poll.asp?tptype="&tptype&"&pollid="&pollid&" method=post style=MARGIN-BOTTOM: 0px>"
    rs.MoveNext
    while not rs.EOF
    Pollwrite=Pollwrite+"<input name=tp type="&tptype1&" value="&rs("ID")&">"&rs("选项内容")&"<br>"
    rs.MoveNext
    wend
    Pollwrite=Pollwrite+"<input type=Submit value=提交 name=okpoll>&nbsp;<a href=poll.asp?lookpollid="&pollid&">查看结果</a></form>"
end if
rs.Close
set rs=nothing
Pollwrite="document.write(""" & Pollwrite & """);"
Response.Write Pollwrite
%>