<!--#include file="../Inc/Config.asp" -->
<!--#include file="../Inc/AdminClass.asp" -->
<!--#include file="Admin_Check.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<link href="../Inc/edit.CSS" rel="stylesheet" type="text/css">
</head>
<link href="../Inc/edit.CSS" rel="stylesheet" type="text/css"> 
<body bgcolor="#5578b8" leftmargin="0" topmargin="2">
<%
dim UP,url,BLOG_ID,path,objFSO
BLOG_ID=REQUEST.FORM("ID")
IF BLOG_ID<>"" And IsNumeric(BLOG_ID) THEN
	UP=TRIM(request.form("Submit"))
	url=replace(Request.ServerVariables("HTTP_REFERER"),"page=","")
	If UP="删除" then
		Conn.Execute "Update [Article] Set Article_Bl=Null Where Article_Bl = (Select ClassName FROM Tb_BuoLuo Where ID ="& BLOG_ID &")"
		SqlCount=SqlCount+1
		Set Rs=Conn.Execute("Select UserID,ClassName From Tb_BuoLuo Where Bid>0 And Bid="& BLOG_ID &"")
		DO WHILE Not Rs.Eof
			Conn.Execute("INSERT INTO [Message](UserID,UserName,Message,Messdate) VALUES("& Rs(0) &",'系统消息','系统消息：您加入的部落 "&Rs(1)&",已被管理员删除！','"&Now&"')")
			SqlCount=SqlCount+1
			Rs.Movenext
		Loop
		Rs.Close:Set Rs=Nothing
		Conn.Execute "Delete From Tb_BuoLuo Where ID ="& BLOG_ID &" Or ClassName=(Select ClassName FROM Tb_BuoLuo Where ID ="& BLOG_ID &")"
		SqlCount=SqlCount+1
		CblogObj.DelCahe ("BuLuoCountTop")
		Set Adminobj=Nothing:Set Cblogobj=Nothing
		Response.write"<script>alert('删除部落成功!');location.href='"&url&"';</script>"		
		Response.End
	END IF
End if
%>
<SCRIPT language=javascript src="../inc/js.js"></SCRIPT>
<table width="99%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF">
  <form name="form1" method="get" action="BuluoList.asp">
    <tr bgcolor="#f0f5f9"> 
      <td colspan="4"> <div align="center">分类: 
          <%CblogObj.ClassCodeList "","TB_SYS_CLASS","ClassCodelist","部落"%>
          查询部落: 
          <input name="KEY" type="text" id="KEY">
          <input type="submit" name="Submit3" value="Search">
        </div></td>
    </tr>
  </form>
  <tr bgcolor="#cfdded"> 
    <td width="30" bgcolor="#cfdded"> <div align="center">选中</div></td>
    <td width="332" bgcolor="#cfdded">部落名称</td>
    <td width="80"><div align="center">统计</div></td>
    <td width="80"> <div align="center">创建者</div></td>
  </tr>
  <form name="add" method="post" action="BuluoList.asp">
    <%
dim where,key,selects,Pages,sqlstr,sql,rscount,iii,ArticleArr
Pages = Request.QueryString("page")
If Not IsNumeric(Pages) Or Pages = "" Then
	Pages = 1
Else
	Pages = CLng(Pages)
End If
WHERE="WHERE Bid=0 "
KEY=replace(REQUEST.QueryString("KEY"),"'","''")
SELECTS=replace(REQUEST.QueryString("BlogClass"),"'","''")
IF KEY<>"" THEN
	WHERE=WHERE&" AND ClassName LIKE '%"&KEY&"%' "
END IF
if SELECTS<>"" Then
	WHERE=WHERE&" AND ClassCode LIKE '"&SELECTS&"%' "
End IF
sqlstr="Select ID,UID,ClassName,(Select Count(*) From Article Where Article_Bl=Tb_BuoLuo.ClassName),(Select Count(ID) From Tb_BuoLuo As B Where B.ClassName=Tb_BuoLuo.ClassName),(Select User_Name From Tb_User Where ID=Tb_BuoLuo.Uid) From Tb_BuoLuo "& Where &" Order By Id Desc"
Set rs = Server.CreateObject("Adodb.RecordSet")
rs.open sqlstr,Conn, 1, 1
SqlCount=SqlCount+1
if rs.bof and rs.eof then
	response.write("<tr><td height=25 colspan=3><div align=center>没有任何部落</div></td></tr>")
else
rs.PageSize = 25
rs.AbsolutePage = pages
rscount=rs.RecordCount
ArticleArr=rs.getrows(25)
for iii=0 to Ubound(ArticleArr,2)
%>
    <tr bgcolor="#f0f5f9"> 
      <td><div align="center"> 
          <input type="radio" name="id" value="<%=ArticleArr(0,iii)%>">
        </div></td>
      <td bgcolor="#f0f5f9"><%="<a href="""&CblogObj.GetDir(ArticleArr(1,iii))&"/BuLuo.asp"">"& ArticleArr(2,iii) &"</a>"%></td>
      <td><div align="center">成员:<%=ArticleArr(4,iii)%>日志:<%=ArticleArr(3,iii)%></div></td>
      <td> <div align="center"> <%="<a href="""&CblogObj.GetDir(ArticleArr(1,iii))&"/"">"& ArticleArr(5,iii) &"</a>"%> 
        </div></td>
    </tr>
    <%
next
END IF
%>
    <tr bgcolor="#f0f5f9"> 
      <td colspan="4"><div align="center"> 
          <input name="act" type="hidden" id="act" value="OK">
          <INPUT name=Submit type=submit class="in" id="Submit" onClick="return ConfirmDel();" value=删除>
        </div></td>
    </tr>
  </form>
  <tr bgcolor="#f0f5f9"> 
    <td colspan="4"> <div align="center"> 
        <%call pagelist(rscount,pages,25)%>
      </div></td>
  </tr>
</table>
<br>
<div align="center"><%set adminobj=nothing:set cblogobj=nothing%></div>
</body>
</html>
