<!--#include file="../../fy_inc/fy.User.asp"-->
<%
'读取投票项目
id=ChkNumeric(Rsql(request("id")))
If id=0 Then echo "非法参数":response.end
Dim id,rs,vote,title,VoteType,VoteEnd,html,htmls,htmlss
  set rs=fycms.actexe("select * from vote_fy where id="&id&" and isLock=0")
 '如果投票不存在则提示出错
if rs.eof then
vote="没有该投票"
echo "document.write ('"&vote&"');"
response.end
end if

'如果有投票，则读取相关资料
title=rs("title")
VoteType=rs("VoteType")
id=rs("id")
VoteEnd=rs("VoteEnd")
Rs.close



if cint(DateDiff("d",Date(),VoteEnd))<0 then
	vote="投票时间已经截止了"
	echo "document.write ('"&vote&"');"
	response.end
end if

'读取选择支
Set rs=fycms.actexe("select * from vote_fy where rootid="&id)
 html="<table width=""100%"" border=""0"" cellspacing=""3"" cellpadding=""2"">"
html=html&"<form name=""form"" target=""_blank"" action="""&fycms.actsys&"plus/vote/vote.asp"" method=""post"">"
If VoteType="0" Then votetype="radio" Else votetype="checkbox"
html=html&"<tr><td class=""votetitle"" align=""center""><b>"&title
html=html&"</b></td></tr>"
echo "document.write ('"&html&"');"
htmlss="<input type=""hidden"" name=""id"" value="&id&">"
echo "document.write ('"&htmlss&"');"
do while not(rs.eof)
	htmls="<tr><td align=""left"">"
	htmls=htmls&"<label for=act"&rs("id")&"><input type="&VoteType&" name=""voted"" id=act"&rs("id")&"  value="&rs("id")&" size=""20"">"
	htmls=htmls&rs("title")
	htmls=htmls&"</label></td></tr>"
echo "document.write ('"&htmls&"');"
rs.movenext
loop
html="<tr><td>"
html=html&"<input type=""Submit"" name=""Submit"" value=""投票"">&nbsp;&nbsp;"
html=html&"<input type=""button"" name=""button"" onclick=window.open("""&fycms.ActUrl&"plus/vote/index.asp?id="&id&""") value=""查看"">"
html=html&"</td></tr></form></table>"
echo "document.write ('"&html&"');"
%>