dlgSearchZipCode.jsp 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <%--
  2. - FileName : dlgSearchZipCode.jsp
  3. - Author(s) : ok
  4. - Date : 2014.06.19
  5. - Copyright : Copyright (c) 2013 www.udapsoft.co.kr, Inc.
  6. - Description: 우편번호 검색 팝업
  7. --%>
  8. <%@ page contentType="text/html; charset=utf-8" %>
  9. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  10. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  11. <%@ page import="kr.co.hsnc.common.util.*"%>
  12. <%@ page import="kr.co.hsnc.common.sql.*" %>
  13. <%@ include file="/jsp/work/taglib.jsp" %>
  14. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  15. <%
  16. ctx.init(request, response);
  17. HandlerStorage storage = ctx.getHandlerStorage();
  18. ValueObject params = storage.getParams();
  19. ValueObject user = storage.getUser();
  20. String event = storage.getEvent();
  21. RowSet sidoList = storage.getRowSet("sidoList");
  22. %>
  23. <SCRIPT language="JavaScript">
  24. /*예약함수*/
  25. var sheet1;
  26. var sheet1Row;
  27. var sheet1PageNo = 1;
  28. var pageLastRowIndex = 1;
  29. var validationResult = false;
  30. var filterShow = false;
  31. function _onReady(){
  32. /**
  33. * IBSheet object initialize
  34. */
  35. gridInit(sheet1);
  36. /**
  37. * Application Initialize
  38. */
  39. jQuery("#btnSearch").click(function() {
  40. if(jQuery("#Field2").val() == ""){
  41. if(document.getElementById("radAccType1").checked==true){
  42. alert('동이름을 입력해주세요');
  43. }else{
  44. alert('도로명을 입력해주세요');
  45. }
  46. return;
  47. }
  48. jQuery("#addDiv").val(jQuery(":input:radio[name=radAccType]:checked").val());
  49. jQuery("#fevent").val("GET_ZIP_LIST");
  50. var url = Modular.model.PageContext.CONTEXT_ROOT + "/common/lib/dlgSearchZipCode_sheet.screen";
  51. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  52. });
  53. jQuery("#btnClose").click(function() {
  54. setTimeout(function(){parent.searchPostCodeClose(null);},100);
  55. });
  56. pageinit();
  57. sheet1.FitColWidth();
  58. }
  59. function pageinit(){
  60. //sheet1.FitColWidth("16|84");
  61. changeDong();
  62. }
  63. function changeDong()
  64. {
  65. sheet1.RemoveAll();
  66. if(document.getElementById("radAccType1").checked==true){
  67. // document.getElementById("dongName").innerHTML="동이름";
  68. $("#dong_title").text("동이름");
  69. sheet1.SetColHidden(2, 1);
  70. }else{
  71. // document.getElementById("dongName").innerHTML="도로명";
  72. $("#dong_title").text("도로명");
  73. sheet1.SetColHidden(2, 0);
  74. }
  75. setGridSize();
  76. }
  77. /**
  78. * IBSheet object initialize
  79. */
  80. function gridInit(sheetName){
  81. var init_sheet = {};
  82. init_sheet.Cfg = {SearchMode:2, Page:30};
  83. init_sheet.Cols = [
  84. {Header:'상태', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  85. {Header:'우편번호', Type:"Text", SaveName:"ZIP", Width:80, Align:"Center"},
  86. {Header:'새주소', Type:"Text", SaveName:"ADDR", Width:280, Align:"Left"},
  87. {Header:'주소', Type:"Text", SaveName:"OLDADDR", Width:180, Align:"Left"}
  88. ];
  89. init_sheet.HeaderMode = {Sort:1};
  90. IBS_InitSheet(sheetName, init_sheet);
  91. sheetName.SetDataAutoTrim(0);
  92. sheetName.SetEditable(false);
  93. }
  94. /**
  95. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  96. */
  97. function sheet1_OnSearchEnd(code, message) {
  98. if(code == 0) {
  99. setGridSize();
  100. } else {
  101. //조회 에러 수행
  102. alert(message);
  103. }
  104. }
  105. /**
  106. * IBSheet size setting
  107. */
  108. function setGridSize() {
  109. if(document.getElementById("radAccType1").checked==true){
  110. sheet1.FitColWidth("16|84");
  111. }else{
  112. sheet1.FitColWidth("16|42|42");
  113. }
  114. }
  115. /**
  116. * IBSheet Event: Click
  117. */
  118. function sheet1_OnClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  119. sheet1Row = Row;
  120. }
  121. /**
  122. * IBSheet Event: DBLCLICK
  123. */
  124. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  125. var retArray = new Array();
  126. retArray[0] = sheet1.GetCellValue(Row, 1);
  127. if($('input:radio[name="radAccType"]:checked').val() == "g")
  128. {
  129. retArray[1] = sheet1.GetCellValue(Row, 2);
  130. retArray[2] = sheet1.GetCellValue(Row, 3);
  131. }
  132. else
  133. {
  134. retArray[1] = sheet1.GetCellValue(Row, 2);
  135. retArray[2] = sheet1.GetCellValue(Row, 2);
  136. }
  137. setTimeout(function(){parent.searchPostCodeClose(retArray);},10);
  138. // parent.searchPostCodeClose(retArray);
  139. }
  140. function doKeyPress() {
  141. if( event.keyCode == 13 ) {
  142. jQuery("#btnSearch").click();
  143. }
  144. }
  145. function sheet1_OnSmartResize(Width, Height) {
  146. sheet1.FitColWidth();
  147. autoResize();
  148. }
  149. function autoResize(){
  150. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
  151. var iframeHeight= document.body.scrollHeight - t1_height;
  152. var iframeWidth= document.body.scrollWidth;
  153. sheet1.SetSheetHeight(iframeHeight);
  154. }
  155. </SCRIPT>
  156. <modular:search id="form1">
  157. <modular:key id="fevent" />
  158. </modular:search>
  159. <BODY onresize="autoResize()" >
  160. <form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
  161. <INPUT type="hidden" name="fevent" id="fevent" value="">
  162. <INPUT type="hidden" name="addDiv" id="addDiv" value="">
  163. <!-- 검색조건 시작 -->
  164. <table id="search-table" class="search-form-table">
  165. <colgroup>
  166. <col width="80" />
  167. <col width="100" />
  168. <col width="80" />
  169. <col width="*" />
  170. <col width="100" />
  171. </colgroup>
  172. <tr>
  173. <th>주소구분</th>
  174. <td>
  175. <input type="radio" name="radAccType" id="radAccType1" type="radio" value="g" checked="checked" onclick="changeDong();" />지번주소
  176. <input type="radio" name="radAccType" id="radAccType2" value="r" onclick="changeDong();" />도로명주소<BR>
  177. </td>
  178. <td class="button" rowspan="3">
  179. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  180. <!-- <span class="btnSearch center"><a href="javascript:void(0);" id="btnClose">닫기</a></span> -->
  181. </td>
  182. </tr>
  183. <tr>
  184. <th>시도</th>
  185. <td>
  186. <select id="SIDO">
  187. <%
  188. for(int i = 0; i < sidoList.size(); i++)
  189. {
  190. %>
  191. <option value="<%=sidoList.getRow(i).get("sido")%>"><%=sidoList.getRow(i).get("sido")%></option>
  192. <%
  193. }
  194. %>
  195. </select>
  196. </td>
  197. </tr>
  198. </tr>
  199. <th id="dong_title">동이름</th>
  200. <td>
  201. <INPUT type="text" id="Field2" name="Field2" value="" maxlength="50" class="input" style="IME-MODE : active; width:90%;" desc='동이름' onKeyPress="doKeyPress();">
  202. </td>
  203. </tr>
  204. </table>
  205. <!-- 검색조건 종료 -->
  206. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 450px; overflow: auto;">
  207. <script>createIBSheet('sheet1','100%', '450px');</script>
  208. </div>
  209. </FORM>
  210. </BODY>