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

📄 editfenlei.asp

📁 可以做论坛
💻 ASP
字号:
<%@ Language=VBScript %> 
<% Response.Buffer = True %>
<!--#include file="top.asp"-->
<!--#include file="gongneng.asp"-->
<!--#include file="admingongneng.asp"-->
<!--#include file="bottom.asp"-->
<!--#include file="sysinfo.asp"-->

<table width=775 border="0" align="center" cellspacing="0">
  <tr> 
    <td align="center" valign="middle"> 
      <%
if uzhiwu=100 then '是管理员

IDLF=request("idl")
unlei=request("unlei")
if unlei<>"" then
conn.Execute("update luntan set fenlei=0 where idl="&IDLF)
response.redirect"editfenlei.asp?idl="&IDLF&""
end if
del=request("del")
 '删除分类
if del<>"" then
cc="select * from luntan where idl=" & del &""
set rs=server.createobject("adodb.recordset")
rs.open cc,conn,1,3
response.write"<font color=#FF0000>你要删除["&rs("luntan")&"]分类,此操作不可还原,请选择:[<a href=editfenlei.asp?del="&del&"&idl="&IDLF&"&delall=0>只删除此类名称</a>] [<a href=editfenlei.asp?del="&del&"&idl="&IDLF&"&delall=1>删除此类与此分类下的所有"&sbbs&"</a>]</font>"
delall=request("delall")
if delall<>"" then
if delall=0 then
conn.Execute("update luntan set fenlei=0 where fenlei="&del)
set rsdellt=server.createobject("adodb.recordset")
ccdellt="delete * from luntan where idl="&del
rsdellt.open ccdellt,conn,1,3
response.redirect"editfenlei.asp?idl="&IDLF&""
else
set rsdellt=server.createobject("adodb.recordset")
ccdellt="delete * from luntan where fenlei="&del&" or idl="&del&""
rsdellt.open ccdellt,conn,1,3
response.redirect"editfenlei.asp?idl="&IDLF&""
end if
end if
end if
 '增加分类
addn=request("addn")
if addn<>"" then
response.Write"<table width=80% border=0 align=center cellspacing=0 class=td3><tr>"
response.Write"<td><form name=form1 method=post action=editfenlei.asp?addn="&request("addn")&"&idl="&IDLF&">"
response.Write"分类名称:<input type=text name=newluntan>"
response.Write"<input type=submit name=Submit2 value=增加分类>"
response.Write"</form></td></tr></table>"
if request.form("newluntan")<>"" then
newluntan=request("newluntan")
newluntan=Trim(newluntan)
cc="select * from luntan where luntan= '" & newluntan &"'"
set rs=server.createobject("adodb.recordset")
rs.open cc,conn,1,3
if rs.eof then
rs.AddNew
rs("luntan")=newluntan
rs("fenlei")= -1
rs.Update
response.redirect"editfenlei.asp?idl="&IDLF&""
else
Response.Write "你要建立的"&sbbs&"已经存在返<a href=editfenlei.asp?idl="&IDLF&">重新填加</a>"
end if
end if
end if
 '修改名称
md=request("md")
if md<>"" then
conn.Execute("update luntan set fenlei='"&md&"' where idl="&request("idl"))
response.redirect"editfenlei.asp?idl="&IDLF&""
end if 
if request("modify")<>"" then
IDLF=request("idl")
modify=request("modify")
ccfl="select  * from luntan where idl="&modify&""
set rsfl=server.createobject("adodb.recordset")
rsfl.open ccfl,conn,1,1
response.write"<table width=80% border=0 cellspacing=0 class=td1><tr>"
response.write"<td><form name=form method=post action=editfenlei.asp?modify="&request("modify")&"&idl="&IDLF&">"
response.write""&sbbs&"名称:<input type=text name=luntan value="&rsfl("luntan")&">"
response.write"<input type=submit name=Submit2 value=修改>"
response.write"</form></td> </tr></table>"
luntan=request.form("luntan")
'response.write"修改"&luntan&""
if luntan<>"" then 
conn.Execute("update luntan set luntan='"&luntan&"' where idl="&request("modify"))
response.redirect"editfenlei.asp?idl="&IDLF&""
end if


else 
ccfl="select  * from luntan where idl="&IDLF&""
set rsfl=server.createobject("adodb.recordset")
rsfl.open ccfl,conn,1,1
if not rsfl.eof then '已删除
fenlei=rsfl("fenlei")
'response.write"修改"&fenlei&""
if CInt(fenlei)<1 then
fenlei="未加入分类"
else
ccfll="select  * from luntan where idl="&fenlei&""
set rsfll=server.createobject("adodb.recordset")
rsfll.open ccfll,conn,1,1
fenlei=rsfll("luntan")
end if

response.write"<table width=80% border=0 align=center cellspacing=0 class=td1>"
response.write"<tr><td colspan=2   class=td3>["&rsfl("luntan")&"]"&sbbs&" 属于:"&fenlei&"  [<a href=editfenlei.asp?modify="&rsfl("idl")&"&idl="&IDLF&">修改"&rsfl("luntan")&""&sbbs&"名称</a>] [<a href=editfenlei.asp?unlei="&rsfl("idl")&"&idl="&IDLF&">取消分类</a>]</td></tr>"
response.write"<tr><td colspan=2   class=td3>目前所有分类:[<a href=editfenlei.asp?addn=addn&idl="&IDLF&">填加新分类</a>]</td></tr>"
ccflfl="select  * from luntan where fenlei= -1"
set rsflfl=server.createobject("adodb.recordset")
rsflfl.open ccflfl,conn,1,1
i=0
do while not rsflfl.eof
if i mod 2 =0 then
response.write"</tr><tr>"
end if
i=i+1
response.write"<td>"&rsflfl("luntan")&" [<a href=editfenlei.asp?del="&rsflfl("idl")&"&idl="&IDLF&">删除此类</a>] [<a href=editfenlei.asp?modify="&rsflfl("idl")&"&idl="&IDLF&">修改分类名称</a>] [<a href=editfenlei.asp?md="&rsflfl("idl")&"&idl="&IDLF&">填加到此类</a>]</td>"
rsflfl.MoveNext 
loop
response.write"</tr></table>"
else '已删除
Response.Write""&sbbs&"不存在或已删除"
end if '已删除


end if
else
Response.Write"非管理员不可以操作"
end if
%>
    </td>
  </tr></table>
<%
Response.Write""&asptbcopy&""
Response.Flush%>

⌨️ 快捷键说明

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