<% Response.Buffer=True %>
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<!--#include file="char.inc"-->
<%
if request.QueryString("stype")="" then
	if Request.ServerVariables("REMOTE_ADDR")=request.cookies(echsys)("IPAddress") then
		response.write"<SCRIPT language=JavaScript>alert('感谢您的支持，您已经投过票了，请勿重复投票，谢谢！');"
		response.write"javascript:window.close();</SCRIPT>"
	else
        dim Options,Arr_Options
        Options = Request.form("Options")
        Arr_Options = split(Options,",")
        For i=0 to Ubound(Arr_Options)
		response.cookies(echsys)("IPAddress")=Request.ServerVariables("REMOTE_ADDR") 
          Conn.Execute("update "& db_wygkcn_Vote_Table &" set answer"&trim(Arr_Options(i))&"=answer"&trim(Arr_Options(i))&"+1 where IsChecked=1")	
          Rs.Close
          Set Rs=Nothing		
        Next
	end if
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312">
<head> 
<title><%=redcaff%>投票结果</title>
<LINK href=CSS/Wygkcn_Home.css rel=stylesheet>
<LINK href=CSS/Wygkcn_News.css rel=stylesheet>
</head>
<body>
<div id="vote">
<div class="vote_titbg"></div>
<div class="vote_cnt">
		<%
		total=0
		set rs=server.createobject("adodb.recordset")
		sql="select * from "& db_wygkcn_Vote_Table &" where IsChecked=1"
		rs.open sql,conn,1,1
		%>

<FIELDSET style="width:99%"><LEGEND><%=rs("Title")%></LEGEND>
<table width="100%" height="87" border="0" align="center" cellpadding="0" cellspacing="0" >
		<tr valign="middle">
			<td width="49%" height="27">序号</td>
			<td width="41%">百比分</td>
			<td align="center">人数</td>
		</tr>
		<%
		for i=1 to 8
			if rs("Select"&i)<>"" then
				total=total+rs("answer"&i)
			end if
		next
		for i=1 to 8
			if rs("Select"&i)<>"" then
				if total=0 then
					answer=0
				else
					answer=(rs("answer"&i)/total)*100
				end if%>
		<tr valign="middle">
		  <td height="29">
<input style="border: 0" name="Options"  type="<%if Rs("SelectClass")=0 Then%>radio<%end if%>  <%if Rs("SelectClass")=1Then%>CheckBox<%end if%>" disabled>
			
			<%=i%>.<%=rs("select"&i)%></td>
			<td><img src=images/RSCount.gif width=<%=int(answer*2)%> height=8> <%=round(answer,3)%>%</td>
		  <td width="10%" align="center"><%=rs("answer"&i)%>人</td>
			<%end if
		next%>
	  </tr>
		<tr>
		  <td height="31" colspan="3"> 共有【<%=total%>】人参加投票<br></td>
		</tr>
</table>
</FIELDSET>
	<% rs.close     
	set rs=nothing     
	conn.close     
	set conn=nothing %>	
</div>
<a href="javascript:window.close();"><img src="Images/an_close.gif" width="86" height="25" border="0"></a>
</div>
</body>
</HTML>  