
<%    /**
     * ********************************************************************************
     * 프로그램명	: write_file_list.jsp 프로그램설명	: 제출 파일 List가져온다   작 성 자	 : 모우미(wonseok Lee)
     *작 성 일	: 2017. 8.11
     * *********************************************************************************
     */
%>
<%@ page contentType="text/html; charset=UTF-8"%>

<%@ page import="java.net.*"%>
<%@ page import="kr.co.kihyun.lang.Encoder"%>
<%@ page import="kr.co.kihyun.lang.MString"%>
<%@ page import="kr.co.kihyun.lang.MLong"%>
<%@ page import="java.util.ResourceBundle"%>
<%@ page import="kr.co.kihyun.moumi.Moumi"%>
<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%>
<%
        String svrFilenameList[] = {};
        String usrFilenameList[] = {};
		String fileSizeList[] =  {};

        String svrFilenames = "";
        String usrFilenames = "";
		String fileSizes =  "";

		String reportID = "";
		String docID = "";
		String dtID = "";

		String attacheFileRead = "";
		int fileCount = 0;
		long sumFileSize = 0L;
		String fileInfos = "";

        attacheFileRead = MString.checkNull(request.getParameter("attacheFileRead"));
        reportID = MString.checkNull(request.getParameter("reportID"));
        docID = MString.checkNull(request.getParameter("docID"));
        dtID = MString.checkNull(request.getParameter("dtID"));
%>

<!DOCTYPE html>
<html lang="ko">
	<head>
		<meta charset="UTF-8">
		<title>첨부파일</title>
        <link rel="stylesheet" href="/totsys/common/css/text.css" type="text/css">
        <script src="/totsys/common/js/rollover.js"></script>
        <script src="/totsys/common/js/jquery-1.12.4.min.js"></script>


		<script>
			$(document).ready(function(){
				setTimeout(filelist, 100);
			});

			var filelist = function() {
													if("<%=attacheFileRead%>"=="true") {
											<%
														svrFilenames = MString.checkNull(request.getParameter("svrFilenames"));
														usrFilenames = MString.checkNull(request.getParameter("usrFilenames"));
														fileSizes =  MString.checkNull(request.getParameter("fileSizes"));
														fileInfos =  MString.checkNull(request.getParameter("fileInfos"));
														fileCount =  Integer.parseInt( MString.checkNull(request.getParameter("fileCount"))==""?"0":MString.checkNull(request.getParameter("fileCount")));
														sumFileSize =  MLong.parseLong(MString.checkNull(request.getParameter("sumFileSize"))==""?"0":MString.checkNull(request.getParameter("sumFileSize")));
											%>
											        	var frm = parent.document.dform;
											        	frm.fileCount.value = <%=fileCount%>;
											        	frm.svrFilenames.value = "<%=svrFilenames%>";
											        	frm.usrFilenames.value = "<%=usrFilenames%>";
											        	frm.fileInfos.value = "<%=fileInfos%>";
											        	frm.sumFileSize.value = "<%=sumFileSize%>";

											            svrFilenameList = frm.svrFilenames.value.split(";", <%=fileCount%>);
											            usrFilenameList = frm.usrFilenames.value.split(";", <%=fileCount%>);

														if(!parent.document.subUpload.delFrm.fileList) location.reload();

														var frm2 = parent.document.subUpload.delFrm.fileList;


														frm2.options.length=1;
														for (i = 0; i < <%=fileCount%>; i++) {
											               	if (svrFilenameList[i] == '') {
											                   	continue;
															}
											           		$(frm2).append("<option value='"+svrFilenameList[i]+"'>"+usrFilenameList[i]+"</option>");
														}
													}
													else {
														document.listFrm.submit();
													}
											};
		</script>
    </head>
    <body>
		<form action='/servlet/kr.co.kihyun.beans.totsys.board.HttpFileList' id='listFrm' name='listFrm' method='post'>
			<input type="hidden" name="reportID" value="<%=reportID%>" class=inputtxt >
			<input type="hidden" name="docID" value="<%=docID%>" class=inputtxt >
			<input type="hidden" name="dtID" value="<%=dtID%>" class=inputtxt >
		</form>
	</body>
</html>

