<!--#include file="../common/conn.asp"-->
<%
	QuestionID=GetQueryString("ID")
	strAdmin=GetQueryString("admin")
	SQLQuestion	=	"SELECT * FROM web_vote Where ID="&QuestionID
	SQLAnswer	=	"SELECT * FROM web_vote Where ParentID="&QuestionID
	Set rsAnswer=	Server.CreateObject("ADODB.RecordSet")
	rs.Open SQLQuestion,conn,1,1
	If Not rs.EOF Then
	str="<table border=0 cellpadding=2 width=90% ><form method=POST target=_blank action=Show.asp?QuestionID="&QuestionID&">"
	str=str&"<tr><td>"&rs("Topic")&"</td></tr><tr><td>"
	
	rsAnswer.Open SQLAnswer,conn,1,1
	While Not rsAnswer.Eof
		str=str&"<input type=radio name=AnswerID value="&rsAnswer("ID")&" Class=theradio>"&rsAnswer("Topic")&"<br>"
		rsAnswer.MoveNext 
	Wend
	
	'检查用户是　有删除调查的权利
	if strAdmin="1" then
		str=str&"</td></tr><tr><td><p align=center><input type=submit value=投票> <input type=button value=删除 onclick=window.location='delevote.asp?id=" & QuestionID & "'></td></tr>"
	else
		str=str&"</td></tr><tr><td><p align=center><input type=submit value=投票></td></tr>"
	end if
	str=str&"<tr><td><a href=Show.asp?QuestionID="&QuestionID&" target=_blank>&gt;&gt;目前投票结果</a></td></tr>"
	str=str&"</form></table>"
	Else
		str="没有找到投票项"
	End If
%>
function votecode()
{
str="<%=str%>";
document.write(str);
}
votecode();
