<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<div id="divPrintArea">
	<div id ="divPrintTitle" style="display: none;margin: 10px 0 10px 0;">
		<spring:message code="target.divmng" /> &lt; <c:out value="${divMngVO.placeStr}" />
	</div>
	<div id="table">
	   	<table class="tbl_add">
  		<colgroup>
  			<col width="166">		
  			<col width="">		
  			<col width="166">		
  			<col width="">		
  		</colgroup>
		<tr>
			<th><spring:message code="target.divmng.place" /></th>
			<td><c:out value="${divMngVO.placeStr}" /></td>			
			<th><spring:message code="target.divmng.tel" /></th>
			<td><c:out value="${divMngVO.tel}" /></td>
		</tr>
		<tr>
			<th><spring:message code="target.divmng.local" /></th>
			<td><c:out value="${divMngVO.local}" /></td>
			<th ><spring:message code="target.divmng.gubun" /></th>
			<td><c:out value="${divMngVO.gubunStr}" /></td>
		</tr>
		<tr>
			<th><spring:message code="target.divmng.staffNum" /></th>
			<td><c:out value="${divMngVO.staffNum}" />명</td>
			<th><spring:message code="target.divmng.condition" /></th>
			<td><c:out value="${divMngVO.condition}" /></td>
		</tr>
		<tr>
			<th><spring:message code="target.divmng.equipStat" /></th>
			<td colspan="3"><c:out value="${divMngVO.equipStat}" /></td>
		</tr>
		<tr>
			<th><spring:message code="target.divmng.file" /></th>
			<td colspan="3">
				<c:if test="${divMngVO.file1 ne null and divMngVO.file1 ne ''}">
	 			<p><a href="<c:url value="/target/divmng/download.do">
							<c:param name="place" value="${divMngVO.place}" />
							<c:param name="no" value="${divMngVO.no}" />
							<c:param name="fileId" value="file1" />
						</c:url>" target="_blank"><c:out value="${divMngVO.file1}" /></a></p>
				</c:if>
				<c:if test="${divMngVO.file2 ne null and divMngVO.file2 ne ''}">
				<p><a href="<c:url value="/target/divmng/download.do">
							<c:param name="place" value="${divMngVO.place}" />
							<c:param name="no" value="${divMngVO.no}" />
							<c:param name="fileId" value="file2" />
						</c:url>" target="_blank"><c:out value="${divMngVO.file2}" /></a></p>
				</c:if>
				<c:if test="${divMngVO.file3 ne null and divMngVO.file3 ne ''}">
				<p><a href="<c:url value="/target/divmng/download.do">
							<c:param name="place" value="${divMngVO.place}" />
							<c:param name="no" value="${divMngVO.no}" />
							<c:param name="fileId" value="file3" />
						</c:url>" target="_blank"><c:out value="${divMngVO.file3}" /></a></p>
				</c:if>
			</td>
		</tr>
		<tr>
			<td colspan="4">
				<c:choose>
				<c:when test="${divMngVO.fileImg ne null and divMngVO.fileImg ne ''}" >
					<a id="imgViewer" href="<c:url value="/target/divmng/download.do">
												<c:param name="place" value="${divMngVO.place}" />
												<c:param name="no" value="${divMngVO.no}" />
												<c:param name="fileId" value="fileImg" />
											   </c:url>">
					<img src="<c:url value="/target/divmng/download.do">
								<c:param name="place" value="${divMngVO.place}" />
								<c:param name="no" value="${divMngVO.no}" />
								<c:param name="fileId" value="fileImg" />
							  </c:url>" alt="<spring:message code="target.divmng" /> 이미지" width="400" />
					</a>
				</c:when>
				<c:otherwise>
					<img src="/images/basic_img.jpg" alt="<spring:message code="target.divmng" /> 이미지" />
				</c:otherwise>
				</c:choose>
			</td>
		</tr>
		</table>
	</div>
</div>
<form:form commandName="divMngVO" name="menuForm" method="post">
	<form:hidden path="place" />
	<form:hidden path="no" />
	<div class="boardviewinfo">
		<ul class="right btn-style">
		<c:if test="${loginUserVO.isAdmin}">
  			<li>
  				<a href="javascript:fn_modify();"><spring:message code="button.goModify" /></a>
            </li>
  			<li>
  			   	<a href="javascript:fn_delete();"><spring:message code="button.goDelete" /></a>
            </li>
		</c:if>            
            <li>	
            	<a href="javascript:fn_print();"><spring:message code="button.print" /></a>
            </li>
            <li>
            	<a href="<c:url value="/target/divmng/list.do"><c:param name="place" value="${divMngVO.place}" /></c:url>"><spring:message code="button.goList" /></a>
            </li>
   		</ul>	
	</div>
	<!-- <div id="sysbtn">
		<ul>
			<c:if test="${loginUserVO.isAdmin}">
	  			<li>
	           	<span class="btn_blue_l">
	               	<a href="javascript:fn_modify();"><spring:message code="button.goModify" /></a>
	                   <img src="<c:url value='/images/rte/btn_bg_r.gif'/>" style="margin-left:6px;" alt="<spring:message code='button.goModify' />" />
	              	</span>
	           </li>
	  			<li>
	           	<span class="btn_blue_l">
	               	<a href="javascript:fn_delete();"><spring:message code="button.goDelete" /></a>
	                   <img src="<c:url value='/images/rte/btn_bg_r.gif'/>" style="margin-left:6px;" alt="<spring:message code='button.goDelete' />"/>
	              	</span>
	           </li>
			</c:if>
			<li>
				<span class="btn_blue_l">
					<a href="javascript:fn_print();"><spring:message code="button.print" /></a>
					<img src="<c:url value='/images/rte/btn_bg_r.gif'/>" style="margin-left: 6px;" alt="<spring:message code='button.print' />" />
				</span>
			</li>	
			<li>
				<span class="btn_blue_l">
					<a href="<c:url value="/target/divmng/list.do">
								<c:param name="place" value="${divMngVO.place}" />
							 </c:url>"><spring:message code="button.goList" /></a>
					<img src="<c:url value='/images/rte/btn_bg_r.gif'/>" style="margin-left: 6px;" alt="<spring:message code='button.goList' />" />
				</span>
			</li>			
		</ul>
	</div> -->
</form:form>

<script type="text/javascript" defer="defer">
	/* 수정 화면 function */	
	function fn_modify() {
		document.menuForm.method = "get";
	   	document.menuForm.action = "<c:url value='/target/divmng/update.do'/>";
	   	document.menuForm.submit();
	}
	
	/* 삭제 화면 function */
	function fn_delete() {
		if (confirm("<spring:message code="confirm.msg.askDel" />")){
			document.menuForm.method = "post";
    		document.menuForm.action = "<c:url value='/target/divmng/delete.do'/>";
    	   	document.menuForm.submit();	
    	}
	}
	
	/* 출력 */
	function fn_print(){
		var divPrintTitle = document.getElementById("divPrintTitle");
		divPrintTitle.style.display = "inline";
		printDiv($("#divPrintArea").html());
		divPrintTitle.style.display = "none";
	}
	
	/* 이미지 크게보기 */
	$(document).ready(function() {
		$("#imgViewer").fancybox({
			type: "image"
		});
	})
</script>