admin_booklist.asp

来自「本人仅业余学习一些基础的ASP知识以供系统设计之用,并非专业人员,相关服务器设置」· ASP 代码 · 共 849 行 · 第 1/3 页

ASP
849
字号
<!--#include file="../conn.asp" -->
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/GetFunction.asp"-->
<!--#include file="../inc/upfile.asp"-->
<!--#include file="session.asp"-->
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body>

<%
if htmlphem=1 then
htmlphe="htm"
elseif htmlphem=2 then
htmlphe="html"
elseif htmlphem=3 then
htmlphe="shtml"
elseif htmlphem=4 then
htmlphe="asp"
else
htmlphe="html"
end if
Page=request.querystring("Page")
info=request.querystring("info")
urltype=request.querystring("urltype")
if urltype="list" then
clid=request.querystring("clid")
cndb=request.querystring("cndb")
	if cndb="" then
		cndb="all"
	end if
	responseurl="admin_book.asp?info=booklist&cndb="&cndb&"&clid="&clid&"&Page="&Page&""
elseif urltype="listjian" then
	cndb=request.querystring("cndb")
	if cndb="" then
		cndb="jingpin"
	end if
	responseurl="admin_bookjian.asp?info="&cndb&"&page="&page&""
elseif urltype="search" then
	key_keyword=request.querystring("key_keyword")
	key_type=request.querystring("key_type")
	responseurl="admin_booksearch.asp?key_type="&key_type&"&key_keyword="&key_keyword&"&page="&page&""
else
	responseurl="admin_book.asp?info=booklist&cndb=all"
end if
If info="" Then
	Call ShowAdminErrMsg("参数传递错误!",responseurl)
End If
Select Case info
	Case "删除"
		Call listdel()
	Case "推荐"
		Call listjian()
	Case "移动"
		Call listmove()
	Case "采集"
		Call listload()
	Case "审核"
		Call listlock()
	Case "静态生成"
		Call listhtml()
	Case "通过 VIP"
		Call listvip()
end select 

sub listdel()
	id=trim(request("checked"))
	If ID="" Then
		ErrCodes = ErrCodes & "<li>您至少需要选择一部作品!</li><br>"
		FoundErr=True
	End If
	if FoundErr=True then
		Call ShowAdminErrMsg(ErrCodes,responseurl)
	else
		viewArray=Split(ID, ",")
		Num = UBound(viewArray)
		For i=0 To Num
			set rsfile=server.createobject("adodb.recordset")
			if IsSqlDataBase = 2 then
				strSQL ="select fileurl_name,fileurl_path from filetest where fileurl_class=3 and fileurl_fileID ="&viewArray(i)&""
			else
				strSQL ="select fileurl_name,fileurl_path from [filetest] where fileurl_class=3 and fileurl_fileID ="&viewArray(i)&""
			end if
			rsfile.open strSQL,conn,1,1
			if not(rsfile.eof and rsfile.bof) then
			do while not rsfile.eof
				file1=server.mappath( rsfile("fileurl_path")&rsfile("fileurl_name") )
				set tfo=Server.CreateObject("Scripting.FileSystemObject")
				if tfo.FileExists(file1) = True Then                                '判断文件是否存在
					set nf=tfo.GetFile(file1)
					nf.delete
					Success = Success & "<li> "&rsfile("fileurl_path")&rsfile("fileurl_name")&" 作品封面附件删除成功!</li><br>"
				else
					Success = Success & "<li> "&rsfile("fileurl_path")&rsfile("fileurl_name")&" 作品封面附件已丢失!</li><br>"
				end if
				Set tfo = nothing
			rsfile.movenext
    		loop
			end if
			rsfile.close
			set rsfile=nothing
			if IsSqlDataBase = 2 then
				conn.execute"delete from filetest where ID ="&viewArray(i)&""
			else
				conn.execute"delete from [filetest] where ID ="&viewArray(i)&""
			end if
			
			viewFolder = SiteSystemPath&"HTML/"&viewArray(i)&"/"
			
			set rsco=server.createobject("adodb.recordset")
			if IsSqlDataBase = 2 then
				sql="select id,list_cookid from list_view where view_id="&viewArray(i)&""
			else
				sql="select id,list_cookid from [list_view] where view_id="&viewArray(i)&""
			end if
			rsco.open sql,conn,1,1
			if rsco.eof and rsco.bof then
			else
			do while not rsco.eof
				id1=rsco("id")
				cook_id=rsco("list_cookid")

				set rsfile=server.createobject("adodb.recordset") 
				if IsSqlDataBase = 2 then
					strSQL ="select fileurl_name,fileurl_path from filetest where fileurl_class=1 and fileurl_fileID ="&id1&""
				else
					strSQL ="select fileurl_name,fileurl_path from [filetest] where fileurl_class=1 and fileurl_fileID ="&id1&""
				end if
				rsfile.open strSQL,conn,1,1
				if not(rsfile.eof and rsfile.bof) then
				do while not rsfile.eof
					file1=rsfile("fileurl_path")&rsfile("fileurl_name")
					FSOFiledel(file1)
				rsfile.movenext
			    loop
				end if
				rsfile.close
				set rsfile=nothing
				if IsSqlDataBase = 2 then
					conn.execute"delete from filetest where ID ="&id1&""
				else
					conn.execute"delete from [filetest] where ID ="&id1&""
				end if
				
				file3=viewFolder&"Z"&cook_id&"."&htmlphe&""
				file2=viewFolder&id1&"."&htmlphe&""
				file1=viewFolder&id1&".TXT"
				FSOFiledel(file1)
				FSOFiledel(file2)
				FSOFiledel(file3)

			rsco.movenext
			loop
			end if
			rsco.close
			set rsco=nothing
			Success = Success & "<li> 作品章节附件已全部清理!</li><br>"
			Success = Success & "<li> 作品章节静态页面已全部清理!</li><br>"
			Success = Success & "<li> 作品分卷静态页面已全部清理!</li><br>"
		
			file4=viewFolder&"Allbook"&viewArray(i)&"."&htmlphe&""
			file5=SiteSystemPath&viewArray(i)&"."&htmlphe&""
			file6=viewFolder&"index."&htmlphe&""
			FSOFiledel(file4)
			FSOFiledel(file5)
			FSOFiledel(file6)
			Success = Success & "<li> 作品资料静态页面已清理!</li><br>"
			Success = Success & "<li> 作品全文静态页面已清理!</li><br>"
			Success = Success & "<li> 作品目录静态页面已清理!</li><br>"

			
			if IsSqlDataBase = 2 then
				conn.execute "delete from list_view where view_id="&viewArray(i)&" "
				conn.execute "delete from list_cook where list_bookid="&viewArray(i)&" "
				conn.execute "delete from Comment where commenttype=1 and type_id="&viewArray(i)&" "
				conn.execute "delete from list_book where id="&viewArray(i)&""
			else
				conn.execute "delete from [list_view] where view_id in ("&viewArray(i)&") "
				conn.execute "delete from [list_cook] where list_bookid in ("&viewArray(i)&") "
				conn.execute "delete from [Comment] where commenttype=1 and type_id in ("&viewArray(i)&") "
				conn.execute "delete from [list_book] where id in ("&viewArray(i)&") "
			end if
			
		Next
		if makeJS=1 then
			temzxgx(zxgxNum)
		end if
		call connclose() 
		Call ShowAdminSuccessMsg(Success &"<li>作品批量删除操作成功!</li><br>",responseurl)
	end if
end sub

sub listjian()
id=trim(request("checked"))
If ID="" Then
	ErrCodes = ErrCodes & "<li>您至少需要选择一部作品!</li><br>"
	FoundErr=True
End If
if FoundErr=True then
	Call ShowAdminErrMsg(ErrCodes,"javascript:history.go(-1)")
else
	if request("action")="save" then
		Ntype=request("Ntype")
		If Ntype="" Then
			ErrCodes = ErrCodes & "<li>您需要选择推荐类型!</li><br>"
			FoundErr=True
		End If
		if FoundErr=True then
			Call ShowAdminErrMsg(ErrCodes,"javascript:history.go(-1)")
		else
			viewArray=Split(ID, ",")
			Num = UBound(viewArray)
			For i=0 To Num
				set rs=server.CreateObject("ADODB.RecordSet")
				if Ntype="feng" then
					if IsSqlDataBase = 2 then
						sql="select Isweb_good from list_book where id="&viewArray(i)
					else
						sql="select Isweb_good from [list_book] where id="&viewArray(i)
					end if
					rs.open sql,conn,1,3
					if not rs.eof then
						rs("Isweb_good")=1
						rs.update
					end if
					rs.close
				elseif Ntype="classfeng" then
					if IsSqlDataBase = 2 then
						sql="select Isweb_good from list_book where id="&viewArray(i)
					else
						sql="select Isweb_good from [list_book] where id="&viewArray(i)
					end if
					rs.open sql,conn,1,3
					if not rs.eof then
						rs("Isweb_good")=2
						rs.update
					end if
					rs.close
				elseif Ntype="jing" then
					if IsSqlDataBase = 2 then
						sql="select IsGood from list_book where id="&viewArray(i)
					else
						sql="select IsGood from [list_book] where id="&viewArray(i)
					end if
					rs.open sql,conn,1,3
					if not rs.eof then
						rs("IsGood")=1
						rs.update
					end if
					rs.close
				elseif Ntype="classjing" then
					if IsSqlDataBase = 2 then
						sql="select IsGood from list_book where id="&viewArray(i)
					else
						sql="select IsGood from [list_book] where id="&viewArray(i)
					end if
					rs.open sql,conn,1,3
					if not rs.eof then
						rs("IsGood")=2
						rs.update
					end if
					rs.close
				elseif Ntype="qiang" then
					if IsSqlDataBase = 2 then
						sql="select listvv_good from list_book where id="&viewArray(i)
					else
						sql="select listvv_good from [list_book] where id="&viewArray(i)
					end if
					rs.open sql,conn,1,3
					if not rs.eof then
						rs("listvv_good")=1
						rs.update
					end if
					rs.close
				elseif Ntype="classqiang" then
					if IsSqlDataBase = 2 then
						sql="select listvv_good from list_book where id="&viewArray(i)
					else
						sql="select listvv_good from [list_book] where id="&viewArray(i)

⌨️ 快捷键说明

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