📄 menu.asp
字号:
<%@LANGUAGE="JAVASCRIPT" codepage="936"%>
<!--#include file="conn.asp" -->
<%
Response.CacheControl = "no-cache"
%>
<%
function ShowId(id,parentid,name){//显示
var rssort = Server.CreateObject("ADODB.Recordset");
rssort.ActiveConnection = MM_fsyuxidata_STRING;
rssort.Source = "SELECT * FROM ClassTree where followid="+id;
//判断是否是最后一级(检索数据库查看时候还有子节点)
rssort.CursorType = 3;
rssort.CursorLocation = 3;
rssort.LockType = 3;
rssort.Open();
if(rssort.RecordCount==0){//判断是否是最后一级,如果是最后一级则显示树的最后一级(insdoc),否则继续展开(insFld)
var strOutput1 = "insDoc(ax"+parentid+", gLnk (0,'"+name+"','product.asp?id="+id+"','ftv2doc.gif'));";
Response.Write(strOutput1);
}
else{
var strOutput1 = "ax"+id+"=insFld(ax"+parentid+", gFld ('"+name+"','product.asp?id="+id+"','ftv2folderopen.gif', 'ftv2folderclosed.gif'));";
Response.Write(strOutput1);
}
rssort.close();
}
function ShowTopic(){//初始tree
var rsreply = Server.CreateObject("ADODB.Recordset");
rsreply.ActiveConnection = MM_fsyuxidata_STRING;
rsreply.Source = "SELECT * FROM ClassTree";
rsreply.CursorType = 3;
rsreply.CursorLocation = 3;
rsreply.LockType = 3;
rsreply.Open();
ShowChieldren(rsreply,0,0);
rsreply.Close();
}
function ShowChieldren(rsreply,iParentId,iPreviousFilter){//取子节点,形成递归
var iCurrentLocation;
rsreply.Filter = " followid = '" + iParentId+"'";
if(rsreply.RecordCount!=0){
if(!rsreply.BOF) rsreply.MoveFirst();
while(!rsreply.EOF){
ShowId(rsreply.Fields.Item("id").value,rsreply.Fields.Item("followid").value,rsreply.Fields.Item("classname").value);
iCurrentLocation = rsreply.AbsolutePosition;
ShowChieldren(rsreply,rsreply.Fields.Item("id").Value,rsreply.Filter);
//循环内调用自身取符合Filter的记录
rsreply.AbsolutePosition = iCurrentLocation;
rsreply.MoveNext();
}
}
rsreply.Filter = iPreviousFilter;
}
%>
<HTML><HEAD><TITLE>--树型菜单--</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<!--mstheme-->
<style type=text/css>
body {font-size:12px }
a:hover { font-size:12px; color: #000000; text-decoration: none }
a:visited { font-size:12px; color: #000000; text-decoration: none}
a:active { font-size:12px; color: #000000; text-decoration: none}
a:link { font-size:12px; color: #000000; text-decoration: none}
</style>
<SCRIPT src="tree.js" type="text/javascript"></script>
</HEAD>
<BODY topmargin=0 leftmargin=0>
<DIV align=left>
<TABLE height=100% border=0 cellpadding="0" cellspacing="0" bgcolor=#FFFFFF>
<TR>
<TD Width=7 bgcolor=#739ADE valign=top></TD>
<TD Width=180 bgcolor=#739ADE valign=top><br>
<p align=center><a href="admin/admin_menu.asp?menu=main"><font color=red>进入管理</font></a></p>
<script>
ax0 = gFld("功能菜单","#");
<%
ShowTopic();
%>
initializeDocument();
</script>
</TD>
</TR>
</TABLE>
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -