📄 admin_function.asp
字号:
}
</script>
<%
rs.close
Set rs=Nothing
End Sub
Sub deletepl(pltable)
dim pl_id,idArr,operateNum
pl_id=trim(replace(Request("pl_id")," ",""))
idArr=split(pl_id,",")
for i=0 to ubound(idArr)
if isInteger(idArr(i))=false then
idArr(i)=0
end if
next
if ubound(idArr)<0 then
adminShowMsg "出错信息","请选择至少一个进行操作"
exit sub
end if
conn.Execute "delete from "&pltable&" where pl_id in ("&pl_id&")",operateNum
adminShowMsg "操作成功信息","恭喜恭喜,本次操作共删除 <font color=""#ff0000"">"&operateNum&"</font> 条评论!"
End Sub
Function pagetitle(rs,n,URL,text)
ScriptName=Request.ServerVariables("SCRIPT_NAME")
%>
<Script Language="JavaScript">
function selectpage(obj){
window.location.href="<%=URL%>pageno=" + obj.options[obj.selectedIndex].value;
}
</Script>
<%
rs.pagesize=n
if not rs.eof and not rs.bof then
If Request.QueryString("pageno")="" Then
rs.AbsolutePage=1
Else
rs.AbsolutePage=cint(Request.QueryString("pageno"))
End If
'pagetitle="<table width='100%' border=0 cellpadding='0' cellspacing='1' class='text'><tr><td align=left>"
pagetitle=pagetitle&" 共有<font color=#ff0000>"&rs.RecordCount&"</font>"&text&" 页次:<font color=#ff0000>"&rs.AbsolutePage&"</font>/"&rs.PageCount&"页"
pagetitle=pagetitle&" 每页<font color=#ff0000>"&rs.pagesize&"</font>条"
If rs.AbsolutePage>1 Then
pagetitle=pagetitle&" <a href="&URL&"pageno=1>首页</a>"
Else
pagetitle=pagetitle&" 首页"
End If
If rs.AbsolutePage>1 Then
pagetitle=pagetitle&" <a href="&URL&"pageno="&rs.AbsolutePage-1&">上一页</a>"
Else
pagetitle=pagetitle&" 上一页"
End If
If rs.AbsolutePage<rs.PageCount Then
pagetitle=pagetitle&" <a href="&URL&"pageno="&rs.Absolutepage+1&">下一页</a>"
Else
pagetitle=pagetitle&" 下一页"
End If
If rs.AbsolutePage<rs.PageCount Then
pagetitle=pagetitle&" <a href="&URL&"pageno="&rs.PageCount&">尾页</a>"
Else
pagetitle=pagetitle&" 尾页"
End If
pagetitle=pagetitle&" "
pagetitle=pagetitle&"<select name='pages' onChange='selectpage(this)'>"
i=1
for i=1 to rs.pagecount
if i=cint(Request.QueryString("pageno")) then
pagetitle=pagetitle&"<option value="&i&" selected>第"&i&"页</option>"
else
pagetitle=pagetitle&"<option value="&i&">第"&i&"页</option>"
end if
next
pagetitle=pagetitle&"</select> "
end if
End Function
Sub accessories(path)
upfile=Server.MapPath(path)
Set fso=Server.CreateObject("Scripting.FileSystemObject")
if not fso.folderexists(upfile) then
fso.CreateFolder(upfile)
end if
Set upfiles=fso.GetFolder(upfile)
totalsize=upfiles.size
if totalsize>=1024 and totalsize<1048576 then
totalsize=totalsize/1024
totalsize=FormatNumber(totalsize,2,-1)&"KB"
elseif totalsize>=1048576 and totalsize<1073741824 then
totalsize=totalsize/1048576
totalsize=FormatNumber(totalsize,2,-1)&"MB"
elseif totalsize>=1073741824 and totalsize<1099511627776 then
totalsize=totalsize/1073741824
totalsize=formatNumber(totalsize,2,-1)&"GB"
else
totalsize=totalsize&"bye"
end if
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="text table_border mainTable">
<tr>
<td height="23" colspan="6" valign="middle" class="td_titleT">附件管理</td>
</tr>
<tr valign="middle" align="center" class="td_topT">
<td width="60" height="24">选择</td>
<td width="*">附件名</td>
<td width="100">附件类型</td>
<td width="90">大小</td>
<td width="110">修改时间</td>
<td width="80">操作</td>
</tr>
<form name="fileform" action="?action=delfile" method="post">
<%
dim ArticleID,strContent,CurrentPage,rscount,pagesizes,liset()
pagesizes=16'每页显示记录数
rscount=upfiles.files.count
pages=Cint((rscount+pagesizes-1)\pagesizes)
redim liset(rscount,4)
i=0
For each fileobj in upfiles.files
softsize=fileobj.size
if softsize>=1024 and softsize<1048576 then
softsize=softsize/1024
softsize=FormatNumber(softsize,2,-1)&"KB"
elseif softsize>=1048576 and softsize<1073741824 then
softsize=softsize/1048576
softsize=FormatNumber(softsize,2,-1)&"MB"
else
softsize=softsize&"bye"
end if
liset(i,0)=fileobj.name
liset(i,1)=fileobj.type
liset(i,2)=softsize
liset(i,3)=fileobj.DateLastModified
i=i+1
next
pageNo=Request.QueryString("pageNo")
if pageNo="" then
currentPage=1
else
currentPage=pageNo
end if
title=" <a href='?action=accessories&pageNo=1'>首页</a>"
if currentPage>1 then
title=title&" <a href='?action=accessories&pageNo="¤tPage-1&"'>上一页</a>"
else
title=title&" 上一页"
end if
if Cint(currentPage)<Cint(pages) then
title=title&" <a href='?action=accessories&pageNo="¤tPage+1&"'>下一页</a>"
else
title=title&" 下一页"
end if
title=title&" <a href='?action=accessories&pageNo="&pages&"'>尾页</a>"
if currentPage=1 then
position=0
else
position=pagesizes*currentPage-pagesizes
end if
line=0
Do while position<rscount and line<pagesizes
%>
<tr valign="middle" align="center" class="td_bgcolor" onmouseover="mouseOver(this)" onmouseout="mouseOut(this)">
<td>
<input type="checkbox" name="filename" id="file<%=liset(position,0)%>" value="<%=liset(position,0)%>"><label for="file<%=liset(position,0)%>">选定</label>
</td>
<td height="27" align="left"> <a href="<%=path&liset(position,0)%>" target="_blank"><%=liset(position,0)%></a></td>
<td> <%=liset(position,1)%></td>
<td> <%=liset(position,2)%></td>
<td> <%=liset(position,3)%></td>
<td><a href="?action=delfile&filename=<%=liset(position,0)%>">直接删除</a></td>
</tr>
<%
position=position+1
line=line+1
Loop%>
<tr>
<td height="27" colspan="6" valign="top" class="td_bottomT">
<input type="checkbox" name="checkall" id="checkall" onclick="checkalldele(this.form)"><label for="checkall">选择所有</label> 共有<font color=#ff0000><%=upfiles.files.count%></font>个附件 共占用空间:<font color=#ff0000><%=totalsize%></font>
<div style="text-align:right;display:inline;"> 页次:<font color=#ff0000><%=currentPage%></font>/<font color="#ff0000"><%=pages%></font>页 每页<font color="#ff0000"><%=pagesizes%></font>条 <%=title%></div>
</td>
</tr>
<tr><td colspan="6" class="td_titleB" align="center"><input type="submit" name="batch" value="删除所选"></td></tr>
</form>
</table>
<script type="text/javascript">
function checkalldele(obj){
var len=obj.elements.length;
for(var i=0;i<len-2;i++){
obj.elements(i).checked=obj.checkall.checked;
}
}
</script>
<%set fso=nothing
End Sub
Sub deletefile(path)
Set fso=Server.CreateObject("Scripting.FileSystemObject")
for each filename in request("filename")
filePath=server.MapPath(path)&"\"&filename
fso.deletefile filePath
flrs=flrs&filePath&"<br/>"
next
set fso=nothing
adminShowMsg "操作成功信息","<font color=#ff0000>已成功删除已下文件:</font><br>"&flrs&"<br><br>共 <font color=#ff0000>"&Request("filename").count&"</font> 个文件!</li><br><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回附件管理页......</b><meta http-equiv=refresh content=5;url=?action=accessories><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(5);</script>"
End Sub
Function reAdminStatus(statu)
if statu="" then
reAdminStatus="<font color=""#ff0000"">非法侵入者</font>"
elseif statu=0 then
reAdminStatus="<font color=""#ff4400"">普通管理员</font>"
elseif statu=1 then
reAdminStatus="<font color=""#0096CE"">超级管理员</font>"
else
reAdminStatus="<font color=""#ff4400"">普通管理员</font>"
end if
End Function
function MaoSinReAdminFlag(strFlag,flagRS)
if strFlag="" then
MaoSinReAdminFlag=False
exit function
end if
if InStr(1,flagRS,strFlag,1)=0 then
MaoSinReAdminFlag=False
elseif InStr(1,flagRS,strFlag,1)<>0 then
MaoSinReAdminFlag=True
else
MaoSinReAdminFlag=False
end if
End Function
function getPopedom(str)
if session(adminVar)<>adminVal then
getPopedom=false
exit function
end if
dim adminInfo
adminInfo=session(adminVar&"Info")
if cint(adminInfo(4))=0 then
if MaoSinReAdminFlag(str,adminInfo(5))=false then
getPopedom=false
exit function
else
getPopedom=true
exit function
end if
elseif cint(adminInfo(4))=1 then
getPopedom=true
else
getPopedom=false
end if
end function
function countfilesize(objsize)
if objsize<>"" then
countfilesize=objsize
if countfilesize>=1024 and countfilesize<1048576 then
countfilesize=countfilesize/1024
countfilesize=FormatNumber(countfilesize,2,-1)&"KB"
elseif countfilesize>=1048576 and countfilesize<1073741824 then
countfilesize=countfilesize/1048576
countfilesize=FormatNumber(countfilesize,2,-1)&"MB"
else
countfilesize=countfilesize&"byte"
end if
else
exit function
end if
end function
sub admin_top()
dim strTemp
strTemp="<html><head><meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312""><link href=""images/admin.css"" type=""text/css"" rel=""stylesheet""><script src=""images/function.js""></script><title>茂盛网部管理系统</title></head><body class=""main_body"">"
response.write(strTemp)
end sub
sub admin_foot()
dim strTemp
strTemp="<p></P><br><hr style=""height:3px;color:#ffffff;border:1px #0096CE dashed;""></hr><table border=""0"" width=""100%"" valign=""bottom""><tr><td align=""center""> 版权所有 :【茂盛设计工作室】 (当前版本:MaosinCMS Ver1.1)<br> ©2006-2007 <a href=""http://www.maosin.com""><font color=""#ff0000"">maosin.com</font></a> All Rights Reserved.</td></tr></table></body></html>"
response.write(strTemp)
end sub
'========================================================
'MaoSin CMS 1.1 Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
'========================================================
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -