📄 sort.asp
字号:
sqf="SELECT * FROM download where big='"&ra("sort")&"'"
rf.OPEN sqf, Conn,3,3
if not (rf.eof and rf.bof) then
rf.movefirst
do while not rf.eof
rf("big")=trim(request("idsname"))
rf.update
all=rf.recordcount
i=i+1
if i>=all then exit do
rf.movenext
loop
end if
rf.close
set rf=nothing
ra("sort")=trim(request("idsname"))
end if
else
response.write "请输入修改后分类的名称"
response.end
end if
if trim(request("idsjj"))<>"" then
ra("ms")=trim(request("idsjj"))
ra.Update
else
ra.Update
end if
response.write "修改完成"
response.write "<a href=""sort.asp"">返回</a>"
end if
elseif sortl="del" then
if request("ko")="" then
%>
<form method="POST" action="sort.asp?sort=del&iddel=<%=request("sortdelid")%>&ko=yes">
<p><b><font color="#000000">注意:</font></b>"<font color="#0000FF">删除分类</font>"将删除大分类下所有小分类和小分类下的<font color="#0000FF">所有记录</font>,如果该分类下的记录仍然有用,请先利用"编辑分类"功能将该分类下的记录转移到其他分类!</p>
<p align="center">确认删除</p>
<p align="center"><input type="submit" value="提交" name="B1"> <a href="sort.asp">返回</a></p>
</form>
<%
else
if request("iddel")<>"" then
Set rb = Server.CreateObject("ADODB.Recordset")
sqz="SELECT * FROM sort where id="&request("iddel")
rb.OPEN sqz, Conn,1,3
if rb.eof and rb.bof then
response.write "非法操作,没有该分类"
response.end
else
idb=rb("sort")
rb.delete
end if
rb.close
set rb=nothing
Set rc = Server.CreateObject("ADODB.Recordset")
sqc="SELECT * FROM small where sortid='"&idb&"'"
rc.OPEN sqc, Conn,1,3
if not (rc.eof and rc.bof) then
rc.movefirst
While Not rc.EOF
Rc.Delete
rc.MoveNext
Wend
end if
rc.close
set rc=nothing
Set rd = Server.CreateObject("ADODB.Recordset")
sqd="SELECT * FROM download where big='"&idb&"'"
rd.OPEN sqd, Conn,1,3
if not (rd.eof and rd.bof) then
rd.movefirst
While Not rd.EOF
Rd.Delete
rd.MoveNext
Wend
end if
rd.close
set rd=nothing
response.write "删除完成"
response.write "<a href=""sort.asp"">返回</a>"
else
response.write "非法操作"
response.end
end if
end if
end if
ra.close
set ra=nothing
end sub
sub small()
smalll=request("small")
Set ra = Server.CreateObject("ADODB.Recordset")
if smalll="add" then
sqb="SELECT * FROM small where small='"&trim(request("newsort2"))&"'"
elseif smalll="edit" then
if request("up")<>"" then
sqb="SELECT * FROM small where id="&request("idss")
else
sqb="SELECT * FROM small where id="&request("smallid")
end if
elseif smalll="del" then
sqb="SELECT * FROM small"
end if
ra.OPEN sqb, Conn,1,3
if smalll="add" then
if trim(request("newsort2"))<>"" then
if not ra.eof then
response.write "已有该分类,请重新输入分类名"
response.end
end if
if strLength(trim(request("newsort2")))>40 then
response.write "输入的字符串太长"
response.end
else
Set rp = Server.CreateObject("ADODB.Recordset")
sqp="SELECT * FROM sort where id="&request("addsort1id")
rp.OPEN sqp, Conn,1,1
if rp.eof and rp.bof then
response.write "没有该大类~重新选择"
response.end
end if
ra.addnew
ra("small")=trim(request("newsort2"))
ra("sortid")=rp("sort")
rp.close
set rp=nothing
end if
else
response.write "请输入添加分类的名称"
response.end
end if
if trim(request("adddescription2"))<>"" then
ra("ms")=trim(request("adddescription2"))
ra.Update
response.write "添加完成"
response.write "<a href=""sort.asp"">返回</a>"
else
ra.Update
response.write "添加完成"
response.write "<a href=""sort.asp"">返回</a>"
end if
elseif smalll="edit" then
if request("up")="" then
%>
<form method="POST" action="sort.asp?small=edit&up=yes">
<p>编号:<input type="text" name="idss" size="3" readonly style="background-color: #C0C0C0; border: 1 solid #000000" value="<%=ra("id")%>">
名称:<input type="text" name="idsnames" size="10" style="border: 1 solid #000000" value="<%=ra("small")%>">
简介:<input type="text" name="idsjjs" size="15" style="border: 1 solid #000000" value="
<%
if ra("ms")<>"" then
response.write ra("ms")
end if
%>">
所属大类:<input type="text" name="idssorts" size="10" readonly style="background-color: #C0C0C0; border: 1 solid #000000" value="<%=ra("sortid")%>">
<select size=1 name=idssortsid style='color:#000000; border-style:solid; border-width:1; background-color:#efefef'>
<option value='' selected>更改所属大类</option>
<%
Set rssort = Server.CreateObject("ADODB.Recordset")
sqlsort="SELECT * FROM sort"
rssort.OPEN sqlsort, Conn,1,1
do while not rssort.eof
%>
<option value='<%=rssort("id")%>'><%=rssort("sort")%></option>
<%
rssort.movenext
loop
rssort.close
set rssort=nothing
%>
</select>
<input type="submit" value="提交" name="B1" style="border: 1 solid #000000"></p>
</form>
<%
else
if request("idssortsid")<>"" then
Set rp = Server.CreateObject("ADODB.Recordset")
sqp="SELECT * FROM sort where id="&request("idssortsid")
rp.OPEN sqp, Conn,1,1
Set rv = Server.CreateObject("ADODB.Recordset")
sqv="SELECT * FROM small where id="&request("idss")
rv.OPEN sqv, Conn,1,3
rv("sortid")=rp("sort")
rv.update
rv.close
set rv=nothing
Set rx = Server.CreateObject("ADODB.Recordset")
sqx="SELECT * FROM download where big='"&request("idssorts")&"'"
rx.OPEN sqx, Conn,3,3
if not (rx.eof and rx.bof) then
rx.movefirst
do while not rx.eof
rx("big")=rp("sort")
rx.update
alli=rx.recordcount
ii=ii+1
if ii>=alli then exit do
rx.movenext
loop
end if
rx.close
set rx=nothing
rp.close
set rp=nothing
else
if trim(request("idsnames"))<>"" then
Set rew = Server.CreateObject("ADODB.Recordset")
sqe="SELECT * FROM small where small='"&trim(request("idsnames"))&"'"
rew.OPEN sqe, Conn,1,1
if not rew.eof then
response.write "已有该分类,请重新输入分类名"
response.end
end if
rew.close
set rew=nothing
if strLength(trim(request("idsnames")))>40 then
response.write "输入的字符串太长"
response.end
else
Set rf = Server.CreateObject("ADODB.Recordset")
sqf="SELECT * FROM download where sort='"&ra("small")&"'"
rf.OPEN sqf, Conn,3,3
if not (rf.eof and rf.bof) then
rf.movefirst
do while not rf.eof
rf("sort")=trim(request("idsnames"))
rf.update
alle=rf.recordcount
ie=ie+1
if ie>=alle then exit do
rf.movenext
loop
end if
rf.close
set rf=nothing
ra("small")=trim(request("idsnames"))
end if
else
response.write "请输入修改后分类的名称"
response.end
end if
end if
if trim(request("idsjjs"))<>"" then
ra("ms")=trim(request("idsjjs"))
ra.Update
else
ra.Update
end if
response.write "修改完成"
response.write "<a href=""sort.asp"">返回</a>"
end if
elseif smalll="del" then
if request("ko")="" then
%>
<form method="POST" action="sort.asp?small=del&iddell=<%=request("smalldelid")%>&ko=yes">
<p><b><font color="#000000">注意:</font></b>"<font color="#0000FF">删除分类</font>"将删除大分类下所有小分类和小分类下的<font color="#0000FF">所有记录</font>,如果该分类下的记录仍然有用,请先利用"编辑分类"功能将该分类下的记录转移到其他分类!</p>
<p align="center">确认删除</p>
<p align="center"><input type="submit" value="提交" name="B1"> <a href="sort.asp">返回</a></p>
</form>
<%
else
if request("iddell")<>"" then
Set rb = Server.CreateObject("ADODB.Recordset")
sqz="SELECT * FROM small where id="&request("iddell")
rb.OPEN sqz, Conn,1,3
if rb.eof and rb.bof then
response.write "非法操作,没有该分类"
response.end
else
idb=rb("small")
rb.delete
end if
rb.close
set rb=nothing
Set rd = Server.CreateObject("ADODB.Recordset")
sqd="SELECT * FROM download where sort='"&idb&"'"
rd.OPEN sqd, Conn,1,3
if not (rd.eof and rd.bof) then
While Not rd.EOF
Rd.Delete
rd.MoveNext
Wend
end if
rd.close
set rd=nothing
response.write "删除完成"
response.write "<a href=""sort.asp"">返回</a>"
else
response.write "非法操作"
response.end
end if
end if
end if
ra.close
set ra=nothing
end sub
rssort.close
set rssort=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -