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

📄 setclass.asp

📁 用asp实现的通用网站管理系统。
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
''''''''''''''''''''''''''''''''''''''''''''
'
'  TXSite / 通用网站系统
'
'  版本    :v1.8.20
'
'  制作人  :milp(milp@21cn.com)
'
'  版权所有:源码之家(http://www.21tx.com)
'
'  主页地址:http://www.21tx.com
'            http://www.bestnets.net
'            http://www.soucn.com
'
'  技术支持:http://www.21tx.com/bbs
'
''''''''''''''''''''''''''''''''''''''''''''
'程序创建时间:23:02 2001-8-6
'程序完成时间:11:20 2001-8-7
'最后修改时间:21:49 2001-8-7
if session("adminflag")="" then Response.Redirect "default.asp"
dim action,rsclass
set rsclass=server.createobject("adodb.recordset")
action=request("action")
const thisprog="setclass.asp"
%>
<!--#include file=base.asp-->
<!--#include file=subs1.asp-->
<%
if session("adminflag")<>1 then Call PrintMsg(NotAdmin)
Select Case action
  Case "addr" Call saveaddr
  Case "addm" Call saveaddm
  Case "adds" Call saveadds
  Case "modr" Call savemodr
  Case "modm" Call savemodm
  Case "mods" Call savemods
  Case "delr" Call deleter
  Case "delm" Call deletem
  Case "dels" Call deletes
  Case "update" Call menuwelcome
  Case "updatemenu" Call updatemenu
  Case Else Call welcome
End Select
%>
<!--#include file=end.asp-->

<%Sub welcome()%>
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td colspan="2" valign=middle height=40> 
      <div align="center"><b><font color=red>操作前请仔细阅读页尾的说明!!!</font></b></div>
    </td>
  </tr>
  <tr> 
    <td colspan="2"> 
      <div align="center"><b>增加栏目</b></div>
    </td>
  </tr>
<form method="post" name="addr" action="<%=thisprog%>?action=addr">
  <tr> 
    <td width="20%">增加根栏目:</td>
    <td> 
      根<input type="text" name="rtype" size="12" maxlength="20">
      主<input type="text" name="mtype" size="12" maxlength="20">
      子<input type="text" name="stype" size="12" maxlength="20">
      <input type="submit" value="增 加">
    </td>
  </tr>
</form>
<form method="post" name="addm" action="<%=thisprog%>?action=addm">
  <tr> 
    <td width="20%">增加主栏目:</td>
    <td>在<%Call selectr()%>增加:
      主<input type="text" name="mtype" size="12" maxlength="20">
      子<input type="text" name="stype" size="12" maxlength="20">
      <input type="submit" value="增 加">
    </td>
  </tr>
</form>
<form method="post" name="adds" action="<%=thisprog%>?action=adds">
  <tr> 
    <td width="20%">增加子栏目:</td>
    <td> 在<%Call selectm()%>中增加子栏目:
      <input type="text" name="stype" size="12" maxlength="20">
      <input type="submit" value="增 加">
    </td>
  </tr>
</form>
  <tr> 
    <td width="20%">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td colspan="2" align="center"><b>修改栏目<b></td>
  </tr>
<form method="post" name="modr" action="<%=thisprog%>?action=modr">
  <tr> 
    <td width="20%">修改根栏目:</td>
    <td><%Call selectr()%>新名称:
      <input type="text" name="rtype" maxlength="20" size="12">
      <input type="submit" value="修 改">
    </td>
  </tr>
</form>
<form method="post" name="modm" action="<%=thisprog%>?action=modm">
  <tr> 
    <td width="20%">修改主栏目:</td>
    <td><%Call selectm()%>新名称:
      <input type="text" name="mtype" size="12" maxlength="20">
      <input type="submit" value="修 改">

    </td>
  </tr>
</form>
<form method="post" name="mods" action="<%=thisprog%>?action=mods">
  <tr> 
    <td width="20%">修改子栏目:</td>
    <td><%Call selects()%>新名称:
      <input type="text" name="stype" size="12" maxlength="20">
      <input type="submit" value="修 改">

    </td>
  </tr>
</form>
  <tr> 
    <td width="20%">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td colspan="2" align="center"><b>删除栏目<font color=red>(删除栏目将删除该栏目下所有下载和文章、以及分类!!!)</font><b></td>
  </tr>
<form method="post" name="delr" action="<%=thisprog%>?action=delr">
  <tr> 
    <td width="20%">删除根栏目:</td>
    <td><%Call selectr()%>
      <input type="submit" value="删 除">
    </td>
  </tr>
</form>
<form method="post" name="delm" action="<%=thisprog%>?action=delm">
  <tr> 
    <td width="20%">删除主栏目:</td>
    <td><%Call selectm()%>
      <input type="submit" value="删 除">
    </td>
  </tr>
</form>
<form method="post" name="dels" action="<%=thisprog%>?action=dels">
  <tr> 
    <td width="20%">删除子栏目:</td>
    <td><%Call selects()%>
      <input type="submit" value="删 除">
    </td>
  </tr>
</form>
</table>
<br><br>
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td>
说明:<br>
增加根栏目同时必需增加一个主栏目和一个子栏目<br>
增加主栏目同时必需增加一个子栏目<br>
各个栏目名称最好不要超过4个汉字,否则下拉菜单中一个栏目可能会有两行
    </td>
  </tr>
