FileList.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ page import="kr.co.hsnc.common.sql.*" %>
  3. <%@ page import="kr.co.hsnc.common.util.*"%>
  4. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  5. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  6. <%
  7. ctx.init(request, response);
  8. ValueObject params = null;
  9. ValueObject user = null;
  10. String message = null;
  11. String event = null;
  12. HandlerStorage storage = ctx.getHandlerStorage();
  13. //user = storage.getUser();
  14. event = storage.getEvent();
  15. params = storage.getParams();
  16. RowSet fileListRowSet = storage.getRowSet("FileListRowSet");
  17. int size = (fileListRowSet != null ? fileListRowSet.size() : 0);
  18. %>
  19. <style type="text/css">
  20. .view_title {
  21. BACKGROUND-COLOR : #5F86B6 ;
  22. FONT-FAMILY : "굴림", "Verdana" ;
  23. FONT-SIZE : 9pt ;
  24. COLOR : #ffffff ;
  25. TEXT-INDENT : 9px ;
  26. }
  27. </style>
  28. <SCRIPT language="JavaScript">
  29. var m_enc = "multipart/form-data";
  30. var a_enc = "application/x-www-form-urlencoded";
  31. function doClose() {
  32. var f = document.frames['display'].document.form2;
  33. if( f == null )
  34. close();
  35. var size = f.size.value;
  36. var array = new Object();
  37. if( size == 1 ) {
  38. var obj = new Object();
  39. obj.no = f.no.value;
  40. obj.file_id = f.file_id.value;
  41. obj.file_map_id = f.file_map_id.value;
  42. obj.file_name = f.file_name.value;
  43. obj.file_size = f.file_size.value;
  44. try {
  45. if( f.open_corp_yn.checked )
  46. obj.open_corp_yn = 'Y';
  47. else
  48. obj.open_corp_yn = 'N';
  49. }
  50. catch(errorObject) {
  51. obj.open_corp_yn = f.open_corp_yn_value.value;
  52. }
  53. try {
  54. if( f.use_con_yn.checked )
  55. obj.use_con_yn = 'Y';
  56. else
  57. obj.use_con_yn = 'N';
  58. }
  59. catch(errorObject) {
  60. obj.use_con_yn = f.use_con_yn_value.value;
  61. }
  62. try {
  63. if( f.techreq_open_yn.checked )
  64. obj.techreq_open_yn = 'Y';
  65. else
  66. obj.techreq_open_yn = 'N';
  67. }
  68. catch(errorObject) {
  69. obj.techreq_open_yn = f.techreq_open_yn_value.value;
  70. }
  71. array = new Array(obj);
  72. }
  73. else if( size > 1 ) {
  74. array = new Array(size);
  75. for( var i = 0 ; i < size ; i++ ) {
  76. var obj = new Object();
  77. obj.no = f.no[i].value;
  78. obj.file_id = f.file_id[i].value;
  79. obj.file_map_id = f.file_map_id[i].value;
  80. obj.file_name = f.file_name[i].value;
  81. obj.file_size = f.file_size[i].value;
  82. try {
  83. if( f.open_corp_yn[i].checked )
  84. obj.open_corp_yn = 'Y';
  85. else
  86. obj.open_corp_yn = 'N';
  87. }
  88. catch(errorObject) {
  89. obj.open_corp_yn = f.open_corp_yn_value[i].value;
  90. }
  91. try {
  92. if( f.use_con_yn[i].checked )
  93. obj.use_con_yn = 'Y';
  94. else
  95. obj.use_con_yn = 'N';
  96. }
  97. catch(errorObject) {
  98. obj.use_con_yn = f.use_con_yn_value[i].value;
  99. }
  100. try {
  101. if( f.techreq_open_yn[i].checked )
  102. obj.techreq_open_yn = 'Y';
  103. else
  104. obj.techreq_open_yn = 'N';
  105. }
  106. catch(errorObject) {
  107. obj.techreq_open_yn = f.techreq_open_yn_value[i].value;
  108. }
  109. array[i] = obj;
  110. }
  111. }
  112. returnValue = array;
  113. close();
  114. }
  115. function saveProc() {
  116. var f = document.form1;
  117. if( f.attach_file.value == "" ) {
  118. dlgAlert("파일을 선택하세요.");
  119. return;
  120. }
  121. f.fevent.value = "FileListWorker.Save";
  122. f.target = "worker";
  123. f.action = "FileListWorker.screen";
  124. f.encoding = m_enc;
  125. f.method = "post";
  126. //formSubmit(f, true);
  127. formSubmit(f, false);
  128. }
  129. // Form Lock 풀기
  130. function resetFormProc() {
  131. resetFormSubmit();
  132. }
  133. function delProc() {
  134. //var f = document.frames['display'].document.form2;
  135. //var f = document.getElementById("display");
  136. var iframe = document.getElementById('display');
  137. var innerDoc = iframe.contentDocument || iframe.contentWindow.document;
  138. var f = innerDoc.getElementById('form2');
  139. if( f.file_map_id == null ) {
  140. dlgAlert("삭제할 파일이 없습니다.");
  141. return;
  142. }
  143. var isCheck = isChecked(f.chk_file_map_id);
  144. if( !isCheck ) {
  145. dlgAlert("삭제할 파일을 선택하세요");
  146. return;
  147. }
  148. f.fevent.value = "FileListWorker.Del";
  149. f.target = "worker";
  150. f.action = "FileListWorker.screen";
  151. f.encoding = a_enc;
  152. f.method = "post";
  153. formSubmit(f);
  154. }
  155. function changeOpenCorpYNProc(obj) {
  156. var f = document.frames['display'].document.form2;
  157. f.change_file_map_id.value = obj.value;
  158. if( obj.checked )
  159. f.change_open_corp_yn.value = "Y";
  160. else
  161. f.change_open_corp_yn.value = "N";
  162. f.fevent.value = "FileListWorker.Change";
  163. f.target = "worker";
  164. f.action = "FileListWorker.screen";
  165. f.encoding = a_enc;
  166. f.method = "post";
  167. f.submit();
  168. }
  169. function changeUseConYNProc(obj) {
  170. var f = document.frames['display'].document.form2;
  171. f.change_file_map_id.value = obj.value;
  172. if( obj.checked )
  173. f.change_use_con_yn.value = "Y";
  174. else
  175. f.change_use_con_yn.value = "N";
  176. f.fevent.value = "FileListWorker.Change";
  177. f.target = "worker";
  178. f.action = "FileListWorker.screen";
  179. f.encoding = a_enc;
  180. f.method = "post";
  181. f.submit();
  182. }
  183. function changeTechreqOpenYNProc(obj) {
  184. var f = document.frames['display'].document.form2;
  185. f.change_file_map_id.value = obj.value;
  186. if( obj.checked )
  187. f.change_techreq_open_yn.value = "Y";
  188. else
  189. f.change_techreq_open_yn.value = "N";
  190. f.fevent.value = "FileListTechreq.Change";
  191. f.target = "worker";
  192. f.action = "FileListWorker.screen";
  193. f.encoding = a_enc;
  194. f.method = "post";
  195. f.submit();
  196. }
  197. function reloadProc() {
  198. f = document.form1;
  199. f.fevent.value = "";
  200. f.action = "FileListView.screen";
  201. f.method = "post";
  202. f.encoding = a_enc;
  203. f.target = "display";
  204. f.submit();
  205. }
  206. function resetProc() {
  207. f = document.form1;
  208. //f.reset();
  209. }
  210. function initPage() {
  211. reloadProc();
  212. }
  213. window.onunload = doClose;
  214. window.onload = initPage;
  215. </SCRIPT>
  216. <STYLE>
  217. BODY {
  218. padding : 0 0 0 0;
  219. }
  220. </STYLE>
  221. <FORM name="form1">
  222. <INPUT type="hidden" name="fevent" value="">
  223. <INPUT type="hidden" name="file_gb" value="<%= params.get("file_gb") %>">
  224. <INPUT type="hidden" name="id" value="<%= params.get("id") %>">
  225. <INPUT type="hidden" name="is_modify" value="<%= params.get("is_modify") %>">
  226. <INPUT type="hidden" name="is_corp" value="<%= params.get("is_corp") %>">
  227. <INPUT type="hidden" name="is_con" value="<%= params.get("is_con") %>">
  228. <INPUT type="hidden" name="is_techreq" value="<%= params.get("is_techreq") %>">
  229. <INPUT type="hidden" name="mod_no" value="<%= params.get("mod_no") %>">
  230. <INPUT type="hidden" name="sysGb" value="<%=params.get("sys_gb")%>">
  231. <div align="left" id="title">
  232. <ul>
  233. <li>첨부파일</li>
  234. </ul>
  235. </div>
  236. <table id="search-table" class="search-form-table">
  237. <colgroup>
  238. <col width="100" />
  239. <col width="400" />
  240. <col width="*" />
  241. </colgroup>
  242. <tr>
  243. <th>파일선택</th>
  244. <td>
  245. <% if( params.get("IS_MODIFY").equals("Y") ) { %>
  246. <!-- <INPUT type="file" name="attach_file" size="50" onChange="getObj(form1.attach_file, 0).value = this.value;" class="input" contenteditable="false"> -->
  247. <input id="attach_file" type="file" name="attach_file" onChange="getObj(form1.attach_file, 0).value = this.value;" class="input" contenteditable="false" multiple>
  248. <% } %>
  249. </td>
  250. <td class="button">
  251. <span class="btnSearch center"><a href="javascript:saveProc();" id="btnSave">파일저장</a></span>
  252. <span class="btnSearch center"><a href="javascript:delProc();" id="btnDel">파일삭제</a></span>
  253. <span class="btnSearch center"><a href="javascript:doClose();" id="btnClose">닫기</a></span>
  254. </td>
  255. </tr>
  256. <tr>
  257. <td colspan="3" style="text-align:center;border:0px;">
  258. <IFRAME width="99%" height="340px" name="display" id="display" src="" topmargin="0" leftmargin="0"></IFRAME>
  259. </td>
  260. </tr>
  261. </table>
  262. <%-- <TABLE width="100%" cellpadding="0" cellspacing="0" border="0">
  263. <TR>
  264. <TD height="3" colspan="3"></TD>
  265. </TR>
  266. <TR height="25">
  267. <TD width="3"></TD>
  268. <TD>
  269. <% if( params.get("IS_MODIFY").equals("Y") ) { %>
  270. <!-- <INPUT type="file" name="attach_file" size="50" onChange="getObj(form1.attach_file, 0).value = this.value;" class="input" contenteditable="false"> -->
  271. <input id="attach_file" type="file" name="attach_file" onChange="getObj(form1.attach_file, 0).value = this.value;" class="input" contenteditable="false" multiple>
  272. <% } %>
  273. </TD>
  274. <TD align="right">
  275. <% if( params.get("IS_MODIFY").equals("Y") ) {
  276. %>
  277. <TABLE cellpadding="0" cellspacing="0" border="0" width="250">
  278. <TR>
  279. <TD>
  280. <DIV onclick="JavaScript:saveProc();" class="button_style">
  281. <TABLE border="0" cellpadding="0" cellspacing="0">
  282. <TR>
  283. <TD class="button_left1"></TD>
  284. <TD class="button_text1">파일추가</TD>
  285. <TD class="button_right"></TD>
  286. </TR>
  287. </TABLE>
  288. </DIV>
  289. </TD>
  290. <td>
  291. <DIV onclick="JavaScript:delProc();" class="button_style">
  292. <TABLE border="0" cellpadding="0" cellspacing="0">
  293. <TR>
  294. <TD class="button_left1"></TD>
  295. <TD class="button_text1">파일삭제&nbsp;&nbsp;&nbsp;</TD>
  296. <TD class="button_right"></TD>
  297. </TR>
  298. </TABLE>
  299. </DIV>
  300. </td>
  301. <% }
  302. %>
  303. <td>
  304. <DIV onclick="JavaScript:doClose();" class="button_style">
  305. <TABLE border="0" cellpadding="0" cellspacing="0">
  306. <TR>
  307. <TD class="button_left1"></TD>
  308. <TD class="button_text1">닫기&nbsp;&nbsp;&nbsp;</TD>
  309. <TD class="button_right"></TD>
  310. </TR>
  311. </TABLE>
  312. </DIV>
  313. </td>
  314. </TR>
  315. </TABLE>
  316. </TD>
  317. <TD width="3"></TD>
  318. </TR>
  319. <TR>
  320. <TD height="3" colspan="4"></TD>
  321. </TR>
  322. <TR>
  323. <TD colspan="6">
  324. <IFRAME width="730" height="400" name="display" id="display" src="" topmargin="0" leftmargin="0"></IFRAME>
  325. </TD>
  326. </TR>
  327. </TABLE> --%>
  328. <IFRAME width="0" height="0" name="worker"></IFRAME>
  329. </FORM>