<!--#include file=conn.asp-->
<!--#include file="config.asp"-->
<%
if not IsNumeric(request("id")) or request("id")="" then
		Response.Write ("<script>alert('友情提示!\n\参数错误!');window.close();</script>")
		Response.end
	end if
if request("id")<>"" then
	id=CLNG(request("id"))
	end if
	rs.open"select * from question where id="&id,conn,1,1
	if rs.eof then
		Response.Write ("<script>alert('友情提示!\n\参数错误!');window.close();</script>")
		Response.end
	else
if request("daid")<>"" then
if session("person")="" then
Response.Write ("<script>alert('友情提示!\n\请您登录后再进行投票!');window.close();</script>")
		Response.end
		end if
if not IsNumeric(request("daid")) then
		Response.Write ("<script>alert('友情提示!\n\参数错误!');window.close();</script>")
		Response.end
	end if
daid=CLNG(request("daid"))
rs3.open"select * from toupiao where wenid="&id&"",conn,1,1
if rs3.eof then
Response.Write ("<script>alert('友情提示!\n\参数错误!');window.close();</script>")
		Response.end
	end if
rs3.close
rs3.open"select * from touuser where wenid="&id&" and touuser='"&session("person")&"'",conn,1,1
if not rs3.eof then
Response.Write ("<script>alert('友情提示!\n\对不起,您不能重复投票!');window.close();</script>")
		Response.end
	end if
rs3.close
rs3.open"select * from toupiao where wenid="&id&" and daid="&daid&"",conn,1,3
	rs3("dapiao")=rs3("dapiao")+1
	rs3.update
	rs3.close
rs3.open"select * from touuser",conn,1,3
	rs3.addnew
	  rs3("wenid")=id
	  rs3("daid")=daid
	  rs3("touuser")=session("person")
	  rs3.update
	  rs3.close
rs3.open"select * from person where name='"&session("person")&"'",conn,1,3
	rs3("jifen")=rs3("jifen")+tpdf
		  if rs3("jifen")+tpdf<fen1 then
		  rs3("touxian")=""&ji1&" 一级"
		  elseif rs3("jifen")+tpdf>=fen1 and rs3("jifen")+tpdf<fen2 then
		  rs3("touxian")=""&ji1&" 一级"
		  elseif rs3("jifen")+tpdf>=fen2 and rs3("jifen")+tpdf<fen3 then
		  rs3("touxian")=""&ji2&" 二级"
		  elseif rs3("jifen")+tpdf>=fen3 and rs3("jifen")+tpdf<fen4 then
		  rs3("touxian")=""&ji3&" 三级"
		  elseif rs3("jifen")+tpdf>=fen4 and rs3("jifen")+tpdf<fen5 then
		  rs3("touxian")=""&ji4&" 四级"
		  elseif rs3("jifen")+tpdf>=fen5 and rs3("jifen")+tpdf<fen6 then
		  rs3("touxian")=""&ji5&" 五级"
		  elseif rs3("jifen")+tpdf>=fen6 and rs3("jifen")+tpdf<fen7 then
		  rs3("touxian")=""&ji6&" 六级"
		  elseif rs3("jifen")+tpdf>=fen7 and rs3("jifen")+tpdf<fen8 then
		  rs3("touxian")=""&ji7&" 七级"
		  elseif rs3("jifen")+tpdf>=fen8 and rs3("jifen")+tpdf<fen9 then
		  rs3("touxian")=""&ji8&" 八级"
		  elseif rs3("jifen")+tpdf>=fen9 and rs3("jifen")+tpdf<fen10 then
		  rs3("touxian")=""&ji9&" 九级"
		  elseif rs3("jifen")+tpdf>=fen10 then
		  rs3("touxian")=""&ji10&" 十级"
		  end if
	rs3.update
	rs3.close
	end if
	%>
<html>
<head>
<title>投票结果页</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
td		{font-size: 9pt; line-height: 18px;font-family: "Arial";}
.f14		{font-size: 14px;line-height: 22px;}
.f14B		{font-size: 14px; font-weight:bold;}
.bgtle		{border-top: #58CB64 1px solid; background-color: #DDF1D8; padding-left: 10px; padding-right: 10px; height:24px; font-weight:bold; font-size: 14px;}
.bnsrh		{padding-top:2px;height:24px}
.bgbdy		{background-color: #FFFFFF;}
.bgcntLn	{BORDER-left: #DDF1D8 2px solid; BORDER-right: #DDF1D8 2px solid; BORDER-bottom: #DDF1D8 2px solid; background-color: #FFFFFF; padding-left: 8px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px;}
-->
</style>
</head>

<body class="bgbdy"><center>
<table width="400" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="25" class="bgtle" nowrap>投票结果：</td>
  </tr>
  <tr> 
    <td class="bgcntLn"> 
   <%
   rs1.open"select sum(dapiao) as piaoshu from toupiao where wenid="&id&"",conn,1,1
	toushu=rs1("piaoshu")
	rs1.close
   rs1.open"select * from toupiao where wenid="&id&"",conn,1,1%>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="40"><div align="center"> 
              <p class="f14">感谢您的参与！</p>
            </div></td>
        </tr>
        <tr> 
          <td height="25" class="f14B"> 当前投票结果： </td>
        </tr>
        <tr>
          <td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%while not rs1.eof
if toushu=0 then
zongpiao=0
else
zongpiao=rs1("dapiao")/toushu*30
end if
%>
<tr> 
<td width="23%" height="20" class="f14" nowrap><%=rs1("dauser")%>：</td>
<td width="77%" class="f14"><img src="img/bar1.gif" width="<%=zongpiao%>" height="10"> <%=rs1("dapiao")%>票</td> 
</tr>
<%rs1.movenext
	  wend
	  rs1.close
	  %>
</table></td>
        </tr>
        <tr> 
          <td height="30" valign="bottom"><div align="center"> 
              <input type="button" name="Submit" value="关闭窗口" class="bnsrh" onclick="javascript:window.close();">
            </div></td>
        </tr>
      </table></td>
  </tr>
</table></center>
</body>
</html>
<%end if
rs.close
%>