请各位帅哥美女帮帮忙
<!--#include file="../Inc/conn.asp"--><%
Rem ClassType 内容类型,-1显示所有分类
ClassType=(Request("Type"),0)
Dim SqlType,SqlType1,SqlType2
If ClassType>-1 Then SqlType=" and type="&ClassType&" " :SqlType1="&&@type="&ClassType&" " :SqlType2="type="&ClassType&" " Else SqlType2="type=-1 "%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>管理栏目</title>
<link href="skings/css1/css.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
function checkall(form) {
var c = 'abc';
if(document.getElementById('ID')){
for(var e = 0; e < form.elements.length; e++) {
if (form.elements[e].name=="ID") {var v = form.elements[e];
v.checked = form.elements[c].checked;
}}}}
function checkall2(form) {
if(document.getElementById('ID')){
for(var e = 0; e < form.elements.length; e++) {
if (form.elements[e].name=="ID") {var v = form.elements[e];
if(v.checked){v.checked=false;}
else{v.checked=true;}
}}}}
//-->
</script>
</head>
<body>
<% Dim IID,RIID
If action="del" and (ID,0)>0 Then
ID=ChildNode(ID,ClassIDCache.documentElement.selectSingleNode("ClassID[@id="&ID&"]/@type").text) Rem 捕获子栏目,删除ID本身及所有子分类
Execute"Update ["&NetTable&"ClassID] Set ok=0 Where del<>1 and id in("&ID&")"
WriteLog "删除栏目<font color=red>"&Left(Net.HTMLEncode(Trim(Request.Form("title"))),50)&"(ID:"&ID&")</font>成功!"
Server.Execute("cache.asp"):Response.Redirect("?"&SqlType2)
Response.End()
End If
If Post="post" Then
IID=(Request("IID"),0)
SQL="Select * From ["&NetTable&"ClassID] Where ok=1 and IID="&IID&SqlType
If ID>0 Then SQL="Select * From ["&NetTable&"ClassID] Where ok=1 and IID="&IID&" and ID Not In("&ID&") "&SqlType
Set Rs= ReadRs(SQL,1)
If Rs.RecordCount>0 Then Rs.Close:Response.Write("<script>alert('此栏目ID已存在');history.go(-1);</script>"):Response.End()
SQL="Select * From ["&NetTable&"ClassID] Where (ID IS NULL)"
If Action="edit" and ID>0 Then SQL="Select * From ["&NetTable&"ClassID] Where ok=1 and ID="&ID&SqlType
If ClassID>0 Then If Int(ClassIDCache.documentElement.selectSingleNode("ClassID[@id="&ClassID&"]/@type").text)<>ClassType Then Response.Write("<script>alert('发生未知错误!');history.go(-1);</script>"):response.End()
Set Rs= ReadRs(SQL,3)
If Action="add" Then Rs.AddNew
If Action="edit" and (Rs.Eof OR Rs.Bof) Then Response.Redirect(Net.History):Response.End()
If ClassType<5 or ClassType>6 Then Rs("dh_ok")=(Request.Form("dh_ok"),0) Else Rs("dh_ok")=0
Rs("title")=Left(Net.HTMLEncode(Trim(Request.Form("title"))),50)
Rs("od")=(Request.Form("od"),0)
Rs("title1")=Left(Net.HTMLEncode(Request.Form("title1")),100)
If ClassType=-1 Then
Rs("Type")=(Request.Form("type"),0)
Else
Rs("Type")=ClassType
End If
Rs("ParentID")=(Request.Form("ClassID"),0)
Rs("IID")=IID
Rs("OK")=1
Rs("page")=(Request.Form("pagetype"),0)
Rs("Url")=Left(Net.HTMLEncode(Request.Form("Url")),255)
Rs.Update
If (Request.QueryString("type1"),0)=-1 and Action="edit" Then Execute("Update ["&NetTable&"ClassID] Set Type="&(Request.Form("type"),0)&" Where ID In("&ChildNode(ID,-1)&") ")
If Rs("ParentID")<1 Then
Rs("Path")="0,"&Rs("ID")
Else
Rs("Path")=ClassIDCache.documentElement.selectSingleNode("ClassID[@id="&Rs("ParentID")&"]/@path").text&","&Rs("ID")
End If
Rs.Update
Net.SetCookies "ClassIID",Rs("ID"),""
Rs.Close
Application.Contents.Remove(LCase(Root&"ClassID"))
If Action="add" Then WriteLog "添加栏目<font color=red>"&Left(Net.HTMLEncode(Trim(Request.Form("title"))),50)&"(ID:"&Net.ReadCookies("ClassIID")&")</font>成功!":Response.Write("<script>alert('栏目添加成功');window.location.href='?type="&Request.QueryString("type1")&"';</script>")
If Action="edit" Then WriteLog "编辑栏目<font color=red>"&Left(Net.HTMLEncode(Trim(Request.Form("title"))),50)&"(ID:"&Net.ReadCookies("ClassIID")&")</font>成功!":Response.Write("<script>alert('栏目编辑成功');window.location.href='?type="&Request.QueryString("type1")&"';</script>")
Response.End()
End If
Dim ss
Function ShowClass(ID)
'On Error Resume Next
ss=ss&"├"
For each Node In ClassIDCache.documentElement.selectNodes("ClassID[@parentid="&ID&Trim(SqlType1)&"]")%>
<tr style="font-family: '微软雅黑,Verdana, 新宋体';color:#1E5494;font-size:12px;font-weight:bolder;background:#E4F1FA;line-height: 22px;" onmouseover="this.style.background='#ffffff'" onmouseout="this.style.background='#E4F1FA'">
<td align="center" ><%=Node.selectSingleNode("@id").text %></td>
<td ><%=ss&Node.selectSingleNode("@title").text%></td>
<td ><%=Node.selectSingleNode("@title1").text%></td>
<% If ClassType<0 Then %>
<td align="center" >
<%=ManegeType(Node.selectSingleNode("@type").text) %> </td>
<% End If %>
<td align="center" ><a href="EditClass.asp?action=add&<%=SqlType2 %>&classid=<%= Node.selectSingleNode("@id").text%>">添加子栏目</a> <a href="?action=edit&<%=SqlType2 %>&id=<%= Node.selectSingleNode("@id").text %>">编辑</a> <a href="?action=del&<%=SqlType2 %>&id=<%=Node.selectSingleNode("@id").text %>" onClick="return confirm('确定删除?')">删除</a></td>
</tr>
<%
Set ID=ClassIDCache.documentElement.selectNodes("ClassID[@parentid="&Node.selectSingleNode("@id").text&"]")
If Not(err) Then
Call ShowClass(Node.selectSingleNode("@id").text)
End If
Next
ss=left(ss,len(ss)-1)
End Function
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><a href="?action=add&<%=SqlType2 %>">添加栏目</a> <a href="?<%=SqlType2 %>">管理栏目</a></td>
</tr>
</table>
<% Select Case Action %>
<% Case "add"
If (Request.QueryString("ClassID"),0)>0 Then ClassID=(Request.QueryString("ClassID"),0) Else ClassID=ClassIDCache.documentElement.selectSingleNode("ClassID[@id="&(Request.Cookies("ClassIID"),0)&"]/@parentid").text
'On Error Resume Next
IID=1
RIID=1
For Each Node In ClassIDCache.documentElement.selectNodes("ClassID[@ok=1"&SqlType1&"]")
If Int(Node.selectSingleNode("@iid").text)>=Int(IID) Then IID=Int(Node.selectSingleNode("@iid").text)+1
If Int(Node.selectSingleNode("@od").text)>=Int(RIID) and Int(Node.selectSingleNode("@parentid").text)=Int(ClassID) Then RIID=Int(Node.selectSingleNode("@od").text)+1
Next
Err.Clear
%>
<form id="form1" name="form1" method="post" action="?action=add&type1=<%= ClassType %>">
<table width="75%" border="0" align="center" cellpadding="0" cellspacing="1" class="table">
<tr>
<td colspan="2" align="center" class="bg_tr">添加栏目</td>
</tr>
<tr>
<td class="bg_tr">序号</td>
<td class="bg_tr"><input name="iid" type="text" id="iid" value="<%= IID %>" size="4" maxlength="4" runat="server" onkeyup="value=value.replace(/[^\d]/g,'')"/>
<% If ClassType>-1 Then %>
<input name="Type" type="hidden" id="Type" value="<%= ClassType %>" />
<% End If %>
</td>
</tr>
<tr>
<td class="bg_tr">栏目名称</td>
<td class="bg_tr"><input name="title" type="text" id="title" maxlength="50" /></td>
</tr>
<tr>
<td class="bg_tr">英文名称</td>
<td class="bg_tr"><input name="title1" type="text" id="title1" size="50" maxlength="100" /></td>
</tr>
<tr>
<td class="bg_tr">所属栏目</td>
<td class="bg_tr"><select name="ClassID" id="ClassID">
<option value="0" selected="selected">一级栏目</option>
<% Select Case ClassType
Case -1
Response.Write(Replace(LCase(SelectClass(0,ClassID,ClassType,"","","")),"disabled='disabled'",""))
Case Else
Response.Write(Replace(LCase(SelectClass(0,ClassID,ClassType,"&&@parentid!="&ClassID,"","")),"disabled='disabled'",""))
End Select
%>
</select> </td>
</tr>
<% If Not(ClassType=5 or ClassType=6) Then %>
<tr>
<td class="bg_tr">导航显示</td>
<td class="bg_tr"><input type="radio" name="dh_ok" value="1" />
显示
<input name="dh_ok" type="radio" value="0" checked="checked" />
不显示</td>
</tr>
<% End If %>
<tr>
<td class="bg_tr">栏目排序</td>
<td class="bg_tr"><input name="od" type="text" id="od" value="<%= RIID %>" size="4" maxlength="4" runat="server" onkeyup="value=value.replace(/[^\d]/g,'')"/></td>
</tr>
<% If Not(ClassType=5 or ClassType=6) Then %>
<tr>
<td class="bg_tr">显示方式</td>
<td class="bg_tr"><input name="PageType" type="radio" value="0" checked="checked" />
多页
<input name="PageType" type="radio" value="1" />
单页</td>
</tr>
<% End If %>
<tr>
<td class="bg_tr">外部链接</td>
<td class="bg_tr"><input name="URL" type="text" id="URL" size="50" maxlength="255" />
(内部栏目不用管填写)</td>
</tr>
<% If ClassType=-1 Then %>
<tr>
<td class="bg_tr">栏目类型</td>
<td class="bg_tr">
<% For i=0 To Ubound(ManegeType)
If ManegeType(i)<>"" Then%>
<input name="type" type="radio" value="<%= i %>" <% If i=0 Then Response.Write("checked='checked'") %>/><%= ManegeType(i) %>
<%End If
Next %>
</td>
</tr>
<% End If %>
<tr>
<td class="bg_tr"> </td>
<td class="bg_tr"><input type="submit" name="Submit" value="添加" /></td>
</tr>
</table>
</form>
<% Case "edit"
ID=(request("ID"),0)
If ID<1 Then response.Redirect("?"):Response.End()
Set Rs= ReadRs("Select * From ["&NetTable&"ClassID] Where ok=1 "&SqlType&" and ID="&ID,1)
If Rs.Eof Or Rs.Bof Then response.Redirect("?"&SqlType2):Response.End()
%>
<form id="form1" name="form1" method="post" action="?action=edit&type1=<%= ClassType %>">
<table width="60%" border="0" align="center" cellpadding="0" cellspacing="1" class="table">
<tr>
<td colspan="2" align="center" class="bg_tr"><input name="id" type="hidden" id="id" value="<%= ID %>" />
编辑栏目</td>
</tr>
<tr>
<td class="bg_tr">序号</td>
<td class="bg_tr"><input name="iid" type="text" id="iid" value="<%= Rs("iid") %>" size="4" maxlength="4" runat="server" onkeyup="value=value.replace(/[^\d]/g,'')"/>
<% If ClassType>-1 Then %>
<input name="Type" type="hidden" id="Type" value="<%=Rs("Type") %>" />
<% End If %></td>
</tr>
<tr>
<td class="bg_tr">栏目名称</td>
<td class="bg_tr"><input name="title" type="text" id="title" value="<%= Rs("title") %>" maxlength="50" /></td>
</tr>
<tr>
<td class="bg_tr">英文名称</td>
<td class="bg_tr"><input name="title1" type="text" id="title1" value="<%= Rs("title1") %>" size="50" maxlength="100" /></td>
</tr>
<tr>
<td class="bg_tr">所属栏目</td>
<td class="bg_tr"><select name="ClassID" id="ClassID">
<option value="0" selected="selected">一级栏目</option>
<%= Replace(LCase(SelectClass(0,Int(ClassIDCache.documentElement.selectSingleNode("ClassID[@id="&ID&"]/@parentid").text),ClassType,"&&@id!="&ID,"","")),"disabled='disabled'","") %>
</select></td>
</tr>
<% If Not(ClassType=5 or ClassType=6) Then %>
<tr>
<td class="bg_tr">导航显示</td>
<td class="bg_tr"><input type="radio" name="dh_ok" value="1" <% If Rs("dh_ok")=1 Then response.Write("checked=""checked""" ) %> />
显示
<input name="dh_ok" type="radio" value="0" <% If Rs("dh_ok")=0 Then response.Write("checked=""checked""" ) %> />
不显示</td>
</tr>
<% End If %>
<tr>
<td class="bg_tr">栏目排序</td>
<td class="bg_tr"><input name="od" type="text" id="od" value="<%= Rs("od") %>" size="4" maxlength="4" runat="server" onkeyup="value=value.replace(/[^\d]/g,'')"/></td>
</tr>
<% If Not(ClassType=5 or ClassType=6) Then %>
<tr>
<td class="bg_tr">显示方式</td>
<td class="bg_tr"><input name="PageType" type="radio" value="0" <% If Rs("Page")=0 Then response.Write("checked=""checked""" ) %>/>
多页
<input name="PageType" type="radio" value="1" <% If Rs("Page")=1 Then response.Write("checked=""checked""" ) %>/>
单页</td>
</tr>
<% End If %>
<tr>
<td class="bg_tr">外部链接</td>
<td class="bg_tr"><input name="URL" type="text" id="URL" value="<%=Rs("URL") %>" size="50" maxlength="255" />
(内部栏目不用管填写)</td>
</tr>
<% If ClassType=-1 Then %>
<tr>
<td class="bg_tr">栏目类型</td>
<td class="bg_tr">
<% For i=0 To Ubound(ManegeType)
If ManegeType(i)<>"" Then%>
<input name="type" type="radio" value="<%= i %>" <% If i=Rs("type") Then Response.Write("checked='checked'")%> /><%= ManegeType(i) %>
<%End If
Next %>
</td>
</tr>
<% End If %>
<tr>
<td class="bg_tr"> </td>
<td class="bg_tr"><input type="submit" name="Submit2" value="编辑" /></td>
</tr>
</table>
</form>
<% Case Else%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" class="table">
<tr>
<td width="4%" align="center" class="bg_tr">ID</td>
<td width="35%" align="center" class="bg_tr">栏目名称</td>
<td width="25%" align="center" class="bg_tr">副标题</td>
<% If ClassType<0 Then %>
<td width="15%" align="center" class="bg_tr">类型</td>
<% End If %>
<td width="21%" align="center" class="bg_tr">操作</td>
</tr>
提示:Microsoft VBScript 运行时错误 错误 '800a01a8'
缺少对象: 'documentElement.selectSingleNode(...)'
/admin/EditClass.asp,行 119
这个需要怎么更改
<% Call ShowClass(0) %>
</table>
<% End Select
CloseConn %>
</body>
</html>