123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <%--
- - FileName : CommMatlCodeTree.jsp
- - Author(s) : pej
- - Date : 2007-06-13
- - Copyright : Copyright (c) 2002-2003 www.hwenc.com, Inc.
- -
- - Description: 자재코드 등록 > 자재코드트리
- --%>
- <%@ page contentType="text/html; charset=utf-8" %>
- <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
- <%@ page import="kr.co.hsnc.common.util.*" %>
- <%@ page import="kr.co.hsnc.common.sql.*" %>
- <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
- <%
- ctx.init(request, response);
- HandlerStorage storage = ctx.getHandlerStorage();
- ValueObject user = ctx.getUser();
- ValueObject params = storage.getParams();
- String event = storage.getEvent();
- String deptCd = ctx.getUser().get("site_code");
- String deptName = ctx.getUser().get("site_name");
- String estGb = "EST";
-
-
- RowSet rowset = storage.getRowSet("rsSectList");
-
- %>
- <div style="margin-top: 10px;"></div>
- <SCRIPT LANGUAGE="JavaScript">
- <!--
- root=gFld("공통자재코드", '/common/CommMatlCodeList.screen');
- root.iconSrc = ICONPATH + 'root.gif';
- root.iconSrcClosed = ICONPATH + 'root.gif';
- <%
- if(rowset != null && rowset.size()> 0) {
- out.println(getTreeHtml(deptCd, rowset));
- }
- %>
- </SCRIPT>
- <style>
- a {
- color : dimgray;
- line-height : 120%;
- font-family : 굴림, arial;
- font-size : 12px;
- text-decoration : none;
- };
- </style>
- <% if(rowset != null && rowset.size()> 0) { %>
- <div style="position:absolute;display:none; top:0; left:0;"><table border=0><tr><td><font size=-2><a style="font-size:7pt;text-decoration:none;color:silver" href="http://www.treemenu.net/" target=_blank>www.treemenu.net</a></font></td></tr></table></div>
- <script>initializeDocument();</script>
- <noscript>
- A tree for site navigation will open here if you enable JavaScript in your browser.
- </noscript>
- <% } else { %>
- <font style=font-size:9pt>There is no actual budget registered.</font>
- <% } %>
- <%!
- private String getTreeHtml(String deptCd, RowSet rowset){
-
- StringBuffer html = new StringBuffer();
- String sectCodeL1 = "";
- String sectCodeL2 = "";
- String sectCodeL3 = "";
-
- String sectCodeNameL1 = "";
- String sectCodeNameL2 = "";
- String sectCodeNameL3 = "";
-
- int iDepth = 0;
- try {
- for(int i=0; i<rowset.size(); i++){
-
- iDepth = rowset.getRow(i).getInt("MATERIALLEVEL");
-
- if ( iDepth == 1 ){
- sectCodeL1 = rowset.getRow(i).get("MATERIALGROUP");
- sectCodeNameL1 = rowset.getRow(i).get("MATERIALGROUPNAME");
- html.append("aux0=insFld(root, gFld(\""+rowset.getRow(i).get("MATERIALGROUPNAME")+"("+rowset.getRow(i).get("MATERIALGROUP")+")"+"\", \"/common/CommMatlCodeList.screen?sect_id="+rowset.getRow(i).get("MATERIALGROUP")+"&level="+rowset.getRow(i).get("MATERIALLEVEL")+"&isNode=true&code="+sectCodeL1+"\"));").append("\n");
- }
-
- else if ( iDepth == 2 ){
- sectCodeL2 = rowset.getRow(i).get("MATERIALGROUP");
- sectCodeNameL2 = rowset.getRow(i).get("MATERIALGROUPNAME");
- html.append("aux1=insFld(aux0, gFld(\""+rowset.getRow(i).get("MATERIALGROUPNAME")+"("+rowset.getRow(i).get("MATERIALGROUP")+")"+"\", \"/common/CommMatlCodeList.screen?sect_id="+rowset.getRow(i).get("MATERIALGROUP")+"&level="+rowset.getRow(i).get("MATERIALLEVEL")+"&isNode=true&code="+sectCodeL1+"-"+sectCodeL2+"\"));").append("\n");
- }
-
- else if ( iDepth == 3 ){
- sectCodeL3 = rowset.getRow(i).get("MATERIALGROUP");
- sectCodeNameL3 = rowset.getRow(i).get("MATERIALGROUPNAME");
- html.append("aux2=insFld(aux1, gFld(\""+rowset.getRow(i).get("MATERIALGROUPNAME")+"("+rowset.getRow(i).get("MATERIALGROUP")+")"+"\", \"/common/CommMatlCodeList.screen?sect_id="+rowset.getRow(i).get("MATERIALGROUP")+"&level="+rowset.getRow(i).get("MATERIALLEVEL")+"&code="+sectCodeL1+"-"+sectCodeL2+"-"+sectCodeL3+"\"));").append("\n");
- }
-
- }
-
- }
-
- catch(Exception e){
- System.out.println(e);
- }
- return html.toString();
- }
- %>
|