TestList2.jsp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. <%--
  2. - FileName : UserList.jsp
  3. - Author(s) : Joung Kyu Park
  4. - Date : 2007.05.16
  5. - Copyright : Copyright (c) 2002-2007 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="com.udapsoft.waf.common.ui.*" %>
  12. <%@ page import="kr.co.hsnc.common.util.*"%>
  13. <%@ page import="kr.co.hsnc.common.sql.*" %>
  14. <%@ include file="/jsp/work/taglib.jsp" %>
  15. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  16. <%
  17. ctx.init(request, response);
  18. HandlerStorage storage = ctx.getHandlerStorage();
  19. ValueObject params = storage.getParams();
  20. ValueObject user = storage.getUser();
  21. String event = storage.getEvent();
  22. String deptCd = user.get("site_code");
  23. String deptName = user.get("site_name");
  24. deptCd = params.get("buseo");
  25. RowSet materialKindCodeLv1 = storage.getRowSet("materialKindCodeLv1");
  26. RowSet materialKindCodeLv2 = new RowSetImpl();
  27. RowSet materialKindCodeLv3 = new RowSetImpl();
  28. %>
  29. <SCRIPT language="JavaScript">
  30. /*예약함수*/
  31. var sheet1 = new ibsheetObject();
  32. var sheet2 = new ibsheetObject();
  33. var sheet1Row;
  34. var sheet1PageNo = 1;
  35. var pageLastRowIndex = 1;
  36. var validationResult = false;
  37. var filterShow = false;
  38. $(document).ready(function(){
  39. var init_sheet = {};
  40. init_sheet.Cfg = {SearchMode:0, MergeSheet:msHeaderOnly};
  41. init_sheet.Cols = [
  42. {Header:"레벨", Type:"Text", TreeCol:1, LevelSaveName:"MATERIAL_LEVEL", SaveName:"MATERIAL_LEVEL" , Width:300},
  43. {Header:"대분류", Type:"Text", SaveName:"GUBUN_1", Width:100, Align:"Center"},
  44. {Header:"중분류", Type:"Text", SaveName:"GUBUN_2", Width:100, Align:"Center"},
  45. {Header:"소분류", Type:"Text", SaveName:"GUBUN_3", Width:100, Align:"Center"},
  46. {Header:"LEVEL", Type:"Text", SaveName:"LEVEL", Width:100, Align:"Center"}
  47. ];
  48. init_sheet.HeaderMode = {Sort:1};
  49. IBS_InitSheet(sheet1, init_sheet);
  50. sheet1.SetDataAutoTrim(0);
  51. sheet1.SetEditable(false);
  52. sheet1.FitColWidth();
  53. ///////////////////////////////
  54. var init_sheet = {};
  55. init_sheet.Cfg = {SearchMode:0, MergeSheet:msHeaderOnly};
  56. init_sheet.Cols = [
  57. {Header:'Del', Type:"DelCheck", SaveName:"DEL_CHECK", Width:30, Align:"Center"},
  58. {Header:'Status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Edit:"False", Hidden:"True"},
  59. {Header:"대분류", Type:"Text", SaveName:"TRAN_GUBUN_1", Width:100},
  60. {Header:"중분류", Type:"Text", SaveName:"TRAN_GUBUN_2", Width:100, Align:"Center"},
  61. {Header:"소분류", Type:"Text", SaveName:"TRAN_GUBUN_3", Width:100, Align:"Center"},
  62. ];
  63. init_sheet.HeaderMode = {Sort:1};
  64. IBS_InitSheet(sheet2, init_sheet);
  65. sheet2.SetDataAutoTrim(0);
  66. // sheet1.SetEditable(false);
  67. sheet2.FitColWidth();
  68. });
  69. $(function(){
  70. $("#btnSearch").click(function(){
  71. $("#event").val("GET_LIST");
  72. var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/TestList2_sheet.screen";
  73. Modular.view.IBSheet7.doSearch(sheet1, url, $("#form1"), 10000, "");
  74. // sheet1.DoSearch("/test/TestList_data.screen", $("#form1"));
  75. });
  76. $("#btnAdd").click(function(){
  77. sheet1.DataInsert(-1);
  78. });
  79. $("#btnSave").click(function(){
  80. if (confirm("저장하시겠습니까?"))
  81. {
  82. $("#event").val("SAVE_LIST");
  83. var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/TestList2_sheet.screen";
  84. var result = Modular.view.IBSheet7.doSave(sheet1, url, $("#form1"), false);
  85. }
  86. });
  87. $("#btnSave2").click(function(){
  88. var f = document.form1
  89. $("#event").val("SAVE_FORM");
  90. submitXmlRequest("/test/TestList_form.screen", "SAVE_FORM", f);
  91. // var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/TestList_sheet.screen";
  92. // Modular.view.IBSheet7.doSave(sheet1, url, $("#form1"), 10000, false);
  93. });
  94. $("#material_Kind_Code_Lv1").change(function(){
  95. var f = document.form1;
  96. $("#event").val("GET_MATL_KIND_CODE_LV2");
  97. $("#materiallevel").val("2");
  98. $("#materialgroup").val($("#material_Kind_Code_Lv1").val());
  99. submitXmlRequest("/test/TestList2_form.screen", "GET_MATL_KIND_CODE_LV2", f, "ROWSET");
  100. });
  101. $("#material_Kind_Code_Lv2").change(function(){
  102. var f = document.form1;
  103. $("#event").val("GET_MATL_KIND_CODE_LV3");
  104. $("#materiallevel").val("3");
  105. $("#materialgroup").val($("#material_Kind_Code_Lv2").val());
  106. submitXmlRequest("/test/TestList2_form.screen", "GET_MATL_KIND_CODE_LV3", f, "ROWSET");
  107. });
  108. });
  109. // 자재분류 첫번째 SELECT BOX onChange 이벤트
  110. // function doChangeMaterialKind() {
  111. // document.form1.materiallevel.value = "2";
  112. // document.form1.materialgroup.value = document.form1.material_Kind_Code_Lv1_id.value;
  113. // submitXmlRequest("/pur/common/MatlCodeSelectAllPopup_process.screen", "GET_MATL_KIND_CODE_LV2", document.form1, "VALUEOBJECT");
  114. // }
  115. function sheet1_OnDblClick(Row, Col, Value)
  116. {
  117. var rowIndex = "";
  118. var sheetObj = document.all.sheet1;
  119. if(sheet1.GetCellValue(Row, "LEVEL") == "2")
  120. {
  121. rowIndex = sheet2.DataInsert(-1);
  122. sheet2.SetCellValue(rowIndex, "TRAN_GUBUN_1", sheet1.GetCellValue(Row, "GUBUN_1"));
  123. sheet2.SetCellValue(rowIndex, "TRAN_GUBUN_2", sheet1.GetCellValue(Row, "GUBUN_2"));
  124. sheet2.SetCellValue(rowIndex, "TRAN_GUBUN_3", sheet1.GetCellValue(Row, "GUBUN_3"));
  125. }
  126. else
  127. {
  128. // dlgAlert("ㅁㄴ야ㅕ모뉴야ㅕㅁ뉴야며늉먄유");
  129. alert("소분류를 선택해 주세요.");
  130. }
  131. }
  132. function sheet2_OnDblClick(Row, Col, Value)
  133. {
  134. var rowIndex = "";
  135. var sheetObj = document.all.sheet1;
  136. sheet2.SetCellValue(1, 0, "D");
  137. }
  138. function doResult(resultObj) {
  139. try {
  140. if( resultObj.getRequestEvent() == "SAVE_FORM") {
  141. if( resultObj.getSuccess() ) {
  142. alert("Process is completed.");
  143. // goListProc();
  144. location.reload();
  145. }
  146. else {
  147. dlgErrorMsg(resultObj);
  148. }
  149. // document.form1.isSubmit = false;
  150. }
  151. else if ( resultObj.getRequestEvent() == "GET_MATL_KIND_CODE_LV2" )
  152. {
  153. if ( resultObj.getSuccess() == true )
  154. {
  155. var rowSet = resultObj.getRowSet();
  156. $("#material_Kind_Code_Lv2").empty().data("options");
  157. $("#material_Kind_Code_Lv2").append("<option value=''>-- 전체 --</option>");
  158. for ( var i = 0; i < rowSet.getRowSize(); i++ )
  159. {
  160. $("#material_Kind_Code_Lv2").append("<option value='"+rowSet.getColValue( i, 1 )+"'>"+rowSet.getColValue( i, 1 ) + " : " + rowSet.getColValue( i, 2 )+"</option>");
  161. }
  162. if($("#material_Kind_Code_Lv1").val() == "")
  163. {
  164. $("#material_Kind_Code_Lv2").empty().data("options");
  165. $("#material_Kind_Code_Lv2").append("<option value=''>-- 전체 --</option>");
  166. }
  167. if($("#material_Kind_Code_Lv3").val() == "")
  168. {
  169. $("#material_Kind_Code_Lv3").empty().data("options");
  170. $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
  171. }
  172. document.form1.isSubmit = false;
  173. } else {
  174. dlgErrorMsg(resultObj);
  175. }
  176. }
  177. else if ( resultObj.getRequestEvent() == "GET_MATL_KIND_CODE_LV3" )
  178. {
  179. if ( resultObj.getSuccess() == true )
  180. {
  181. var rowSet = resultObj.getRowSet();
  182. $("#material_Kind_Code_Lv3").empty().data("options");
  183. $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
  184. for ( var i = 0; i < rowSet.getRowSize(); i++ )
  185. {
  186. $("#material_Kind_Code_Lv3").append("<option value='"+rowSet.getColValue( i, 1 )+"'>"+rowSet.getColValue( i, 1 ) + " : " + rowSet.getColValue( i, 2 )+"</option>");
  187. }
  188. if($("#material_Kind_Code_Lv2").val() == "")
  189. {
  190. $("#material_Kind_Code_Lv3").empty().data("options");
  191. $("#material_Kind_Code_Lv3").append("<option value=''>-- 전체 --</option>");
  192. }
  193. document.form1.isSubmit = false;
  194. }
  195. else
  196. {
  197. dlgErrorMsg(resultObj);
  198. }
  199. }
  200. }
  201. catch(errorObject) {
  202. showErrorDlg("doResult()", errorObject);
  203. }
  204. }
  205. function injectSelect(vo, selectObj, code, value){
  206. var Code = vo.get(code);
  207. var Value = vo.get(value);
  208. var arrCd = Code.split('|');
  209. var arrValue = Value.split('|');
  210. while(selectObj.options.length){
  211. selectObj.remove(0);
  212. }
  213. var newOpt;
  214. newOpt = document.createElement('option');
  215. newOpt.text = "-- 전체 --";
  216. newOpt.value = "";
  217. selectObj.options.add(newOpt);
  218. if (arrCd == '') {
  219. selectObj.length = 1;
  220. } else {
  221. for(var i = 0; i < arrCd.length; i++){
  222. newOpt = document.createElement('option');
  223. newOpt.text = arrValue[i] + " : " + arrCd[i];
  224. newOpt.value = arrValue[i];
  225. selectObj.options.add(newOpt);
  226. }
  227. }
  228. }
  229. function sheet1_OnSaveEnd(code, msg)
  230. {
  231. var event = $("#event").val();
  232. if(code >= "0")
  233. {
  234. dlgAlert("등록되었습니다.");
  235. }
  236. else
  237. {
  238. dlgAlert("등록실패.");
  239. }
  240. $("#event").val("GET_LIST");
  241. // // var url = Modular.model.PageContext.CONTEXT_ROOT + "/test/TestList_sheet.screen";
  242. // Modular.view.IBSheet7.doSearch(sheet1, url, $("#form1"), 10000, "");
  243. }
  244. </SCRIPT>
  245. <modular:search id="form1">
  246. <modular:key id="event" />
  247. </modular:search>
  248. <form id="form1" name="form1" method="post" modular:type="search">
  249. <TABLE border="0" cellspacing="0" cellpadding="0" width="100%">
  250. <TR><TD height="1" colspan="2">
  251. <INPUT type="hidden" name="p_user_sabun" value="">
  252. <INPUT type="hidden" name="event" id="event" value="">
  253. <INPUT type="hidden" name="p_user_pw" value="">
  254. <INPUT type="hidden" name="p_buseo_nm" value="">
  255. <INPUT type="hidden" name="p_job_dscr" value="">
  256. <INPUT type="hidden" name="p_tel_no" value="">
  257. <INPUT type="hidden" name="p_hand_tel_no" value="">
  258. <INPUT type="hidden" name="p_e_mail" value="">
  259. <INPUT type="hidden" name="p_user_name" value="">
  260. <INPUT type="hidden" name="acct_id" value="">
  261. <INPUT type="hidden" name="j_usertype" value="head">
  262. <input type="hidden" name="login_id" >
  263. <input type="hidden" name="login_pw" >
  264. <INPUT type="hidden" name="j_admin_login_gb" value="Y">
  265. <!-- material seledct box -->
  266. <input type="hidden" id="materialgroup" name="materialgroup" value="">
  267. <input type="hidden" id="materiallevel" name="materiallevel" value="">
  268. <TABLE class="screen_title_table">
  269. <TR height="2"><TD colspan="2"></TD></TR>
  270. <TR height="25">
  271. <TD width="16" valign="middle"><IMG src="/img/buyer/template/bullet_03.gif" ></TD>
  272. <TD width="100%" class="screen_title_text">TEST</TD>
  273. </TR>
  274. </TABLE>
  275. </TD></TR>
  276. <!-- 검색조건 영역 : 시작 -->
  277. <TR><TD height="1" colspan="2">
  278. <TABLE cellspacing="1" cellpadding="0" class="search_table">
  279. <TR height="25">
  280. <!-- 검색조건 타이틀 1 -->
  281. <TD width="10%" class="search_table_title">
  282. <img src="/img/buyer/button/bullet_01.gif" align="middle">Dept
  283. </TD>
  284. <TD width="30%" class="search_table_data">
  285. &nbsp;
  286. <%= HTMLMaker.getSelectTag(materialKindCodeLv1, "materialgroup", "materialgroupname" , "material_Kind_Code_Lv1", "style='width:30%;height=18;'", "<OPTION value=''>-- 전체 --</OPTION>", "", 0) %>
  287. &nbsp;
  288. <%= HTMLMaker.getSelectTag(materialKindCodeLv2, "materialgroup", "materialgroupname" , "material_Kind_Code_Lv2", "style='width:30%;height=18;'", "<OPTION value=''>-- 전체 --</OPTION>", "", 0) %>
  289. &nbsp;
  290. <%= HTMLMaker.getSelectTag(materialKindCodeLv3, "materialgroup", "materialgroupname" , "material_Kind_Code_Lv3", "style='width:30%;height=18;'", "<OPTION value=''>-- 전체 --</OPTION>", "", 0) %>
  291. &nbsp;
  292. </TD>
  293. <TD width="8%" class="search_table_title">
  294. <img src="/img/buyer/button/bullet_01.gif" align="middle">Account Type
  295. </TD>
  296. <TD witdh="5%" class="search_table_data">
  297. &nbsp;<input type="text" name="type" id="type" value=""/>
  298. </TD>
  299. <TD width="8%" class="search_table_title">
  300. <img src="/img/buyer/button/bullet_01.gif" align="middle">Emp. No.
  301. </TD>
  302. <TD width="10%" class="search_table_data">
  303. &nbsp;
  304. <%= InputText.get("user_sabun", "", 80, 50, "hangule, desc=사번, PerSize") %>
  305. </TD>
  306. <TD width="20%" rowspan="3" class="search_button">
  307. <!-- 검색버튼 영역 : 시작 -->
  308. <TABLE border="0" cellpadding="0" cellspacing="0" align="center">
  309. <TR>
  310. <!-- 초기화버튼 : 시작 -->
  311. <TD>
  312. <DIV id="btnSearch" class="button_style">
  313. <TABLE border="0" cellpadding="0" cellspacing="0">
  314. <TR>
  315. <TD class="button_left1"></TD>
  316. <TD class="button_text1">Search&nbsp;</TD>
  317. <TD class="button_right"></TD>
  318. </TR>
  319. </TABLE>
  320. </DIV>
  321. </TD>
  322. <!-- 초기화버튼 : 종료 -->
  323. <!-- 검색버튼 구분 여백 : 시작 -->
  324. <TD width="5"></TD>
  325. <!-- 검색버튼 구분 여백 : 종료 -->
  326. <!-- 검색버튼 : 시작 -->
  327. <TD>
  328. <DIV id="btnSave" class="button_style">
  329. <TABLE border="0" cellpadding="0" cellspacing="0">
  330. <TR>
  331. <TD class="button_left1"></TD>
  332. <TD class="button_text1">Save&nbsp;</TD>
  333. <TD class="button_right"></TD>
  334. </TR>
  335. </TABLE>
  336. </DIV>
  337. <DIV id="btnSave2" class="button_style">
  338. <TABLE border="0" cellpadding="0" cellspacing="0">
  339. <TR>
  340. <TD class="button_left1"></TD>
  341. <TD class="button_text1">Save2&nbsp;</TD>
  342. <TD class="button_right"></TD>
  343. </TR>
  344. </TABLE>
  345. </DIV>
  346. </TD>
  347. <!-- 검색버튼 : 종료 -->
  348. <!-- 검색버튼 구분 여백 : 시작 -->
  349. <TD width="5"></TD>
  350. <!-- 검색버튼 구분 여백 : 종료 -->
  351. <!-- 검색버튼 : 시작 -->
  352. <TD>
  353. <DIV id="btnAdd" class="button_style">
  354. <TABLE border="0" cellpadding="0" cellspacing="0">
  355. <TR>
  356. <TD class="button_left1"></TD>
  357. <TD class="button_text1">Add&nbsp;</TD>
  358. <TD class="button_right"></TD>
  359. </TR>
  360. </TABLE>
  361. </DIV>
  362. </TD>
  363. <TD width="5"></TD>
  364. <TD>
  365. <DIV onclick="getEhr();" class="button_style"> <!-- SP_GET_EHR_EMPDATA 프로시져 호출-->
  366. <TABLE border="0" cellpadding="0" cellspacing="0">
  367. <TR>
  368. <TD class="button_left1"></TD>
  369. <TD class="button_text1">EHR Sync&nbsp;</TD>
  370. <TD class="button_right"></TD>
  371. </TR>
  372. </TABLE>
  373. </DIV>
  374. </TD>
  375. </TR>
  376. </TABLE>
  377. <!-- 검색버튼 영역 : 종료 -->
  378. </TD>
  379. </TR>
  380. <TR height="25">
  381. <!-- 검색조건 타이틀 1 -->
  382. <TD width="8%" class="search_table_title">
  383. <img src="/img/buyer/button/bullet_01.gif" align="middle">Site
  384. </TD>
  385. <TD witdh="15%" class="search_table_data">
  386. &nbsp;
  387. <INPUT type="text" name="dept_cd" class="input" value="" readOnly style="width:30%;background-color: #dedede;" >
  388. <INPUT type="text" name="dept_nm" class="input" value="" style="width:52%">
  389. <IMG onclick="dlgSearchSpotDept(document.form1.dept_cd, document.form1.dept_nm);" src="/img/buyer/button/bt_search_right.gif" alt="현장찾기" border="0" align="absmiddle" style="cursor:hand;">
  390. </TD>
  391. <TD width="8%" class="search_table_title">
  392. <img src="/img/buyer/button/bullet_01.gif" align="middle">Name
  393. </TD>
  394. <TD witdh="5%" class="search_table_data" colspan="3">
  395. &nbsp;
  396. <%//= InputText.get("user_name", "", 60, 50, "hangule, desc=성명, PerSize") %>
  397. <INPUT type="text" name="user_name" value="<%=params.get("user_name") %>" maxlength="50" class="input" style="IME-MODE : active;width:30%;" desc="성명" onKeyPress="doKeyPress();">
  398. </TD>
  399. </TR>
  400. </TABLE>
  401. </TD></TR>
  402. <!-- 검색조건 영역 : 종료 -->
  403. <!-- 검색조건 영역, 테이터 영역 구분 여백 : 시작 -->
  404. <TR><TD height="1" colspan="2">
  405. <TABLE border="0" cellspacing="0" cellpadding="0" class="search_data_div_height">
  406. <TR><TD></TD></TR>
  407. </TABLE>
  408. </TD></TR>
  409. <!-- 검색조건 영역, 테이터 영역 구분 여백 : 종료 -->
  410. </TABLE>
  411. </FORM>
  412. <table border="0" cellspacing="0" cellpadding="0" style="width: 100%; height: 100%;">
  413. <!-- 데이터 영역 : 시작 -->
  414. <tr>
  415. <td id="sheet1_td" style="width: 45%;">
  416. <!-- IBSheet7 그리드 생성 -->
  417. <script>createIBSheet("sheet1","100%", "100%");</script>
  418. </td>
  419. <td id="sheet12_td" style="width: 45%;">
  420. <!-- IBSheet7 그리드 생성 -->
  421. <script>createIBSheet("sheet2","100%", "100%");</script>
  422. </td>
  423. </tr>
  424. <!-- 데이터 영역 : 종료 -->
  425. </table>