</table>
<%End Sub%>

<%Sub Selectr
set rSub=server.createobject("adodb.recordset")
rSub.open "select distinct r,rtype from type order by r asc",conn,1,1
if rSub.eof and rSub.bof then
response.write "请先添加栏目。"
response.end
else
%>
<select name="r">
<%
do while not rSub.eof
%>
<option value="<%=trim(rSub("r"))%>"><%=trim(rSub("rtype"))%></option>
<%
rSub.movenext
loop
end if
rSub.close
%>
</select> 
<%End Sub%>

<%Sub Selectm
set rSub=server.createobject("adodb.recordset")
rSub.open "select distinct m,mtype,rtype from type order by m asc",conn,1,1
if rSub.eof and rSub.bof then
response.write "请先添加栏目。"
response.end
else
%>
<select name="m">
<%
do while not rSub.eof
%>
<option value="<%=trim(rSub("m"))%>"><%=trim(rSub("rtype"))%>-<%=trim(rSub("mtype"))%></option>
<%
rSub.movenext
loop
end if
rSub.close
%>
</select> 
<%End Sub%>

<%Sub Selects
set rSub=server.createobject("adodb.recordset")
rSub.open "select * from type order by s asc",conn,1,1
if rSub.eof and rSub.bof then
response.write "请先添加栏目。"
response.end
else
%>
<select name="s">
<%
do while not rSub.eof
%>
<option value="<%=trim(rSub("s"))%>"><%=trim(rSub("rtype"))%>-<%=trim(rSub("mtype"))%>-<%=trim(rSub("stype"))%></option>
<%
rSub.movenext
loop
end if
rSub.close
%>
</select> 
<%End Sub

Sub saveaddr
if request("rtype")="" then
OutMsg=OutMsg+"<br>"+"<li>请输入根栏目名称。"
founderr=true
end if
if request("mtype")="" then
OutMsg=OutMsg+"<br>"+"<li>请输入主栏目名称。"
founderr=true
end if
if request("stype")="" then
OutMsg=OutMsg+"<br>"+"<li>请输入子栏目名称。"
founderr=true
end if
if founderr=true then Call PrintMsg(OutMsg)
rSub.open "select * from type",conn,1,3
if rSub.eof and rSub.bof then
  rSub.addnew
  rSub("s")=1
  rSub("r")=1
  rSub("m")=1
  rSub("rtype")=request("rtype")
  rSub("mtype")=request("mtype")
  rSub("stype")=request("stype")
else
rSub.close
rSub.open "select rtype from type where rtype like '"&request("rtype")&"'",conn,1,1
if not(rSub.bof and rSub.eof) then
  rSub.close
  Call PrintMsg("不能有两个相同的根栏目,请输入其他根栏目!")
end if
  rSub.close
  rSub.open "select r from type order by r desc",conn,1,1
  rSub.movefirst
  dim tempr
  tempr=rSub("r")
  rSub.close
  rSub.open "select m from type order by m desc",conn,1,1
  rSub.movefirst
  dim tempm
  tempm=rSub("m")
  rSub.close
  rSub.open "select s from type order by s desc",conn,1,1
  rSub.movefirst
  dim temps
  temps=rSub("s")
  rSub.close
  rSub.open "select * from type where id is null",conn,1,3
  rSub.addnew
  rSub("r")=tempr+1
  rSub("m")=tempm+1
  rSub("s")=temps+1
  rSub("rtype")=request("rtype")
  rSub("mtype")=request("mtype")
  rSub("stype")=request("stype")
end if
  rSub.update
  rSub.close
 Call updatemenu
 Call PrintMsg("根栏目添加成功,同时添加一个主栏目和一个子栏目!")
End Sub

Sub saveaddm
if request("mtype")="" then
OutMsg=OutMsg+"<br>"+"<li>请输入主栏目名称。"
founderr=true
end if
if request("stype")="" then
OutMsg=OutMsg+"<br>"+"<li>请输入子栏目名称。"
founderr=true
end if
if founderr=true then Call PrintMsg(OutMsg)
rSub.open "select * from type where r="&request("r")&" and mtype like '"&request("mtype")&"'",conn,1,1
if rSub.bof and rSub.eof then
  rSub.close
  rSub.open "select m from type order by m desc",conn,1,1
  rSub.movefirst
  dim tempm
  tempm=rSub("m")
  rSub.close
  rSub.open "select s from type order by s desc",conn,1,1
  rSub.movefirst
  dim temps
  temps=rSub("s")
  rSub.close
  rSub.open "select * from type where id is null",conn,1,3
  rSub.addnew
  rsclass.open "select rtype from type where r="&request("r"),conn,1,1
  rSub("rtype")=rsclass("rtype")
  rsclass.close
  rSub("r")=request("r")
  rSub("m")=tempm+1
  rSub("s")=temps+1
  rSub("mtype")=request("mtype")
  rSub("stype")=request("stype")
  rSub.update
  rSub.close
Call updatemenu
  Call PrintMsg("主栏目添加成功,同时添加一个子栏目!")
else
  rSub.close
  Call PrintMsg("一个根栏目中不能有两个相同的主栏目,请输入其他主栏目!")

⌨️ 快捷键说明

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