1 then
response.write "alert('您的操作权限不够!');history.back();"
response.end
end if
%>
日志管理
function CheckAll(v)
{
var i;
for (i=0;i {
var e = document.forms.elements[i];
e.checked = v;
}
}
function OnDelete()
{
var del, a, i;
del = new String("");
for(i = 0; i < document.forms.elements.length ; i ++)
{
var e = document.forms.elements[i];
if(e.name == 'selAnnounce')
{
if ( e.checked == true)
{
a = e.value;
del = del + a + ";";
}
};
}
if(del == "")
{
alert("请选择要删除的日志")
}
else
{
if(confirm("确定要删除吗?")==true)
{
document.forms.submit();
}
}
}
//-->
const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
dim title
title=request("txtitle")
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call deleteannounce(id)
next
else
call deleteannounce(clng(idlist))
end if
end if
dim sql
dim rs
%>
ID
内容/用户名
IP
日期
全 选 / 删
除
sql="select * from count order by postdate desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write " 没有日志 "
else
totalPut=rs.recordcount
if currentpage currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"rizhi.asp"
showContent
showpage totalput,MaxPerPage,"rizhi.asp"
else
if (currentPage-1)*MaxPerPage rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"rizhi.asp"
showContent
showpage totalput,MaxPerPage,"rizhi.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"rizhi.asp"
showContent
showpage totalput,MaxPerPage,"rizhi.asp"
end if
end if
end if
sub showContent
dim i
i=0
%>
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write " "
if CurrentPage response.write "首页 上一页 "
else
response.write "首页 "
response.write "上一页 "
end if
if n-currentpage response.write "下一页 尾页"
else
response.write ""
response.write "下一页 尾页"
end if
response.write " 页次:"&CurrentPage&"/"&n&"页 "
response.write " 共"&totalnumber&"条 "&maxperpage&"条/页 "
end function
sub deleteannounce(id)
dim sql,deletefile
sql="delete from count where trackID="&cstr(id)
conn.execute sql
if err.Number0 then
err.clear
response.write "删 除 失 败 !"
end if
End sub
%>
set rs=nothing
conn.close
set conn=nothing %>