<%@ page contentType="text/html; charset=GBK"%>
<%@ page import = "zr.zrpower.common.util.SysPreperty"%>
<%@ page import = "zr.zrpower.entity.sys.SessionUser"%>
<%@ page import = "zr.zrpower.entity.sys.BPIP_MENU"%>
<%@ page import = "zr.zrpower.ejb.sys.SecurityService" %>

<HTML>
<%
SessionUser user = (SessionUser)session.getAttribute("userinfo");

BPIP_MENU[] menu = null;
SecurityService MenuService =new SecurityService();
menu = MenuService.GetMenuList(" order by MNCODE,MENUNO");

String strCode = "";
String strFCode = "";
String strName = "";
String Showdata = "";
String strPageName = "Left.jsp";

//得到查询的记录集
if (menu!=null && menu.length>0){

           Showdata = "tree.add('0','-1','菜单列表','"+strPageName+"');\r\n";
           for(int i=0;i<menu.length;i++){
             strCode = menu[i].getMENUNO();
             strFCode = "0";
             if (strCode.length()==3)
             {
                strFCode = "0";
             }else
             {
                 strFCode = strCode.substring(0,strCode.length()-3);
             }

             strName = menu[i].getMENUNAME();

             Showdata = Showdata + "tree.add('"+strCode+"','"+strFCode+"','"+strName+"','"+strPageName+"');\r\n";

          }
}

%>


<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=GBK">
<link REL="stylesheet" type="text/css" href="../../zrsysmanage/css/<%=user.getUserCSS()%>">
<SCRIPT LANGUAGE="JavaScript" src="../../zrsysmanage/script/Public.js"></SCRIPT>
<link rel="StyleSheet" href="../../ZrwebGui/dtree/dtree.css" type="text/css" />
<script type="text/javascript" src="../../ZrwebGui/dtree/dtree.js"></script>

</HEAD>
<BODY class="BodyMain" background="../../zrsysmanage/images/<%=user.getUserImage()%>/databack1.jpg">
<Form name="webform" method="post" action="">
          <table border='0' width="100%"  height="100%" cellspacing="0" cellpadding="0" align=center id="table1">
           <tr>
             <td width="2" ></td>
             <td>
             <DIV id="divMessage1" style="padding-left:0;padding-top:0;width:100%;height:100%;overflow:auto;background-image: url('<%=SysPreperty.getProperty().AppUrl%>/zrsysmanage/images/<%=user.getUserImage()%>/databack1.jpg')">

             <script type="text/javascript">

		var tree = new dTree('tree','../../ZrwebGui/dtree/');

                <%=Showdata%>

		document.write(tree);

                tree.s=function(nodeId){ //添加单击事件
                  parent.List.location.href="List.jsp?Menu_No="+nodeId;
                }

	        </script>


             </DIV>

             </td>


          </tr></table>
</form>
</BODY>

</HTML>
<%
user = null;
menu = null;
MenuService = null;
%>
