<% userPageRights="{ba}" %>
<!--#include file="check.asp"-->
<!--#include file="../Include/char.asp" -->
<%
Action=Trim(Request("Action"))
if Action="del" then 

ArticleID=trim(request("ArticleID"))

FoundErr=False
if ArticleId="" then
	FoundErr=True
   Call Msgbox("对不起,请选择记录！",1)
    Response.end
end if
'删除


if instr(ArticleID,",")>0 then
	'	dim idarr,i
		idArr=split(ArticleID)
		for i = 0 to ubound(idArr)
			call DelArticle(clng(idarr(i)))
		next
	else
		call DelArticle(clng(ArticleID))
	end if

sub DelArticle(ID)
	sqlDel1="select id from tb_ba where ID=" & CLng(ID)
	Set rsDel1= Server.CreateObject("ADODB.Recordset")
	rsDel1.open sqlDel1,conn,1,3
	if not rsdel1.eof then
	
   rsDel1.delete
   rsdel1.update
	end if	
	rsdel1.close
set rsdel1=nothing	
   	
end sub
  
end if
'////////////////////////////////////////////////
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/Style.css" rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript">
function jDelete(url)
{
  if((confirm(" 警告:请确定是否删除,删除后不能恢复! "))==true) 
	self.location=url+'&action=del';
}
</SCRIPT>
<script language=Javascript>
<!--
function formsub(i){

if (i==2){
	if (confirm('确定删除以上主题吗？')==1){
	Del.action="?Action=del";
    Del.submit();
	}
}
}

//-->
</script>
</head>
<body text="#000000" >
<table class=tableBorder width="99%" border="0" align="center" cellpadding="2" cellspacing="1">
  <tr > 
    <th height="21" colspan="7"> 贴吧所有主题列表 </span></th>
  </tr>
  <tr > 
    <td width="5%" align="center" class=forumHeaderBackgroundAlternate><strong>序</strong></td>
    <td width="78%" align="center" class=forumHeaderBackgroundAlternate>&nbsp;</td>
    <td width="17%" align="center" class=forumHeaderBackgroundAlternate><b>发布时间</b></td>
  </tr>
  <form name="Del" method="Post">
    <%  
	Set rs=Server.createobject("Adodb.RecordSet")
    pageno=request.querystring("pageno")
    pmcount=10  
    mSql="select * from tb_ba where msgid=0 order by u_time desc"
	rs.open mSql,conn,1,1
	if rs.eof then
	   'response.write "<br><p  align='center'><font color=red><B> 对不起，数据已清空！</B></font></p>"
    else
    rs.pagesize=pmcount
    mpage=rs.pagecount
    if pageno="" then pageno=1
    if  cint(pageno)<1 or cint(pageno)>mpage then  pageno=1
    rs.absolutepage=pageno

 Dim rc,re
 rc=rs.pagesize
 re=1
 do while not rs.eof and rc>0
 mBgColor=Request.Querystring("BgColor")
 if Trim(rs("ID"))=Trim(mBgColor) then mColor= "D6DFFF" else mColor= "ffffff"
%>
    <tr  > 
      <td rowspan="2" align="center" valign="top"  class=forumRow> <input name='ArticleID' type='checkbox' id="ArticleID" value="<%=rs("id")%>">      </td>
      <td valign="top" class=forumRow ><a href="/ba/show.asp?Id=<%=rs("id")%>" target="_blank"><font color="#000099"><b><%=rs("u_title")%></b></font></a><br></td>
      <td width="17%" rowspan="2" align="center" valign="top" class=forumRow ><%=rs("u_time")%> </td>
    </tr>
    <tr  >
      <td valign="top" class=forumRow ><%=rs("u_content")%></td>
    </tr>
    <%
 rs.movenext
 re=re+1
 rc=rc-1
 loop
 end if
%>
    <tr  > 
      <td colspan="6" align="center"  class=forumRow> &nbsp;&nbsp; <input type="button" name="Submit3" value="删除主题"  onclick="formsub(2)" >      </td>
    </tr>
  </form>
  <tr  > 
    <td class=forumRow align="center" colspan="9"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="38%" height="22"> &nbsp;共 <font color=red><strong> 
            <% = rs.recordcount%>
            </strong></font> 条记录 当前第 <font color=red><strong> 
            <% = Trim(pageno)%>
            </strong></font>页/共 <font color=red><strong> 
            <% = Trim(mpage)%>
            </strong></font>页 </td>
          <td width="62%" align="right"> <%
if pageno>1 then
   response.write "<a href='admin_banewa.asp'> <img alt='首页' src='Images/boqb02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='首页' src='Images/boqb02.gif' border=0 width='15' height='14'>"
end if

if pageno>1 then
   response.write "<a href='admin_banewa.asp?pageno="&pageno-1&"'><img alt='上一页' src='Images/bob02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='上一页' src='Images/bob02.gif' border=0 width='15' height='14'>"
end if

add=5'数字分页个数+1
if pageno-int(add/2)<=1 then m=1 else m=pageno-int(add/2)
if m+add>mpage then 
   n=mpage
   if mpage-add<=1 then m=1 else m=mpage-add
else
   n=m+add
end if

for pno=m to n
 if pno=cint(pageno) then
   response.write "&nbsp;<font color=red>"&pno&"</font>"
 else
   response.write "<b>&nbsp;<a href='admin_banewa.asp?pageno="&pno&"'>"&pno&"</a></b>"
 end if
next
response.write "&nbsp"

if int(pageno) < int(rs.pagecount) then
  response.write "<a href='admin_banewa.asp?pageno="&pageno+1&"'><img alt='下一页' src='Images/fbob02.gif' border=0 width='15' height='14'></a>"
else 
  response.write "<img alt='下一页' src='Images/fbob02.gif' border=0 width='15' height='14'>"
end if

if int(pageno) < int(rs.pagecount) then
   response.write "<a href='admin_banewa.asp?pageno="&mpage&"'><img alt='末页' src='Images/fboqb02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='末页' src='Images/fboqb02.gif' border=0 width='15' height='14'>"
end if
Response.write "&nbsp;&nbsp;"
%> </td>
        </tr>
      </table></td>
  </tr>
</table> 
       

</body>
</html>
<%
 rs.close
 set rs=nothing
 conn.close
 set conn=nothing
%>