<!--#include file="inc_const.asp"-->
<%response.expires=0
Response.CacheControl = "Private"
application.lock

set cschat=server.createobject("ffcschat.cssbchat")
my_level=cschat.getLevel(Session,Application(ConstStr & "_user_list"),Application(ConstStr & "_room_list"))

application.unlock
myname=cschat.myname
set cschat=nothing

if my_level=0 then
  response.redirect("showerr.asp")  
  response.end
end if

votename=request("name")
Set Conn=Server.CreateObject("ADODB.Connection")
conn.open Application( ConstStr & "_connstr")
set rs=conn.execute("select * from vote where votename='"&votename&"' order by id")
if rs.eof or rs.bof then
  response.redirect("showerr.asp?errtext=你要查看的投票事件不存在！")
  rs.close
  set rs=nothing
  conn.close
  set conn=nothing
  response.end
end if

if rs("begin_time")<>rs("end_flag") and datediff("s",rs("end_flag"),now())>0 then
  Response.Redirect("tpjg.asp?name="&votename)
  response.end
else
  errstr=""
  if instr(rs("voted_user"),myname&" ")<>0 then
    errstr="你已经投过票了！"
  else
    set rs1=conn.execute("select * from user where username='"&myname&"'")
    if DATEDIFF("s",rs1("log_time"),rs("begin_time"))<0 then
      errstr="你是投票事件产生后才注册的用户！"
    elseif rs("exp_num")<10 and rs1("user_level")<rs("exp_num") then
      errstr=rs("exp_num")&"级及以上用户才有投票的资格！"
    elseif rs("exp_num")>10 and rs1("exp_num")<rs("exp_num") then
      errstr="经验值"&rs("exp_num")&"点及以上用户才有投票的资格！"
    end if
    rs1.close
    set rs1=nothing
  end if
  if rs("begin_time")<>rs("end_flag") then
    autoend=true
  else
    autoend=false
  end if
%>
<META content="text/html; charset=gb2312" http-equiv=content-type>
<link rel="stylesheet" type="text/css" href="chat.css">
<style>p{margin-left:10px;margin-right:20px;margin-top:5px;margin-bottom:0px}</style>
<body  style="background-color:EAF2FF;color:112233;scrollbar-Base-Color: #b0d8ff;SCROLLBAR-DARKSHADOW-COLOR:#b0d8ff;SCROLLBAR-arrow-COLOR:#336699;SCROLLBAR-TRACK-COLOR: EAF2FF;SCROLLBAR-3DLIGHT-COLOR: #b0d8ff;SCROLLBAR-SHADOW-COLOR: #336699;SCROLLBAR-HIGHLIGHT-COLOR: #b0d8ff;" leftmargin=3 topmargin=3 style="color:green">
  <table height=100% width=100% ><script src="showad.asp?id=1"></script><tr><td align=center valign=center>
  <table align=center width=80% cellspacing=0 cellpadding=0 border=1 BORDERCOLORLIGHT=#000000 BORDERCOLORDARK=#ffffff>
  <tr><td colspan=5 class=navy2>投票事件：〖<%=votename%>〗</td></tr>
  <form action="tjtp.asp" method="pose">
  <input type=hidden name=name value="<%=votename%>"
  <tr><td nowrap class=navy1>序号<td nowrap class=navy1>候选内容<%if autoend then%><td nowrap class=navy1>得票<%end if%><td nowrap class=navy1>投票
  <%i=1
  rs.movenext
  do while not rs.eof%>
    <tr><td nowrap><%=i%><td nowrap><%=rs("voteoptions")%><%if autoend then%><td><%=rs("votenum")%><%end if%><td nowrap><input name="sel_op" type="radio" value="<%=rs("voteoptions")%>">
    <%rs.movenext
    i=i+1
  loop%>
  <tr><td colspan=5 ><p></P><center><%if errstr="" then%>请投出你神圣的一票：<input type="submit" name="B1" value="提交" class=navy1>
    <input type="reset" name="cmdCancel" value="重置" class=navy1><%else%><%=errstr%><%end if%><center><p></p>
</table><br>[<a href='javascript:history.go(-1)'>后退</a>]</td></tr></table></form>
</body></html>
<%end if
rs.close
set rs=nothing
conn.close
set conn=nothing%>
















