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

Set Conn=Server.CreateObject("ADODB.Connection")
conn.open Application( ConstStr & "_connstr")

for i=1 to 4
  set rs=conn.execute("select * from vote where votename='"&application( ConstStr & "_auto"&i&"name")&"' and exp_num<>1")
  daynum=application( ConstStr & "_auto"&i&"timeout")-1
  if not (rs.eof or rs.bof) then
    if (DATEDIFF("d",rs("begin_time"),now())>daynum and rs("begin_time")=rs("end_flag")) or (DATEDIFF("d",rs("begin_time"),now())>daynum+1 and application( ConstStr & "_disablevoteauto")-0=0 ) then
      Response.Redirect("tpinit.asp")
      rs.close
      set rs=nothing
      conn.close
      set conn=nothing
      response.end
    end if
  end if
next
set cschat=server.createobject("ffcschat.cssbchat")
my_level=cschat.getLevel(Session,Application(ConstStr & "_user_list"),Application(ConstStr & "_room_list"))
application.unlock
set rs=conn.execute("select * from vote where exp_num<>1")%>
<META content="text/html; charset=gb2312" http-equiv=content-type><meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
<link rel="stylesheet" type="text/css" href="chat.css"><style>td{text-align:right}</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=10 >
  <table height=100% width=100% ><script src="showad.asp?id=1"></script><tr><td align=center valign=center>
  <table align=center width=90% cellspacing=0 cellpadding=0 border=1 BORDERCOLORLIGHT=#000000 BORDERCOLORDARK=#ffffff>
    <tr><td colspan=7 class=navy2 style="font-family:黑体;text-align:center">当前所有投票事件</td>
    <%if not (rs.eof or rs.bof) then%>
     <tr><td class=navy1 nowrap>投票事件<td class=navy1 nowrap>开始时间<td class=navy1 nowrap>投票资格<td class=navy1 nowrap>已投票<td class=navy1 nowrap>结束时间<td class=navy1 nowrap>开/关<%if my_level-application( ConstStr & "_l_vote")>=0 then%><td class=navy1 nowrap>管理<%end if%></tr>
     <%do while not rs.eof%>
       <tr><td><a href='tpck.asp?name=<%=rs("votename")%>'><%=rs("votename")%><td><%=cschat.alldateStr(rs("begin_time"))%><td><%=rs("exp_num")%><%if rs("exp_num")<10 then%>级<%else%>点<%end if%>
       <td><%=rs("votenum")%><td><%if rs("begin_time")=rs("end_flag") then%>未定<%else%><%=cschat.AllDateStr(rs("end_flag"))%><%end if%><td><%if rs("begin_time")=rs("end_flag") or datediff("s",rs("end_flag"),now())<0 then%><font color=green>开放<%else%><font color=#990000 >停止<%end if%>
       <%if my_level-application( ConstStr & "_l_vote")>=0 then
         if rs("begin_time")=rs("end_flag")  or datediff("s",rs("end_flag"),now())<0 then%>
           <td><a onclick="return(confirm('投票终止后不可恢复，请确认！'))" href="cuttp.asp?act=终止&name=<%=rs("votename")%>">终止
         <%else%>
           <td><a onclick="return(confirm('投票删除后不可恢复，请确认！'))" href="cuttp.asp?act=删除&name=<%=rs("votename")%>">删除
         <%end if
       end if%></tr>
       <%rs.movenext
     loop%>
    <%else%>
      <tr><td colspan=7><center><br>当前无任何投票事件<p></p></center></td>
    <%end if%>
</table><br><center>[<a href='adminlist.asp'>临时管理员名单</a>]<%if my_level-application( ConstStr & "_l_vote")>=0 then%> [<a href='tpinit.asp'>投票管理检查</a>]　[<a href='cstp.asp'>产生投票事件</a>]<%end if%> [<a href='javascript:history.go(-1)'>后退</a>]</center>
</td></tr></table></body></html><%
set cschat=nothing
rs.close
set rs=nothing
conn.close
set conn=nothing%>












































