<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%call head()
call saycardd("日志处理")
dim TP
TP=request("TP")
  if TP="1" then
dim num,bbsid,gettxt
num=request("num")
bbsid=request("bbsid")
if num="" or Isnumeric(num)=False then
  Call Error("天数无效！")
  end if

if bbsid="" or Isnumeric(bbsid)=False then
  Call Error("论坛ID无效！")
  end if
bbsid=abs(bbsid)
if bbsid>0 then
'检查论坛是否存在
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT id FROM ydbbs where id="&bbsid,conn,1,1
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("论坛不存在！")
end if
  rs.close
  set rs=Nothing
end if
if bbsid=0 then
gettxt="Where tm <= '"&date()-num&"'"
else
gettxt="Where bbsid="&bbsid&" and tm <= '"&date()-num&"'"

end if
 '删除n天前日志
 conn.Execute"delete from board "&gettxt&""
response.write"日志清空成功！"
elseif TP="2" then
 conn.Execute"delete from board "
 response.write"全部日志清空成功！"
 else
response.write"清空论坛N天前的日志:<br/>"
if saytk>1 then
Response.write "<form name=""form"" method=""post"" action=""adminlogdel.asp?sid="&sid&"&amp;saytk="&saytk&""">"
response.write"<input name='num' value='0' size='3'/>天前的日志:<br/>"
response.write "请选择版块日志<br/>"
response.write "<select name='bbsid' value='0'>"
response.write "<option value='0'>=选择版块=</option>"
set rs=server.createobject("ADODB.Recordset")
rs.open"select id,name from ydbbs where lx=1 order by pid asc",conn,1,1
dim j
j=1
do while not rs.eof
 dim names
names=rs("name")
if len(names)>8 then names=left(names,8)
Response.write "<option value="""&rs("id")&""">"&ubb(names)&"</option>"
j=j+1
rs.movenext
loop
rs.close
set rs=nothing
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 "请选择版块日志<br/>"
response.write "<select name='bbsid"&tt&"' value='0'>"
response.write "<option value='0'>=选择版块=</option>"
set rs=server.createobject("ADODB.Recordset")
rs.open"select id,name from ydbbs where lx=1 order by pid asc",conn,1,1
j=1
do while not rs.eof
names=rs("name")
if len(names)>8 then names=left(names,8)
Response.write "<option value="""&rs("id")&""">"&ubb(names)&"</option>"
j=j+1
rs.movenext
loop
rs.close
set rs=nothing
Response.write "</select><br/>"
response.write"<anchor>[确定所选]<go href='adminlogdel.asp?sid="&sid&"&amp;saytk="&saytk&"' method='get' accept-charset='utf-8'>"
response.write"<postfield name='num' value='$(num"&tt&")'/>"
response.write"<postfield name='bbsid' value='$(bbsid"&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=""adminlogdel.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='adminlogdel.asp?sid="&sid&"&amp;saytk="&saytk&"' method='get' accept-charset='utf-8'>"
response.write"<postfield name='TP' value='2'/>"
response.write"</go></anchor><br/>"
end if
end if
response.write"<br/><a href='adminlog.asp?id="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>日志管理</a>"%>
<!--#include file="fanhui.asp"-->
<%response.write""
call headsay()%>
