<!--#include file="inc/right.asp"--> 
<!--#include file="inc/conn.asp"-->
<!--#include file="../inc/config.asp"-->
<%
if Request("wor")="del" then
id=request("id")
idArr=split(id,",")
for i=0 to ubound(idArr)
sql="delete from Result where id="&trim(idArr(i))
conn.execute(sql)
next
end if
%>
<script language=JavaScript>
<!--
function DoEmpty(params)
{
if (confirm("确定要删除这条记录吗？删除后此记录将被无法恢复！"))
window.location = params ;
}
//-->
</script>
<script language=JavaScript type=text/JavaScript>
function CheckAll(form)
{for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked;
}
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=sysConfig%></title>
<link href="images/main.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td bgcolor="#FFFFFF">
	<BR>
        <table width="96%"  border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
        <tr align="center" bgcolor="#F2FDFF">
          <td colspan="10" class="optiontitle">评选投票列表</td>
        </tr>	  
		<tr align="center" bgcolor="#ebf0f7">
		  <td width="40">选中</td>
		  <td width="10%">序号</td>
		  <td width="15%">评选号</td>
		  <td width="25%">提交地址</td>
		  <td width="25%">提交时间</td>
          <td width="20%">操作</td>
		</tr>
<%
 sql="select * from Result order by id desc"
 set rs=server.createobject("adodb.recordset") 
 rs.open sql,conn,1,1
 IF Not rs.eof Then
 proCount=rs.recordcount
	rs.PageSize=15				  '定义显示数目
		if not IsEmpty(Request("ToPage")) then
	       ToPage=CInt(Request("ToPage"))
		   if ToPage>rs.PageCount then
					rs.AbsolutePage=rs.PageCount
					intCurPage=rs.PageCount
		   elseif ToPage<=0 then
					rs.AbsolutePage=1
					intCurPage=1
				else
					rs.AbsolutePage=ToPage
					intCurPage=ToPage
				end if
			else
			        rs.AbsolutePage=1
					intCurPage=1
		  end if
	intCurPage=CInt(intCurPage)
	For i = 1 to rs.PageSize
	if rs.EOF then     
	Exit For 
	end if
%>
<form name="del" action="" method="post">
		<tr align="center" bgcolor='#FFFFFF' onmouseover='this.style.background="#F2FDFF"' onmouseout='this.style.background="#FFFFFF"'>
          <td><input type="checkbox" name="id" value="<%=rs("id")%>"></td>
		  <td><%=rs("id")%></td>
          <td><%=rs("voteid")%></td>
          <td><%=rs("addip")%></td>
          <td><%=rs("addtime")%></td>
          <td align="center"><img src="images/drop.gif" align="absmiddle"><a href="javascript:DoEmpty('?wor=del&id=<%=rs("id")%>&ToPage=<%=intCurPage%>')">删除</a></td>
<%
rs.MoveNext 
next
%>
		</tr>
		<tr bgcolor="#ebf0f7">
		  <td colspan="12">&nbsp;&nbsp;
		   <input name="chkall" type="checkbox" id="chkall" value="select" onclick=CheckAll(this.form)> 全选
		   <input name="wor" type="hidden" id="wor" value="del" />
		   <input type="submit" name="Submit3" value="删除所选" onClick="{if(confirm('确定要删除记录吗？删除后将被无法恢复！')){return true;}return false;}" />
		  </td>
		</tr>
		</form>
		<tr align="center" bgcolor="#ebf0f7">
           <form name="form1" method="post" action="">
		   <td colspan="10">
                <span style="font-size: 9pt;"> 总共：<font color="#ff0000"><%=rs.PageCount%></font>页, <font color="#ff0000"><%=proCount%></font>条评选记录, 当前页：<font color="#ff0000"> <%=intCurPage%> </font>
                <% if intCurPage<>1 then%>
                <a href="?ToPage=1">首页</a>|<a href="?ToPage=<%=intCurPage-1%>">上一页</a>|
                <% end if
                if intCurPage<>rs.PageCount then %>
                <a href="?ToPage=<%=intCurPage+1%>">下一页</a>|<a href="?ToPage=<%=rs.PageCount%>"> 最后页</a>|
                <% end if%>
                跳转：
                <input name="topage" type="text" size="2" value="<%=intCurPage%>">
                <input type="submit" name="go" value="转到">
                </span>
            </td>
		  </form>
		</tr>
<%
else
%>
          <tr align="center" bgcolor='#FFFFFF'>
            <td colspan="10">对不起！目前库中还没有评选投票信息！</td>
          </tr>
<%
end if
rs.close
set rs=nothing
%>
      </table> 
    </td>
  </tr>
</table>
</body>
</html>