<!--#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,arr
BLOG_ID=REQUEST.FORM("ID")
IF BLOG_ID<>"" THEN
	UP=TRIM(request.form("Submit"))
	url=replace(Request.ServerVariables("HTTP_REFERER"),"page=","")
	If UP="删除" then
		ARR = Split(BLOG_ID, ",")
		For jjj = 0 To UBound(ARR)
			CblogObj.DelFolder(Server.MapPath(CblogObj.GetDir(Arr(jjj))))
		Next
		conn.execute("delete from tb_user where id in("&BLOG_ID&")")
		conn.execute("delete from Article where User_id in("&BLOG_ID&")")
		conn.execute("delete from tb_Link where User_id in("&BLOG_ID&")")
		conn.execute("delete from Message where Userid in("&BLOG_ID&")")
		conn.execute("delete from Tb_Favorites where User_id in("&BLOG_ID&")")
		conn.execute("delete from Tb_User_Class where User_id in("&BLOG_ID&")")
		conn.execute("delete from Tb_BuoLuo where UID in("&BLOG_ID&")")
		conn.execute("delete from Tb_Reply where Reply_User in("&BLOG_ID&")")
		conn.execute("delete from Tb_Rss where User_ID in("&BLOG_ID&")")
		Application.Lock
			Application.Contents.RemoveAll()
		Application.UnLock
		set adminobj=nothing:set cblogobj=nothing
		Response.write"<script>alert('删除成功!');location.href='"&url&"';</script>"		
		Response.End
	Elseif UP="取消推荐" THEN
		conn.execute ("update tb_user set blog_top=0 where id in("&blog_id&")")
		CblogObj.DelCahe("Recommends_User")
		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="Recommended.asp">
    <tr bgcolor="#f0f5f9"> 
      <td colspan="5"> <div align="center">查询博客: 分类: 
          <%CblogObj.ClassCodeList "","TB_SYS_CLASS","ClassCodelist","Blog"%>
          Key: 
          <input name="KEY" type="text" id="KEY">
          By: 
          <select name="select">
            <option value="Blog_Name" selected>博客名</option>
            <option value="User_Name">用户名</option>
          </select>
          <input type="submit" name="Submit" 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="140"> <div align="center">Email</div></td>
    <td width="100"> 
      <div align="center">管理此博客</div></td>
  </tr>
<form name="add" method="post" action="Recommended.asp">
<%
dim where,blogClass,KEY,SELECTS,Pages,iii
dim sql,rsarrer,sqlstr,rscount
Pages = Request.QueryString("page")
If Not IsNumeric(Pages) Or Pages = "" Then
	Pages = 1
Else
	Pages = CLng(Pages)
End If
WHERE="WHERE Blog_Top=1 "
BlogClass=replace(request.QueryString("BlogClass"),"'","''")
If BlogClass<>"" then
	WHERE=WHERE&" AND Blog_class LIKE '"&BlogClass&"%' "
End IF
KEY=replace(request.QueryString("key"),"'","''")
SELECTS=replace(REQUEST.QueryString("select"),"'","")
IF KEY<>"" THEN
	WHERE=WHERE&" AND "&SELECTS&" LIKE '%"&trim(KEY)&"%' "
END IF
sqlstr="select id,User_Name,Blog_Name,User_Mail,Blog_Top from Tb_User "&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=5><div align=center>没有推荐的博客</div></td></tr>")
else
rs.PageSize = 25
rs.AbsolutePage = pages
rscount=rs.RecordCount
rsarrer=rs.getrows(25)
for iii=0 to Ubound(rsarrer,2)
%>
    <tr bgcolor="#f0f5f9"> 
      <td><div align="center"> 
          <input name="ID" type="checkbox" id="ID" value="<%=rsarrer(0,iii)%>">
        </div></td>
      <td bgcolor="#f0f5f9"><a href="<%=CblogOBJ.GetDir(rsarrer(0,iii))%>/" target="_blank"> 
        <%=rsarrer(2,iii)%>
        </a> <%IF rsarrer(4,iii)=1 Then Response.Write "(荐)"%><%IF rsarrer(4,iii)=2 Then Response.Write "(专栏作家)"%></td>
      <td> 
        <%=rsarrer(1,iii)%>
      </td>
      <td> <div align="center"> 
          <%=rsarrer(3,iii)%>
        </div></td>
      <td><div align="center"><a href="blog_update.asp?id=<%=rsarrer(0,iii)%>">进入此博客管理</a></div></td>
    </tr>
<%
next
rs.close:Set rs=nothing
end if
%>
    <tr bgcolor="#f0f5f9"> 
      <td colspan="5"><div align="center"> 
          <input name="act" type="hidden" id="act" value="OK">
          <INPUT name=all type=button id="all" onclick=CheckAll(this.form) value=全选>
          <INPUT name=sall type=button id="sall" onclick=CheckOthers(this.form) value=反选>
          <input name="Submit2" type="reset" class="in" value="重置">
          <INPUT name=Submit type=submit class="in" id="Submit" onClick="return ConfirmDel();" value=删除>
          <input name="Submit" type="submit" id="Submit2" value="取消推荐">
        </div></td>
    </tr>
  </form>
  <tr bgcolor="#f0f5f9"> 
    <td colspan="5"> <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>
