⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_authormana.asp

📁 3000首FLASH源程序
💻 ASP
字号:
<!--#include file="function.asp"-->
<%CheckAdmins%>
<!--#include file="top.asp"-->
<script language="javascript">
<!--
   function test() {
      return confirm("警告!\n将同时删除该作者的所有作品!是否继续?");
    }
//-->
</script>
<%
		sql="select top 1 jsauthorid from const"
		rs.open sql,conn,1,1
			if not rs.eof then
				jsauthorid=rs("jsauthorid")
			end if
		rs.close
		
if request.form("jsauthorid")<>"" then
		jsauthorid=request.form("jsauthorid")
		sql="select authorid from author where authorid="&jsauthorid
		rs.open sql,conn,1,1
			if rs.eof then
				founderr=true
				errmsg=errmsg+"<br><li>对不起,您所设的作者ID<font color=#ff0000>"&authorid&"</font>不存在!</li>"
				call error()
				response.end
				rs.close
			else			
		rs.close		
	sql="select top 1 * from const"
	rs.open sql,conn,1,3
	rs("jsauthorid")=jsauthorid
	rs.update
	rs.close
	end if
end if

author=request("author")
if not isempty(request("page")) then
	currentPage=cint(request("page"))
else
	currentPage=1
end if
if not isempty(request("selpic")) then
   idlist=request("selpic")
     if instr(idlist,",")>0 then
			dim idarr
			idArr=split(idlist)
			dim id
		for i = 0 to ubound(idarr)
	       		authorid=clng(idarr(i))
	       		call delpic(authorid)
		next
    else
			call delpic(clng(idlist))
    end if
end if 
%>
<table border="0" width=770 align=center cellspacing="1" cellpadding="1" bgcolor="<%=Tablebackcolor%>">
  <tr> 
    <td bgcolor="<%=Tabletitlecolor%>" align="center" width="163" valign="top"> <br>
     <!--#include file="admin_left.asp"-->
    </td>
    <td bgcolor="<%=Tablebodycolor%>" width="600" height="2" align="center" valign="top"> 
<%
	if author<>"" then
		sql="select * from author where author like '%"&trim(author)&"%' order by authorid desc"
	else
		sql="select * from author order by authorid desc"
	end if
	rs.open sql,conn,1,1
	if rs.eof and rs.bof then 
		response.write "<p align='center'>暂时没有收集</p>" 
	else 
		totalPut=rs.recordcount
		PageUrl="admin_authormana.asp"
	if currentpage<1 then currentpage=1 
	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,PageUrl
		showContent 
		showpage totalput,MaxPerPage,PageUrl
	else 
		if (currentPage-1)*MaxPerPage<totalPut then 
			rs.move  (currentPage-1)*MaxPerPage 
			dim bookmark 
			bookmark=rs.bookmark 
			showpage totalput,MaxPerPage,PageUrl
			showContent 
			showpage totalput,MaxPerPage,PageUrl
		else 
			currentPage=1 
			showpage totalput,MaxPerPage,PageUrl
			showContent 
			showpage totalput,MaxPerPage,PageUrl
		end if 
	end if 
end if 
rs.close 

sub showContent 
i=0 
%>
      <table border="1" cellspacing="0" width="589" bordercolorlight="<%=Tablebackcolor%>" bordercolordark="#FFFFFF" cellpadding="1">
        <form method=Post action="admin_authormana.asp" onsubmit="return test();">
          <tr bgcolor="<%=Tabletitlecolor%>"> 
            <td width="52" align="center" height="20"><strong>ID</strong></td>
              
            <td width="464" align="center"><strong>作 者 名 称</strong></td>
              
            <td width="65" align="center"> 
              <input type='submit' value='删 除'>
            </td>
      	  </tr>
<%do while not rs.eof%>
           
          <tr bgcolor="#E3FBE3"> 
            <td height="23" width="52" align="center"><%=rs("authorid")%></td>
              
            <td width="464"><a href="admin_authoredit.asp?id=<%=rs("authorid")%>"><%=rs("author")%></a></td>
              
            <td width="65" align="center"> 
              <input type='checkbox' name='selpic' value='<%=cstr(rs("authorid"))%>'></td>
        	</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
	</form>
 </table>
      <%
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 "<div align=right><form method=Post action="&filename&">"&_
				"共找到<b>"&totalnumber&"</b>项记录" 
if CurrentPage<2 then
response.write "&nbsp;首页 上一页&nbsp;"
else
response.write "&nbsp<a href="&filename&"?page=1>首页</a>&nbsp;<a href="&filename&"?page="&CurrentPage-1&">上一页</a>&nbsp;" 
end if
if n-currentpage<1 then
response.write "下一页 末页 "
else
response.write "<a href="&filename&"?page="&CurrentPage+1&">下一页</a>&nbsp;"&_
                "<a href="&filename&"?page="&n&">末页</a>" 
end if
response.write "&nbsp;页次:<strong>"&CurrentPage&"/"&n&"</strong>页  转到:<select name='page' size='1' onchange='javascript:submit()'>"
               for i = 1 to n
response.write "<option value="&i
 				if cint(CurrentPage)=cint(i) then response.write " selected "
response.write ">第"&i&"页</option>"
                next
response.write "</select></form></div>"      
end function

sub delpic(authorid)
sql="delete from author where authorid="&cstr(authorid)
conn.execute sql
sql="delete from pic where authorid="&cstr(authorid)
conn.execute sql
sql="delete from stamp where authorid="&cstr(authorid)
conn.execute sql
End sub%>
      <table width="95%" border="0" cellspacing="1" cellpadding="1" bgcolor="#333333">
        <tr>
		<form method="POST" action="admin_authormana.asp">
            <td bgcolor="#E7FBE7" align="center">首页作者调用:作者ID: 
              <input type="text" name="jsauthorid" size="3" value="<%=jsauthorid%>">
              <input type="submit" value="设定">
          </td>
		</form>		
		<form method="POST" action="admin_authormana.asp">
          <td bgcolor="#E7FBE7" align="center">搜索作者: <input type="text" name="author" size="23" value="<%=author%>">
              <input type="submit" value="查 询">
          </td>
		</form>
  </tr>
</table>
      </td>
  </tr>
</table>
<%
set rs=nothing
conn.close
set conn=nothing
%>
<!--#include file="copyright.asp"-->
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -