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

📄 admin_class.asp

📁 俄罗斯方块源码 俄罗斯方块源码 俄罗斯方块源码
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%
if session("admin")="" then
  response.redirect "admin_login.asp"
end if

'00 分类管理
if not checkflag("00") then
  call mb("对不起,您没有Flash分类管理的权限!","",0)
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>分类管理</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>

<body leftmargin="5" topmargin="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#000000" vspace="0" hspace="0">
  <tr bgcolor="#EFEBEF"> 
    <td height="27"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="86%"><font color="#FF3000">.:: 您可以在这里进行[Flash分类管理]相关操作</font></td>
          <td width="14%" height="20" align="center"><a href="javascript:this.location.reload()"><img src="images/refresh.gif" alt="刷新" width="40" height="12" border="0"></a></td>
        </tr>
      </table></td>
  </tr>
  <tr > 
    <td height="1" bgcolor="#000000"></td>
  </tr>
</table>
<table width="600" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
  <tr>
    <td width="156">&nbsp;</td>
    <td width="441">
<%
dim nsort,nsortn,class_an,action
'tit=vbcrlf & "<a href='?nsort=joke'>笑话分类</a>&nbsp;┋&nbsp;" & _
    'vbcrlf & "<a href='?nsort=sj'>手机分类</a>&nbsp;┋&nbsp;" & _
    'vbcrlf & "<a href='?nsort=down'>下载分类</a>&nbsp;┋&nbsp;" & _
    'vbcrlf & "<a href='?nsort=flash'>FLASH分类</a>&nbsp;┋&nbsp;" & _
    'vbcrlf & "<a href='?nsort=pro'>产品分类</a>&nbsp;┋&nbsp;" & _
    'vbcrlf & "<a href='?nsort=news'>动态分类</a>&nbsp;┋&nbsp;" & _
    'vbcrlf & "<a href='?nsort=gall'>图库分类</a>&nbsp;┋&nbsp;" & _
   ' vbcrlf & "<a href='?nsort=busin'>交易分类</a>&nbsp;┋&nbsp;" & _
    'vbcrlf & "<a href='?nsort=web'>网站分类</a>"
nsort=trim(request.querystring("nsort"))
action=trim(request.querystring("action"))
select case nsort
case "flash"
  nsortn="Flash分类"
case else
  nsort="flash"
  nsortn="Flash分类"
end select

select case action
case "up","down"
  class_an="分类排序"
  call class_order()
case "del"
  class_an="分类删除"
  call class_del()
case "list"
  class_an="分类查看"
  call class_list()
case "addc"
  class_an="添加一级分类"
  call class_addc()
case "adds"
  class_an="添加二级分类"
  call class_adds()
case "editc"
  class_an="修改一级分类"
  call class_editc()
case "edits"
  class_an="修改二级分类"
  call class_edits()
case else
  class_an="分类查看"
  call class_main()
end select
%>&nbsp;</td>
  </tr>
</table>
</body>
</html>
<%
sub class_list()
  dim i,j,bigclassid,sql2,rs2:i=1
  sql="select bigclassid from bigclass where nsort='"&nsort&"' order by b_order,bigclassid"
  set rs=conn.execute(sql)
  do while not rs.eof
    bigclassid=rs(0):j=1
    conn.execute("update bigclass set b_order="&i&" where bigclassid="&bigclassid)
    sql2="select smallclassid from smallclass where bigclassid="&bigclassid&" order by s_order,smallclassid"
    set rs2=conn.execute(sql2)
    do while not rs2.eof
      conn.execute("update smallclass set s_order="&j&" where smallclassid="&rs2(0))
      rs2.movenext
      j=j+1
    loop
    rs2.close
    rs.movenext
    i=i+1
  loop
  rs.close:set rs=nothing:set rs2=nothing
  call class_main()
end sub

sub class_del()
  dim bigclassid,smallclassid
  bigclassid=trim(request.querystring("bigclassid")):smallclassid=trim(request.querystring("smallclassid"))
  if not(isnumeric(bigclassid)) and not(isnumeric(smallclassid)) then call class_main():exit sub
  if isnumeric(bigclassid) then smallclassid=""
  if smallclassid="" then
    sql="delete from bigclass where bigclassid="&bigclassid
    conn.execute(sql)
    sql="delete from smallclass where bigclassid="&bigclassid
    conn.execute(sql)
  else
    sql="delete from smallclass where smallclassid="&smallclassid
    conn.execute(sql)
  end if
  call class_main()
end sub

