<%@ page contentType="text/html;charset=gb2312" %>
<%@ page language="java" %>
<%@ page import="java.sql.*" %>
<%--//&Eacute;è&Ouml;&Atilde;session&pound;&not;&Igrave;á&sup1;&copy;&Oacute;&Atilde;&raquo;§&micro;&Ccedil;&Acirc;&frac12;&frac12;&Oacute;&iquest;&Uacute;
//session.setAttribute("userName","dxd");
//topMenu=(String)session.getAttribute("userName");
--%>
<%
String topMenu;
String sDBDriver="sun.jdbc.odbc.JdbcOdbcDriver";
try
{
Class.forName(sDBDriver);
}
catch(java.lang.ClassNotFoundException e)
{
System.err.println(e.getMessage());
}
%>
<%!
public ResultSet executeQuery(String sql)
{
String sConnStr="jdbc
dbc:tree";
String user="dir";
String password="dir";
Connection conn=null;
ResultSet rs=null;
rs=null;
try
{
conn=DriverManager.getConnection(sConnStr,user,password);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
rs=stmt.executeQuery(sql);
}
catch(SQLException ex)
{
System.err.println(ex.getMessage());
}
return rs;
}
%>
<html>
<head>
<title>&Ecirc;÷×&acute;&sup2;&Euml;&micro;&yen;
</title>
<style><!--
A:link {text-decoration:none}
A:visited {text-decoration:none}
A:hover {color:#99CCFF;text-decoration:none}
-->
</style>
<script LANGUAGE="JavaScript">
<!--
//&Atilde;&iquest;&cedil;&ouml;&frac12;&Uacute;&micro;&atilde;&Oacute;&ETH;&Ograve;&raquo;&cedil;&ouml;&Ecirc;&yacute;×é,°ü&ordm;&not;
4+n&cedil;&ouml;&Ocirc;&ordf;&Euml;&Oslash;
// node[0]&Icirc;&ordf;0/1 &para;&Ocirc;&Oacute;&brvbar;&frac12;&Uacute;&micro;&atilde;&micro;&Auml;&Otilde;&sup1;&iquest;&ordf;/&sup1;&Oslash;±&Otilde;
// node[1]&Icirc;&ordf;0/1 &para;&Ocirc;&Oacute;&brvbar;&Icirc;&Auml;&frac14;&thorn;&frac14;&ETH;&micro;&Auml;&sup1;&Oslash;±&Otilde;/&Otilde;&sup1;&iquest;&ordf;
// node[2]&Icirc;&ordf;1 &Egrave;&ccedil;&sup1;&ucirc;&frac12;&Uacute;&micro;&atilde;&micro;&Auml;×&Oacute;&frac12;&Uacute;&micro;&atilde;&Ecirc;&Ccedil;&Icirc;&Auml;&micro;&micro;
// node[3]&Ecirc;&Ccedil;&frac12;&Uacute;&micro;&atilde;&micro;&Auml;&Atilde;&ucirc;&sup3;&AElig;
// node[4]...node[4+n]&Icirc;&ordf;n&cedil;&ouml;×&Oacute;&frac12;&Uacute;&micro;&atilde;
// &sup3;&otilde;&Ecirc;&frac14;&raquo;&macr;&sup2;&Euml;&micro;&yen;&micro;&Auml;&Ecirc;&yacute;&frac34;&Yacute;
function generateTree()
{
var aux1, aux2, aux3, aux4
foldersTree = folderNode("&Icirc;&Ograve;&micro;&Auml;&Iacute;&oslash;&Otilde;&frac34;")
<%
//menu_id,menu_name,parent_menu_id,folder_or_file,menu_location
String sql="select * from tree_menu ";
ResultSet RS;
RS=executeQuery(sql);
System.out.println(sql);
try
{
while(RS.next())
{
String foldersTree;
int id=RS.getInt("menu_id");
System.out.println(id);
int loc=RS.getInt("menu_location");
int folder_or_file=RS.getInt("folder_or_file");
if(loc==1){
foldersTree="foldersTree";
}else
{
foldersTree="aux"+(int)(loc-1);
}
//&Aacute;&not;&frac12;&Oacute;
if(folder_or_file==1){
out.println("aux"+loc+" = appendChild("+foldersTree+", folderNode('<a href=main.jsp?menuid="+id+"&loc="+loc+" target=folderFrame>"+RS.getString("menu_name")+"</a>'));");
}else
{
out.println("appendChild("+foldersTree+", generateDocEntry(0, '"+RS.getString("menu_name")+"', 'sample1.htm', ''));");
}
}
}
catch(Exception e)
{
out.println(e.toString());
}
%>
}
// &acute;&acute;&frac12;¨&frac12;&Uacute;&micro;&atilde;&micro;&Auml;&cedil;¨&Ouml;ú&ordm;&macr;&Ecirc;&yacute;
function folderNode(name)
{
var arrayAux
arrayAux = new Array
arrayAux[0] = 0
arrayAux[1] = 0
arrayAux[2] = 0
arrayAux[3] = name
return arrayAux
}
function leafNode(name)
{
var arrayAux
arrayAux = new Array
arrayAux[0] = 0
arrayAux[1] = 0
arrayAux[2] = 1
arrayAux[3] = name
return arrayAux
}
function appendChild(parent, child)
{
parent[parent.length] = child
return child
}
function generateDocEntry(icon,do
cDescription, link)
{
var retString =""
if (icon==0)
retString = "<A href='"+link+"' target=folderFrame><img src='doc.gif' alt='&Ocirc;&Uacute;&Oacute;&Ograve;±&szlig;&iquest;ò&frac14;&Uuml;&Ouml;&ETH;&acute;ò&iquest;&ordf;'"
else
retString = "<A href='"+link+"' target=_blank><img src='link.gif' alt='&Ocirc;&Uacute;&ETH;&Acirc;&acute;°&iquest;&Uacute;&Ouml;&ETH;&acute;ò&iquest;&ordf;'"
retString = retString + " border=0></a><td nowrap><font style='font-size:9pt;font-family:&Euml;&Icirc;&Igrave;&aring;'>" +do
cDescription + "</font>"
return retString
}
//&Euml;&cent;&ETH;&Acirc;&Ecirc;÷×&acute;&sup2;&Euml;&micro;&yen;
function redrawTree()
{
vardo
c = top.treeFrame.window.document
doc.clear()
doc.write("<body bgcolor='white'>")
redrawNode(foldersTree,do
c, 0, 1, "")
doc.close()
}
function redrawNode(foldersNode,do
c, level, lastNode, leftSide)
{
var j=0
var i=0
doc.write("<table border=0 cellspacing=0 cellpadding=0>")
doc.write("<tr><td valign = middle nowrap>")
doc.write(leftSide)
if (level>0)
if (lastNode) //'brother'×&Oacute;&frac12;&Uacute;&micro;&atilde;&Ecirc;&yacute;×é&Ouml;&ETH;&Oacute;&ETH;·&ntilde;&ETH;&Ouml;&micro;&Uuml;&frac12;&Uacute;&micro;&atilde;
{
doc.write("<img src='lastnode.gif' width=16 height=22>")
leftSide = leftSide + "<img src='blank.gif' width=16 height=22>"
}
else
{
doc.write("<img src='node.gif' width=16 height=22>")
leftSide = leftSide + "<img src='vertline.gif' width=16 height=22>"
}
displayIconAndLabel(foldersNode,do
c)
doc.write("</table>")
if (foldersNode.length > 4 &&
foldersNode[0]) //&Oacute;&ETH;&cedil;ü&micro;&Iacute;&sup2;&atilde;&micro;&Auml;&frac12;&Uacute;&micro;&atilde;&ordm;&Iacute;&Icirc;&Auml;&frac14;&thorn;&frac14;&ETH;&Otilde;&sup1;&iquest;&ordf;×&Aring;
{
if (!foldersNode[2])//&acute;&oslash;&Icirc;&Auml;&frac14;&thorn;&frac14;&ETH;&micro;&Auml;&Icirc;&Auml;&frac14;&thorn;&frac14;&ETH;
{
level=level+1
for (i=4;
i<foldersNode.length;i++)
if (i==foldersNode.length-1)
redrawNode(foldersNode
,do
c, level, 1, leftSide)
else
redrawNode(foldersNode,do
c, level, 0, leftSide)
}
else
//&acute;&oslash;&Icirc;&Auml;&micro;&micro;&micro;&Auml;&Icirc;&Auml;&frac14;&thorn;&frac14;&ETH;
{
for (i=4;
i<foldersNode.length;i++)
{
doc.write("<table border=0 cellspacing=0 cellpadding=0 valign=center>")
doc.write("<tr><td nowrap>")
doc.write(leftSide)
if (i==foldersNode.length - 1)
doc.write("<img src='lastnode.gif' width=16 height=22>")
else
doc.write("<img src='node.gif' width=16 height=22>")
doc.write(foldersNode)
doc.write("</table>")
}
}
}
}
function displayIconAndLabel(foldersNode,do
c)
{
doc.write("<A href='javascript:top.openBranch(/"" + foldersNode[3] + "/")'><img src=")
if (foldersNode[1])
doc.write("openfolder.gif width=24 height=22 border=noborder></a>")
else
doc.write("closedfolder.gif width=24 height=22 border=noborder></a>")
doc.write("<td valign=middle align=left nowrap>")
doc.write("<font style='font-size:9pt;font-family:&Euml;&Icirc;&Igrave;&aring;'>"+foldersNode[3]+"</font>")
}
//&Ecirc;÷&Ecirc;&Otilde;&Acirc;&pound;&Ecirc;±&micro;÷&Oacute;&Atilde;&micro;&Auml;&ordm;&macr;&Ecirc;&yacute;
//&micro;±&cedil;&cedil;&frac12;&Uacute;&micro;&atilde;&sup1;&Oslash;±&Otilde;,&AElig;&auml;&Euml;ù&Oacute;&ETH;&micro;&Auml;×&Oacute;&frac12;&Uacute;&micro;&atilde;&Ograve;&sup2;&para;&frac14;±&Otilde;&ordm;&Iuml;
function closeFolders(foldersNode)
{
var i=0
if (!foldersNode[2])
{
for (i=4;
i< foldersNode.length;
i++)
closeFolders(foldersNode)
}
foldersNode[0] = 0
foldersNode[1] = 0
}
//&Ecirc;&Otilde;&Acirc;&pound;&frac12;&Uacute;&micro;&atilde;
function clickOnFolderRec(foldersNode, folderName)
{
var i=0
if (foldersNode[3] == folderName)
{
if (foldersNode[0])
closeFolders(foldersNode)
else
{
foldersNode[0] = 1
foldersNode[1] = 1
}
}
else
{
if (!foldersNode[2])
for (i=4;
i< foldersNode.length;
i++)
clickOnFolderRec(foldersNode, folderName)
}
}
//&acute;ò&iquest;&ordf;·&Ouml;&Ouml;§
function openBranch(branchName)
{
clickOnFolderRec(foldersTree, branchName)
if (branchName=="Start folder" &&
foldersTree[0]==0)
top.folderFrame.location="basefolder.htm"
timeOutId = setTimeout("redrawTree()",100)
}
//&Ograve;&sup3;&Atilde;&aelig;&Ocirc;&Oslash;&Egrave;&euml;&Ecirc;±&micro;&Auml;&sup3;&otilde;&Ecirc;&frac14;&raquo;&macr;
function initializeTree()
{
generateTree()
redrawTree()
}
var foldersTree = 0
var timeOutId = 0
generateTree()
-->
</script>
</HEAD>
<FRAMESET cols="200,*" onLoad='initializeTree()'>
<FRAME src="BASETREE.HTM" name="treeFrame">
<FRAME SRC="basefolder.htm" name="folderFrame">
</FRAMESET><noframes></noframes>
</HTML>