📄 sort_ok.asp
字号:
<!--#include file="../setup.asp"-->
<!--#include file="login_admin.asp"-->
<%
'================================================================================
'Product:K-Search Version 2.1
'本“软件产品”受《中华人民共和国著作权法》和《中华人民共和国计算机软件保护条例》
'和国际条约的保护。如未经授权而擅自复制或传播本程序(或其中任何部分),将受到严厉
'的刑事及民事制裁,并将在法律许可的范围内受到最大可能的起诉!
'Homepage:http://www.lucoo.com/
'--------------------------------------------------------------------------------
'Copyright(c) 2005 lucoo.com All Rights Reserved 绿色互联 版权所有
'================================================================================
if session("rank")<>1 then
response.write "<Script>window.alert('您的管理员级别不能操作!');history.go(-1);</Script>"
response.end
end if
%>
<!--#include file="conn.asp"-->
<%
select case request("action")
case "add"
call add()
case "edit"
call edit()
case "del"
call delete()
case "alldel"
call alldelete()
end select
sub add()
dim rs
dim show
dim sort_id
dim move_id
move_id=request.form("move_id")
if move_id<>"" then
set rs=conn.execute("select * from sort where id="&move_id)
if rs.eof and rs.bof then
'
else
sort=rs("sort")
id=rs("id")
sort_id=rs("sort_id")
end if
rs.close
set rs=nothing
dim address
address="/"&id&"/"
if sort_id<>0 then
for i=1 to 8 step 1
set rs=conn.execute("select * from sort where id="&sort_id)
if rs.eof and rs.bof then
'
else
sort_id=rs("sort_id")
address="/"&rs("id")&""& address
end if
rs.close
set rs=nothing
next
end if
end if
show=request.form("show")
sort_id=request.form("sort_id")
set rs=server.createobject("adodb.recordset")
rs.open "select * from sort where id is null",conn,1,3
rs.addnew
rs("sort")=request.form("sort")
if show="" then
rs("show")="0"
else
rs("show")=show
end If
if sort_id="" then
rs("sort_id")="0"
else
rs("sort_id")=sort_id
end If
if move_id="" then
rs("move_id")="0"
else
rs("move_id")=move_id
rs("move_url")=address
end If
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
if sort_id="" then
response.write "<Script>window.alert('分类添加成功');location.replace('sort_manage.asp');</Script>"
else
response.write "<Script>window.alert('分类添加成功');location.replace('sort.asp?sort_id="&sort_id&"');</Script>"
end If
end sub
sub edit()
dim rs
dim show
dim sort_id
dim move_id
move_id=request.form("move_id")
if move_id<>"" then
set rs=conn.execute("select * from sort where id="&move_id)
if rs.eof and rs.bof then
'
else
sort=rs("sort")
id=rs("id")
sort_id=rs("sort_id")
end if
rs.close
set rs=nothing
dim address
address="/"&id&"/"
if sort_id<>0 then
for i=1 to 8 step 1
set rs=conn.execute("select * from sort where id="&sort_id)
if rs.eof and rs.bof then
'
else
sort_id=rs("sort_id")
address="/"&rs("id")&""& address
end if
rs.close
set rs=nothing
next
end if
end if
show=request.form("show")
sort_id=request.form("sort_id")
set rs=server.createobject("adodb.recordset")
rs.open "select * from sort where id="&request.form("id"),conn,1,3
rs("sort")=request.form("sort")
if show="" then
rs("show")="0"
else
rs("show")=show
end If
if sort_id="" then
rs("sort_id")="0"
else
rs("sort_id")=sort_id
end If
if move_id="" then
rs("move_id")="0"
else
rs("move_id")=move_id
rs("move_url")=address
end If
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
if sort_id="0" then
response.write "<Script>window.alert('分类修改成功');location.replace('sort_manage.asp');</Script>"
else
response.write "<Script>window.alert('分类修改成功');location.replace('sort.asp?sort_id="&sort_id&"');</Script>"
end If
end sub
sub delete()
dim id
dim sort_id
id=Request.QueryString("id")
sort_id=Request.QueryString("sort_id")
conn.execute"delete from sort where id="&id
conn.execute"delete from web where sort_path like '%/" & id & "/%'"
conn.close
set conn=nothing
if sort_id="0" then
response.write "<Script>window.alert('分类删除成功');location.replace('sort_manage.asp');</Script>"
else
response.write "<Script>window.alert('分类删除成功');location.replace('sort.asp?sort_id="&sort_id&"');</Script>"
end If
end sub
sub alldelete()
dim id
dim sort_id
id=request.querystring("id")
sort_id=request.querystring("sort_id")
if id="" then
conn.close
set conn=nothing
response.write "<script>window.alert('没有选择删除的纪录!');history.go(-1);</script>"
else
for i=1 to request.querystring("id").count
id=request.querystring("id")(i)
conn.execute"delete from sort where id="&id
conn.execute"delete from web where sort_path like '%/" & id & "/%'"
next
conn.close
set conn=nothing
if sort_id="0" then
response.write "<script>window.alert('分类批量删除成功!');location.replace('sort_manage.asp');</script>"
else
response.write "<script>window.alert('分类批量删除成功!');location.replace('sort.asp?sort_id="&sort_id&"');</script>"
end if
end if
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -