<% dim cls if session("admin")="" then Response.Redirect("index.asp?err=4") else if session("flag")<>"0" then cls = Instr(session("flag"), "case") if cls <= 0 then %> <% end if end if end if %> 管理中心——>案例管理
当前位置: 网站管理中心--案例管理 列表管理 | 类别管理 <% if v<>1 then %> | 批量复制<% end if %>
<% if request("gb")<>"" then gb=request("gb") end if Select Case request("action") Case "AddClass" Call AddClass() Case "EditClass" Call EditClass() Case "DelClass" Call DelClass() Case "SaveClass" Call SaveClass() Case Else Call pclassList() End Select Call CloseConn() %> <% '--------------------------------类别列表sub-------------------- Sub pclassList() %> <% if v<>1 then %> <% end if %> <% '-------------------------------主要列表代码开始----------------------------------------------- dim first dim i set rs=server.CreateObject("adodb.recordset") sql="select * from cclass where parentid=0 and gb='"&gb&"' order by orders asc" rs.open sql,conn,3,1 if rs.eof then response.Write("暂时没有分类") response.End end if first=rs.GetRows() 'GetRows的作用是将数据集输出到一数组中 rs.close set rs=nothing if(ubound(first,1)<0) then response.Write("暂时没有分类") end if for i=0 to ubound(first,2) response.Write("") response.Write(Downasp.getcatalogs(first(0,i),"")) next '------------------------------主要列表代码结束---------------------------------------- %>
';" value="<%= lang_1 %>"> ';" value="<%= lang_2 %>">
编号 类别列表 添加大类
"&first(4,i)&" "&first(1,i)&"添加 编辑 删除
<% End Sub '------------------------------类别列表sub结束---------------------------------------- %> <% '----------------------------添加类别sub开始----------------------------------------- Sub AddClass() %>
添加类别
类别序号: *必须是数字,同级目录序号不能重复
语言种类:
类别名称:
所属类别:
 
<% End Sub '-----------------------------添加类别sub结束---------------------------------------- %> <% '--------------------------编辑类别sub代码开始--------------------------------------- Sub EditClass() If Request("editid")<>"" then If Downasp.IsValidStr(Request("ClassName")) = False Then Errmsg = "类别名称中含有非法字符。" Downasp.ShowMsg(Errmsg) Downasp.Back(-1) Response.End() End If '修改类别名称 conn.execute("update cclass set classname='"&Trim(Request("ClassName"))&"',parentid="&Request("ParentID")&",orders="&Request("Orders")&" where id="&Request("editid")&"") '修改产品中记录的对应的类别名称&编号 conn.execute("update CaseMain set gbcode='"&Trim(Request("ClassName"))&"' where gbseq='"&Request("editid")&"'") Downasp.ShowMsg("修改成功。") Downasp.GotoUrl("admin_caseclass.asp?gb="&request("gb")&"") Response.End() End If set rs = conn.execute("select * from cclass where id="&Request("ID")&"") if not rs.eof then classname = rs(1) classid = rs(0) parentid = rs(2) orders =rs(4) end if rs.close set rs = nothing %>
编辑类别:
类别序号: *必须是数字,同级目录序号不能重复
类别名称:
所属类别:
">
 
<% End Sub '--------------------------------编辑类别sub代码结束--------------------------------- %> <% '---------------------------------保存修改和编辑类别的sub开始--------------------------- Sub SaveClass() If Downasp.IsValidStr(Request("ClassName")) = False Then Errmsg = "类别名称中含有非法字符。" Downasp.ShowMsg(Errmsg) Downasp.Back(-1) Response.End() End If conn.execute("insert into cclass(classname,parentid,orders,gb) values('"+Trim(Request("ClassName"))+"','"+Request("ParentID")+"','"+Request("Orders")+"','"+Request("gb")+"')") Response.Redirect("admin_caseclass.asp?gb="&request("gb")&"") End Sub '------------------------------保存修改和编辑类别的sub结束------------------------------ %> <% '------------------------------------删除类别sub开始------------------------------------ Sub DelClass() Dim classID,ID ID = Request("ParentID") classID = ID & "," & Downasp.selectclass(ID) classID = Replace(classID,",,",",") if right(classID,1) = "," Then classID = left(classID,len(classID)-1) if left(classID,1) = "," Then classID = right(classID,len(classID)-1) '查找是否有下级类别 'set rs = conn.execute("select * from pclass where ParentID="&Request("ParentID")&"") 'If not rs.eof then 'Downasp.ShowMsg("请先删除下级类别。") 'Downasp.Back(-1) 'Response.End() 'End IF 'rs.close 'set rs = nothing '删除类别 conn.execute("Delete from cclass where id in ("&classID&")") '删除相关资源 '待定,未完成 '------------ Response.Redirect("admin_caseclass.asp") End Sub '-----------------------------删除类别sub结束-------------------------- %>