CommGongCodeTree.jsp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <%--
  2. - FileName : CommMatlCodeTree.jsp
  3. - Author(s) : pej
  4. - Date : 2007-06-13
  5. - Copyright : Copyright (c) 2002-2003 www.hwenc.com, Inc.
  6. -
  7. - Description: 자재코드 등록 > 자재코드트리
  8. --%>
  9. <%@ page contentType="text/html; charset=utf-8" %>
  10. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  11. <%@ page import="kr.co.hsnc.common.util.*" %>
  12. <%@ page import="kr.co.hsnc.common.sql.*" %>
  13. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  14. <%
  15. ctx.init(request, response);
  16. HandlerStorage storage = ctx.getHandlerStorage();
  17. ValueObject user = ctx.getUser();
  18. ValueObject params = storage.getParams();
  19. String event = storage.getEvent();
  20. String deptCd = ctx.getUser().get("site_code");
  21. String deptName = ctx.getUser().get("site_name");
  22. String estGb = "EST";
  23. RowSet rowset = storage.getRowSet("rsSectList");
  24. %>
  25. <div style="margin-top: 10px;"></div>
  26. <SCRIPT LANGUAGE="JavaScript">
  27. <!--
  28. root=gFld("공종코드", '/common/CommGongCodeList.screen');
  29. root.iconSrc = ICONPATH + 'root.gif';
  30. root.iconSrcClosed = ICONPATH + 'root.gif';
  31. <%
  32. if(rowset != null && rowset.size()> 0) {
  33. out.println(getTreeHtml(deptCd, rowset));
  34. }
  35. %>
  36. </SCRIPT>
  37. <style>
  38. a {
  39. color : dimgray;
  40. line-height : 120%;
  41. font-family : 굴림, arial;
  42. font-size : 12px;
  43. text-decoration : none;
  44. };
  45. </style>
  46. <% if(rowset != null && rowset.size()> 0) { %>
  47. <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>
  48. <script>initializeDocument();</script>
  49. <noscript>
  50. A tree for site navigation will open here if you enable JavaScript in your browser.
  51. </noscript>
  52. <% } else { %>
  53. <font style=font-size:9pt>There is no actual budget registered.</font>
  54. <% } %>
  55. <%!
  56. private String getTreeHtml(String deptCd, RowSet rowset){
  57. StringBuffer html = new StringBuffer();
  58. String sectCodeL1 = "";
  59. String sectCodeL2 = "";
  60. String sectCodeL3 = "";
  61. String sectCodeNameL1 = "";
  62. String sectCodeNameL2 = "";
  63. String sectCodeNameL3 = "";
  64. String specCode = "";
  65. String calTpCode = "";
  66. int iDepth = 0;
  67. try {
  68. for(int i=0; i<rowset.size(); i++){
  69. iDepth = rowset.getRow(i).getInt("DEPTH");
  70. if ( iDepth == 1 ){
  71. sectCodeL1 = rowset.getRow(i).get("ITEM_CD");
  72. sectCodeNameL1 = rowset.getRow(i).get("ITEM_NAME");
  73. html.append("aux0=insFld(root, gFld(\""+rowset.getRow(i).get("ITEM_NAME")+"("+rowset.getRow(i).get("ITEM_CD")+")"+"\", '/common/CommGongCodeList.screen?item_cd="+rowset.getRow(i).get("ITEM_CD")+"&depth="+rowset.getRow(i).get("DEPTH")+"&isNode=true'));").append("\n");
  74. }
  75. else if ( iDepth == 2 ){
  76. sectCodeL2 = rowset.getRow(i).get("ITEM_CD");
  77. sectCodeNameL2 = rowset.getRow(i).get("ITEM_NAME");
  78. html.append("aux1=insFld(aux0, gFld(\""+rowset.getRow(i).get("ITEM_NAME")+"("+rowset.getRow(i).get("ITEM_CD")+")"+"\", '/common/CommGongCodeList.screen?item_cd="+rowset.getRow(i).get("ITEM_CD")+"&depth="+rowset.getRow(i).get("DEPTH")+"&isNode=true'));").append("\n");
  79. }
  80. }
  81. }
  82. catch(Exception e){
  83. System.out.println(e);
  84. }
  85. return html.toString();
  86. }
  87. %>