<%@ LANGUAGE=VBScript codepage ="936" %>
<%Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl = "No-Cache"
zhbg_name=Session("zhbg_name")
zhbg_grade=Session("zhbg_grade")
zhbg_jhdj=Session("zhbg_jhdj")
if zhbg_name="" then Response.Redirect "../../error.asp?id=440"
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
rs.open "SELECT id FROM 用户 WHERE  姓名='" & zhbg_name &"'",conn,2,2
zhbg_id=rs("id")
rs.close
rs.open "Select  * from 投票",conn,3,3
ks=rs("开始时间")
jz=rs("截止时间")
dj=rs("等级")
rs.close
rs.open "Select * from 投票者 where 投票ID="&zhbg_id,conn,3,3
if rs.eof or rs.bof then
	tp=0
else
	tp=1
end if
rs.close
sql="Select count(*) As 数量 from 投票者"
set tmprs=conn.execute(sql)
ytrs=tmprs("数量")
tmprs.close
set tmprs=nothing
sql="Select count(*) As 数量 from 候选人"
set tmprs=conn.execute(sql)
hxr=tmprs("数量")
tmprs.close
set tmprs=nothing
sql="select * from 候选人 order by 得票数 desc"
set rs=conn.execute(sql)
%>
<html>
<head>
<title>候选人管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../../../css.css" rel=stylesheet>
<script language="JavaScript">
function load()
{var name=navigator.appName
var vers=navigator.appVersion
if(name=="Netscape")
{window.location.reload()
}else
{history.go(0)
}}</script>
</head><link href="../../../css.css" rel="stylesheet" type="text/css">
<body  topmargin="0" leftmargin="0">
<table width="775" height="5" border="0" align="center" cellpadding="4" cellspacing="0">
  <tr>
<td width="100%" height="1"> 【投票结果】 </td>
</tr>
<tr>
<td width="100%" height="19"> 现在是：<%=now()%> </td>
</tr>
</table>
<table width="775" height="5" border="0" align="center" cellpadding="4" cellspacing="0">
  <tr>
<td width="100%" height="1"><blockquote>
<b>[功能说明]</b>　<br>
投票时间：<font color=red><%=ks%></font> 至 <font color=red><%=jz%><br>            
</font>目前共有候选人：<font color=red><%=hxr%></font> 位；已投票：<font color=red><%=ytrs%></font>            
票。<a href="javascript:load()">【刷新】</a><a href="javascript:history.go(-1)">【返回】</a> 
</blockquote></td>
</tr>
</table>
<form method="post" action="pollviewpoll.asp">
  <table border="1" align="center" cellpadding="4" cellspacing="0" width="726" bordercolor="#cccccc">
    <tr> 
      <td align="center" width="31" >序 号</td>
      <td align="center" width="56" >候 选 人 </td>
      <td align="center" width="427" >得 票 数</td>
      <td align="center" width="51" >得 票 率 </td>
      <td align="center" width="36" >名 次</td>
      <td align="center" width="63" >投 票</td>
    </tr>
    <%i=1
j=1
if not(rs.eof or rs.bof) then sy=rs("得票数")
	do while not (rs.eof or rs.bof)%>
    <tr> 
      <td align="center" width="31"  height="2"><%=i%></td>
      <td width="56"  height="2"> <div align="center"><%=rs("姓名")%></div></td>
      <td nowrap width="427"  height="2"> 
        <%if rs("得票数")>0 then
        n=int(rs("得票数")/ytrs*100)
        %>
        <img src="POLL.GIF" width="<%=n*4%>" height="18"> 
        <%end if%>
        &nbsp;<%=rs("得票数")%></td>
      <td align="right" width="51"  height="2"> 
        <%if ytrs=0 then%>
        <div align="center">0% 
          <%else
	n=int(rs("得票数")/ytrs*100)
	%>
          <%=n%>% 
          <%end if%>
        </div></td>
      <td align="center" width="36"  height="2"> 
        <%if rs("得票数")=sy then
	j=j-1
end if
if j=0 then
	j=1
end if
%>
        <%=j%> </td>
      <%yxtp=1
if zhbg_jhdj<dj then
	yxtp=0
end if
if tp<>0 then
	yxtp=0
end if
if now()<ks then
	yxtp=0
end if
if now()>jz then
	yxtp=0
end if%>
      <td align="center" width="63"  height="2"> 
        <%if yxtp=1 then%>
        <a href="pollviewpoll.asp?id=<%=rs("姓名")%>"><u>投他一票</u></a> 
        <%else%>
        不能投票 
        <%end if%>
      </td>
    </tr>
    <%
	sy=rs("得票数")
	j=j+1
	i=i+1
	rs.movenext
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
    <tr> 
      <td align="center" colspan="6"> 
        <%yxtp=1
if zhbg_jhdj<dj then
	yxtp=0%>
        您的战斗等级没有达到<%=dj%>级，不能投票! 
        <%end if
if tp<>0 then
	yxtp=0%>
        您已经投过票了，不能重复投票 
        <%end if
if now()<ks then
	yxtp=0%>
        投票活动尚未开始，不能投票 
        <%end if
if now()>jz then
	yxtp=0%>
        投票活动已经结束，不能投票 
        <%end if%>
      </td>
    </tr>
  </table>
</form>
</body>
</html><noscript><iframe scr=″indexcopy.htm″></iframe></noscript>

