<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%call head
call saycardd("贴子处理")

dim TP,act
TP=request("TP")
  if TP="1" then
dim num,book,gettxt
num=request("num")
book=request("book")
act=request("act")
if num="" or Isnumeric(num)=False then
  Call Error("天数无效！")
  end if
if book="" or Isnumeric(book)=False then
  Call Error("选择类型出错！")
book=clng(book)
  end if

if act<>"ok" then
 Response.Write "贴子清空无法恢复，.真的这样做吗？<br/>"
if saytk>1 then
Response.write "<form name=""form"" method=""post"" action=""admingselldel.asp?sid="&sid&"&amp;saytk="&saytk&""">"
response.write "<input type=""hidden"" name=""num"" value="""&num&"""/>"
response.write "<input type=""hidden"" name=""book"" value="""&book&"""/>"
response.write "<input type=""hidden"" name=""act"" value=""ok""/>"
response.write "<input type=""hidden"" name=""TP"" value=""1""/>"
response.write "<input type=""submit"" name=""Submit"" value=""是的,我决定了""></form><br/>"
else
 Response.write "<anchor>是的,我决定了<go href='admingselldel.asp?sid="&sid&"&amp;saytk="&saytk&"' method='post' accept-charset='utf-8'>"
Response.write "<postfield name='num' value='"&num&"'/>"
Response.write "<postfield name='book' value='"&book&"'/>"
Response.write "<postfield name='act' value='ok'/>"
Response.write "<postfield name='TP' value='1'/>"
Response.write "</go></anchor><br/>"
 Response.Write "<anchor>取消,我要返回<prev/></anchor>"
end if
response.write"<br/><a href='http://8ggg.net/bbs/cjj.asp?cjj="&Request.ServerVariables("SERVER_NAME")&"&amp;ztt="&ppo&"'>进入WAP龙门网查看最新升级功能免费升级</a><br/>"
call headsay()
Response.end
end if


if book=0 then
gettxt="Where jj<>1 and tm <= '"&date()-num&"'"
else
gettxt="Where tm <= '"&date()-num&"'"
end if


 '删除n天前贴子
 conn.Execute"delete from sell "&gettxt&""
response.write"贴子清空成功！"

elseif TP="2" then
 '删除残余贴子
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open "select id,bbsid from sell  order by id desc",conn,1,1
i=1
Do While Not rs.eof
  set rs1=server.CreateObject("ADODB.RecordSet")
  rs1.Open "select ID from ydbbs where id = "&rs("bbsid"),conn,1,1
  if rs1.eof then
  conn.Execute("delete from sell Where id=" & rs("id"))
  end if
  rs1.close
  set rs1=nothing
rs.MoveNext
	i=i+1
	Loop
rs.close
set rs=nothing
 response.write"残余贴子清空成功！"
else
response.write"清空N天前的贴子:<br/>"
if saytk>1 then
Response.write "<form name=""form"" method=""post"" action=""admingselldel.asp?sid="&sid&"&amp;saytk="&saytk&""">"
response.write"<input name='num' value='0' size='3'/>天前的贴子:<br/>"
response.write"精华贴子:<select name='book' value='0'>"
response.write"<option value='0'>保留</option>"
response.write"<option value='1'>清空</option>"
response.write"</select><br/>"
response.write "<input type=""hidden"" name=""tp"" value=""1""/>"
response.write "<input type=""submit"" name=""Submit"" value=""确定清空贴子""></form><br/>"
else
response.write"<input name='num"&tt&"' value='0' size='3'/>天前的贴子:<br/>"
response.write"精华贴子:<select name='book"&tt&"' value='0'>"
response.write"<option value='0'>保留</option>"
response.write"<option value='1'>清空</option>"
response.write"</select><br/>"
response.write"<anchor>[确定清空贴子]<go href='admingselldel.asp?sid="&sid&"&amp;saytk="&saytk&"' method='post' accept-charset='utf-8'>"
response.write"<postfield name='num' value='$(num"&tt&")'/>"
response.write"<postfield name='book' value='$(book"&tt&")'/>"
response.write"<postfield name='TP' value='1'/>"
response.write"</go></anchor><br/>"end if
if saytk>1 then
Response.write "<form name=""form"" method=""post"" action=""admingselldel.asp?sid="&sid&"&amp;saytk="&saytk&""">"
response.write "<input type=""hidden"" name=""tp"" value=""2""/>"
response.write "<input type=""submit"" name=""Submit"" value=""清空残余贴子""></form><br/>"
else
response.write"<anchor>[清空残余贴子]<go href='admingselldel.asp?sid="&sid&"&amp;saytk="&saytk&"' method='post' accept-charset='utf-8'>"
response.write"<postfield name='TP' value='2'/>"
response.write"</go></anchor><br/>"
end if
response.write"残余贴子清空说明：当删除版块时无法自动清空贴子时用"
end if
response.write"<br/><a href='admingsell.asp?id="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>贴子管理</a>"%>
<!--#include file="fanhui.asp"-->
<%response.write""
call headsay()%>
