<!--#include file="inc/config.asp"-->
<!--#include file="inc/conn.asp"-->
<HTML>
<HEAD>
<TITLE>查看投票</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<style>
body,td,input,textarea {font-size:9pt}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
li{
list-style:none;
list-style-type:none;
margin:0 20px 0 20px;
}
.style2 {color: #FF0000}
</style>

</HEAD>
<script src="js/overlib.js"></script>
<BODY>
<%
dim id,act,title,optionNum,optionType,votestatus,expiresTime,voteType
id=Clng(request("id"))
if(id<1) then
	response.Write("没有找到id="&id&"的记录！")
	response.End()
end if
dim voteid,tempArr
	Set rs = Server.CreateObject("Adodb.RecordSet")				 
	rs.Open "Select top 1 * from vote where id="&id,conn,3,1
	if not rs.eof then
		title=rs("title")			
	else
		response.Write("没有找到记录")
		response.End()
	end if
	rs.close
	set rs=nothing
dim voteArr,totalNum
totalNum=conn.execute("select SUM(clicks) from voteitem where voteid="&id)(0)
%><br>
<p align="center"><strong><%=title%></strong>的投票结果 共（<span class="style2"><%=totalNum%></span>）人参加投票</p>
  <table width="760" height="100"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F9F9F9" style="border:1px solid #eeeeee;">
    <tr>
      <td valign="baseline" style=" padding:10px; ">
	   <%		
	   if(totalNum<=0) then
	   totalNum=1
	   end if
		Set rs = Server.CreateObject("Adodb.RecordSet")				 
		rs.Open "Select id,itemName,clicks,colors from voteitem where voteid="&id,conn,3,1
		if not rs.eof then
			voteArr=rs.GetRows()			
			for i=0 to ubound(voteArr,2)
		%>
        <div class="contain">		
        <div style="width:20px; background-color:<%=voteArr(3,i)%>; width:<%=Cint(FormatNumber(voteArr(2,i)/totalNum,2)*200)%>; border:1px solid #eeeeee; float:left;" onMouseOver="return overlib('(<%=voteArr(1,i)%>,票数)=<%=voteArr(2,i)%>');" onMouseOut="return nd();"></div>
		<div style="float:right"><%=FormatNumber(CCur(voteArr(2,i)/totalNum)*100,2)%>% &nbsp;<%=voteArr(2,i)%>(票)</div>		
		</div>
		<div style="clear:both"></div>
     	<%
			next
		end if
		rs.close
		set rs=nothing
		%>
      </td>
    </tr>
</table>
<div style="margin:10px; text-align:center;">
<%
for i=0 to ubound(voteArr,2)
	response.Write("<span style=""color:"&voteArr(3,i)&""">■</span>&nbsp;"&voteArr(1,i)&""&Chr(10))
next
%>
</div>
<p align="center"><a href="javascript:history.back()">返回</a> <a href="javascript:window.close()">关闭</a></p>
</BODY>
</HTML>
<%
call connclose()
%>