<%--
  Class Name : FmsFileModify.jsp
  Description : 첨부파일 수정 페이지
  Modification Information

      수정일         수정자                   수정내용
    -------    --------    ---------------------------
     2009.09.16    장동한          최초 생성

    author   : 공통서비스 개발팀 장동한
    since    : 2009.09.16

    Copyright (C) 2009 by MOPAS  All right reserved.
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%   
	response.setHeader("Cache-Control","no-store");   
	response.setHeader("Pragma","no-cache");   
	response.setDateHeader("Expires",0);   
	if (request.getProtocol().equals("HTTP/1.1")) response.setHeader("Cache-Control", "no-cache"); 
%> 
<c:set var="ImgUrl" value="${pageContext.request.contextPath}/images/egovframework/com/cmm/" />
<c:set var="CssUrl" value="${pageContext.request.contextPath}/css/egovframework/com/" />
<c:set var="JsUrl"  value="${pageContext.request.contextPath}/js/egovframework/com/uss/ion/pwm/"/>
<!DOCTYPE html>
<html lang="ko">
<head>
<title>팝업창관리 관리</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script type="text/javascript" src="<c:url value='/js/EgovMultiFile.js'/>"></script>
<script type="text/javaScript" language="javascript">
/* pagination 페이지 링크 function */
function fn_mainzone_link_page(){
   	document.searchForm.submit();
}

/* 파일등록 function */
function fn_favicon_insert() {
	if(!confirm("웹 아이콘을 등록하시겠습니까?")) {
		return false;
	}
	frm = document.writeForm;
	var logParam = ""==$('form[name=writeForm] input[name=del]').val() ?  "favicon_I" :  "favicon_U" ;
	frm.action = "<c:url value='/sym/site/faviconFileInsert.do'/>?logParam="+logParam;
	<c:if test="${empty faviconFileVO.faviconFileId }">
		if(frm.file_1.value==""){
			alert("웹 아이콘을 추가해 주십시오");
			return false;
		}
	</c:if>
	frm.submit();
}

/* 배너 삭제 function */
function fn_favicon_delete() {
	var msg;
	msg = "웹 아이콘을  삭제하시겠습니까?";
	if (confirm(msg)) {
		frm = document.writeForm;
		frm.action = "<c:url value='/sym/site/faviconFileDelete.do'/>";
	    frm.submit();
	}
}

/* pagination 페이지 링크 function */
function goList(){
   	document.searchForm.submit();
}

</script>
</head>
<body>
<form name="writeForm" enctype="multipart/form-data" method="post">
	<input type="hidden" name="siteId" value="${faviconFileVO.siteId}">
	<input type="hidden" name="del" value="${faviconFileVO.faviconFileId}" />
	<input type="hidden" name="faviconFileId" value="${faviconFileVO.faviconFileId}" />
	<!-- 드래그앤 드롭 파라미터 -->
	<input type="hidden" name="menuName" value="favicon" />
	<input type="hidden" name="fmsId" value="${faviconFileVO.faviconFileId}" />
	<input type="hidden" name="limitcount" value="1" /><!-- 최대 업로드 파일갯수 -->
	
	<div class="contWrap">
		<div class="pageTitle">
			<div class="pageIcon"><img src="/pb/img/pageTitIcon4.png" alt=""></div>
			<h2 class="titType1 c_222222 fwBold">파비콘관리 수정/등록</h2>
			<p class="tType6 c_999999">현재 사용중인 게시판의 이용 현황을 파악할 수 있으며, 게시판을 추가 및 설정, 삭제할 수 있습니다.</p>
		</div>
		<div class="pageCont">
			<div class="listTop resisterList">
				<p class="right block fwMd"><span class="tType4 c_e40000 fwBold">*</span>는 필수입력 항목입니다.</p>
			</div>
			<table class="tbType2">
				<colgroup>
					<col style="width: 20%">
					<col style="width: 80%">
				</colgroup>
				<tr>
					<th><span class="reqArea">사이트</span></th>
					<td>
				        <spring:eval expression="@globalSettings['Globals.homepage.siteNm']" />
					</td>
				</tr>
				<tr>
					<th><span class="reqArea">웹 아이콘 파일</span></th>
					<td class="upload_area">
							<div class="file_upload_box no_img_box fileWrap">
								<table>	
									<colgroup>
										<col style="width: 60%">
										<col style="width: 10%">
										<col style="width: 20%">
										<col style="width: 10%">
									</colgroup>
									<thead>
										<tr>
										<th>파일명</th>
										<th>크기</th>
										<th>등록일시</th>
										<th>삭제</th>
										</tr>
									</thead>
								</table>
							</div>
							<div class="fileWrap fileAfter file_list_div">
								<table>
									<colgroup>
										<col style="width: 60%">
										<col style="width: 10%">
										<col style="width: 20%">
										<col style="width: 10%">
									</colgroup>
									<thead>
										<tr>
											<th>파일명</th>
											<th>크기</th>
											<th>등록일시</th>
											<th>삭제</th>
										</tr>
									</thead>
									<tbody id="tbody_fiielist">
										<c:forEach var="fileList" items="${fileList}" varStatus="status">
		                        			<tr class="item_${fileList.atchFileId}_${fileList.fileSn} uploaded_obj">
												<tr class="item_${fileList.atchFileId}_${fileList.fileSn} uploaded_obj">
													<td class="file_name">
														<img src="/direct/img/upload_hwp_img.png" alt="" /><span class="file_name_text">${fileList.orignlFileNm}</span>
													</td>
													<td><span class="file_size_text" value="${fileList.fileMg}"></span></td>
													<td>${fileList.creatDt}</td>
													<td>
														<input type="button" class="delBtn" onclick="delAtchFile('${fileList.atchFileId}', '${fileList.fileSn}'); return false;">
													</td>
													<input type="hidden" name="fileSize" class="item_file_size" value="${fileList.fileMg}" >
												</tr>
		                        		</c:forEach>
									</tbody>
								</table>
							</div>
							<div class="fileInfo file_list_div">
								<ul class="inline">
									<li>
										<p>최대 <span class="c_e40000 fwBold limitcount_li">1</span>개 ｜ <span class="c_e40000 fwBold upload_number">50MB</span>제한</p>
									</li>
									<li>
										<p><span class="c_456ded fwBold totalfileCount">1</span>개 ｜ <span class="c_456ded fwBold totalfileSize">72.01KB</span></p>
									</li>
								</ul>
							</div>
						</td>
				</tr>
			</table>
		<div class="btnWrap">
			<input type="button" class="btnType1 bg_888888" value="목 록" onclick="fn_mainzone_link_page(); return false;">
			<c:if test="${!empty faviconFileVO.faviconFileId}">
				<input type="button" class="btnType1 bg_ed4545" value="삭 제 " onclick="fn_favicon_delete(); return false;">
				<input type="button" class="btnType1" value="수 정 " onclick="goSave('U'); return false;">
			</c:if>
			<c:if test="${empty faviconFileVO.faviconFileId }">
				<input type="button" class="btnType1" value="등 록"  onclick="goSave('I'); return false;">
			</c:if>
		</div>					
 	</div>
	</div>
</form>
<form name="searchForm" id="searchForm" method="get" action="<c:url value='/sym/site/faviconList.do'/>" ></form>
</body>
</html>
