<!--#include file="../conn/conn.asp"-->
<%SQLin
'读取投票项目
if isnull(Request("JOB_Voteid")) or Request("JOB_Voteid")="" or IsNumeric(Request("JOB_Voteid"))=false then
	set rs=conn.execute("select top 1 * from JOB_Vote where JOB_Voteing=1 and JOB_VoteClass=0 order by JOB_Voteid desc")
else
	set rs=conn.execute("select * from JOB_Vote where JOB_Voteid="&request("JOB_Voteid")&" and JOB_Voteing=1")
end if

'如果投票不存在则提示出错
if rs.eof then
vote="没有该投票"
response.write "document.write ('"&vote&"');"
response.end
end if

'如果有投票，则读取相关资料
JOB_VoteTitle=rs("JOB_VoteTitle")
JOB_VoteStyle=rs("JOB_VoteStyle")
JOB_Voteid=rs("JOB_Voteid")
JOB_VoteEnd=rs("JOB_VoteEnd")
Rs.close

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

'读取选择支
sql="select * from JOB_Vote where JOB_VoteClass="&JOB_Voteid
rs.open sql,conn,3,1
html="<table width=""100%"" border=""0"" cellspacing=""3"" cellpadding=""2"">"
html=html&"<form name=""form"" target=""_blank"" action="&SiteUrl&InstallDir&"vote/vote.asp?JOB_VoteStyle="&JOB_VoteStyle&" method=""post"">"
html=html&"<tr><td class=""votetitle"" align=""center""><b>"&JOB_VoteTitle
html=html&"</b></td></tr>"
response.write "document.write ('"&html&"');"
htmlss="<input type=""hidden"" name=""Voteid"" value="&JOB_Voteid&">"
response.write "document.write ('"&htmlss&"');"
do while not(rs.eof)
	htmls="<tr><td align=""left"">"
	htmls=htmls&"<input type="&JOB_VoteStyle&" name=""voted"" value="&rs("JOB_Voteid")&" size=""20"">"
	htmls=htmls&rs("JOB_VoteTitle")
	htmls=htmls&"</td></tr>"
response.write "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("""&SiteUrl&InstallDir&"vote/VoteShow.asp?id="&JOB_Voteid&""") value=""查看"">"
html=html&"</td></tr></form></table>"
response.write "document.write ('"&html&"');"
CloseConn
%>