sub class_order()
  dim bigclassid,smallclassid,nid,t1,t11,t2,t22,sqladd:sqladd=""
  bigclassid=trim(request.querystring("bigclassid")):smallclassid=trim(request.querystring("smallclassid"))
  if not(isnumeric(bigclassid)) and not(isnumeric(smallclassid)) then call class_main():exit sub
  if isnumeric(bigclassid) then smallclassid=""
  if action="up" then sqladd=" desc"
  if smallclassid="" then
    t1=int(bigclassid)
    sql="select bigclassid,b_order from bigclass where nsort='"&nsort&"' order by b_order"&sqladd&",bigclassid"&sqladd
    set rs=conn.execute(sql)
    do while not rs.eof
      nid=int(rs(0))
      if int(bigclassid)=nid then
        t22=rs(1)
        rs.movenext
        if rs.eof then exit do
        t2=rs(0):t11=rs(1)
        conn.execute("update bigclass set b_order="&t11&" where bigclassid="&t1)
        conn.execute("update bigclass set b_order="&t22&" where bigclassid="&t2)
        exit do
      end if
      rs.movenext
    loop
    
rs.close:set rs=nothing
  else
    t1=int(smallclassid)
    sql="select smallclass.bigclassid from bigclass inner join smallclass on bigclass.bigclassid=smallclass.bigclassid where smallclass.smallclassid="&smallclassid
    set rs=conn.execute(sql)
    if rs.eof and rs.bof then
      rs.close:set rs=nothing
      call class_main():exit sub
    end if
    bigclassid=int(rs(0))
    
rs.close
    sql="select smallclassid,s_order from smallclass where bigclassid="&bigclassid&" order by s_order"&sqladd&",smallclassid"&sqladd
    set rs=conn.execute(sql)
    do while not rs.eof
      nid=int(rs(0))
      if int(smallclassid)=nid then
        t22=rs(1)
        rs.movenext
        if rs.eof then exit do
        t2=rs(0):t11=rs(1)
        conn.execute("update smallclass set s_order="&t11&" where smallclassid="&t1)
        conn.execute("update smallclass set s_order="&t22&" where smallclassid="&t2)
        exit do
      end if
      rs.movenext
    loop
    
rs.close:set rs=nothing
  end if
  call class_main()
end sub

sub class_editc()
  dim bigclassname,bigclassid,folder
  bigclassid=trim(request.querystring("bigclassid"))
  if not(isnumeric(bigclassid)) then call class_main():exit sub
  sql="select bigclassname,folder from bigclass where nsort='"&nsort&"' and bigclassid="&bigclassid
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,1,3
  if rs.eof and rs.bof then
    rs.close:set rs=nothing
    call class_main():exit sub
  end if
  response.write class_tit()&"<table border=1 width=350 cellspacing=0 cellpadding=2 bordercolorlight=#C0C0C0 bordercolordark=#FFFFFF>"
  if trim(request.querystring("edit"))="ok" then
    response.write vbcrlf&"<tr><td height=100 align=center>"
    bigclassname=checkstr(trim(request.form("bigclassname")))
	folder=checkstr(trim(request.form("folder")))
    if bigclassname="" or len(bigclassname)>16 then
      call mb("一级分类名称不能为空(长度不大于16)!","",0)
	end if
	
	if folder="" or len(folder)>50 then
	  call mb("文件夹名称不能为空(长度不大于50)!","",0)
	end if
      rs("bigclassname")=bigclassname
	  rs("folder")=folder
      rs.update
	  
	  '更新Flash列表的folder字段
	  conn.execute("update flash set folder='"&folder&"' where bigclassid="&bigclassid&" and folder<>''")
      call mb("修改一级分类成功!","admin_class.asp?nsort="&nsort,1)
    response.write vbcrlf&"</td></tr>"
  else
%>
<form action='?nsort=<% response.write nsort %>&action=editc&bigclassid=<% response.write bigclassid %>&edit=ok' method=post>
<tr height=25 >
<td align=center>一级分类名称:</td>
<td><input type=text name=bigclassname value='<% response.write rs(0) %>' size=30 maxlength=16 class='input'></td>
</tr>
<tr height=25 >
<td align=center>文 件 夹名称:</td>
<td><input type=text name=folder value='<% response.write rs(1) %>' size=30 maxlength=50 class='input'></td>
</tr>
<tr><td colspan=2 height=30 align=center><input type=submit value='修改一级分类' class='button'></td></tr>
</form>
<%
end if

⌨️ 快捷键说明

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