<%@ page contentType="text/html; charset=GBK"%>
<%@ page import = "zr.zrpower.common.util.SysPreperty"%>
<%@ page import = "zr.zrpower.common.util.DateWork"%>
<%@ page import = "zr.zrpower.entity.sys.SessionUser"%>
<%@ page import = "zr.zrpower.analyseengine.service.StatisticsConfig"%>
<%@ page import = "zr.zrpower.analyseengine.mode.ANALYSE_STATISTICS_MAIN"%>
<%@ page import = "zr.zrpower.ejb.sys.UIService"%>

<HTML>
<%

SessionUser user = (SessionUser)session.getAttribute("userinfo");
UIService userUI =new UIService();
ANALYSE_STATISTICS_MAIN[] Statistics = null;
StatisticsConfig StatisticsCfg =  new StatisticsConfig();

String strTitle ="";
{strTitle = "数据统计配置";}
%>
<%
String strCode = "";
String strName = "";

String Showdata = "";
String strPageName = "Left.jsp";

//得到查询的记录集
Statistics = StatisticsCfg.GetStatisticsMainList();
if (Statistics!=null && Statistics.length>0){
           Showdata = "tree.add('0','-1','"+strTitle+"','"+strPageName+"');\r\n";
           for(int i=0;i<Statistics.length;i++){
             strCode = Statistics[i].getID().toString();
             strName = Statistics[i].getSTATISTICSNAME().toString();

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

             Showdata = Showdata + "tree.add('"+strCode+"A','"+strCode+"','统计计算字段配置','"+strPageName+"');\r\n";
             Showdata = Showdata + "tree.add('"+strCode+"B','"+strCode+"','统计初始条件','"+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="">
      <%if(!"6".equals(user.getUserWINDOWTYPE())){ %>
      <table border='0' width="100%"  height="100%" cellspacing="0" cellpadding="0" align=center id="table1">
           <tr><td colspan="2" height="5"></td></tr>
           <tr>

             <td align="left" valign="top">
      <%} %>

             <div  id="menu_show"  style="width:'100%';height:'100%';overflow:'hidden';display:''">
             <DIV id="divMessage1" style="position:absolute;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){ //添加单击事件
                  //根节点
                  if (nodeId=="0")
                  {
                     parent.Body.location.href="List1.jsp";
                  }
                  if (nodeId.match("A"))
                  {
                     nodeId = nodeId.substring(0,nodeId.length-1);
                     parent.Body.location.href="List3.jsp?ID="+nodeId;
                  }
                  if (nodeId.match("B"))
                  {
                     nodeId = nodeId.substring(0,nodeId.length-1);
                     parent.Body.location.href="List4.jsp?ID="+nodeId;
                  }

                }

	        </script>

             </DIV>
             </div>
  <%if(!"6".equals(user.getUserWINDOWTYPE())){ %>
  </td>
          </tr></table>
      <%} %>

</form>
</BODY>

</HTML>
<%
//清空相关对象
user = null;
userUI = null;
StatisticsCfg = null;
Statistics = null;
StatisticsCfg = null;

%>
