<%@ 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" %>
<% pageContext.setAttribute("newline", "\n"); %>
<style type="text/css">
.img {
	max-width: 570px;
}
</style>
<div id="divPrintArea">
	<div id ="divPrintTitle" style="display: none;margin: 10px 0 10px 0;">외사취약지</div>
	<div id="table">
	   	<table class="tbl_add">
			<colgroup>
				<col width="150"/>
				<col width="?"/>
			</colgroup>
			<tr>
				<th><label for="title"><spring:message code="target.wp.wpNoStr" /></label></th>
				<td><c:out value="${weakPlaceVO.wpNoStr}" /></td>
			</tr>
			<tr>
				<th><label for="title"><spring:message code="target.wp.name" /></label></th>
				<td><c:out value="${weakPlaceVO.name}" /></td>
			</tr>
			<tr>
				<th><label for="title"><spring:message code="target.wp.location" /></label></th>
				<td><c:out value="${weakPlaceVO.location}" /></td>
			</tr>
			<tr>
				<th><label for="title"><spring:message code="target.wp.comments" /></label></th>
				<td><c:out value="${fn:replace( weakPlaceVO.comments, newline, '<br/>')}" escapeXml="false" /></td>
			</tr>	
		   	<c:if test="${fn:length(weakPlaceVO.filename1) > 0}">
		   	<tr>
		   		<th><label for="contents"><spring:message code="target.wp.filename1" /></label></th>
				<td>
					<c:if test="${filename1Ext == 'jpg' or filename1Ext == 'bmp' or filename1Ext == 'gif'}">
						<img src="<c:url value='/target/weakplace/download.do'>
									<c:param name="place1" value="${weakPlaceVO.place1}"/>
									<c:param name="wpNo" value="${weakPlaceVO.wpNo}"/>
									<c:param name="seq" value="1"/>
								  </c:url>" alt="<spring:message code='target.wp.filename1' />" class="img" /><br />
					</c:if>
					<a href="<c:url value='/target/weakplace/download.do'>
								<c:param name="place1" value="${weakPlaceVO.place1}"/>
								<c:param name="wpNo" value="${weakPlaceVO.wpNo}"/>
								<c:param name="seq" value="1"/>
							 </c:url>" target="_blank">
						<c:out value="${weakPlaceVO.filename1}"/>
			       	</a>
				</td>
			</tr>
		   	</c:if>
		   	<c:if test="${fn:length(weakPlaceVO.filename2) > 0}">
		   	<tr>
		   		<th><label for="contents"><spring:message code="target.wp.filename2" /></label></th>
				<td>
					<a href="<c:url value='/target/weakplace/download.do'>
								<c:param name="place1" value="${weakPlaceVO.place1}"/>
								<c:param name="wpNo" value="${weakPlaceVO.wpNo}"/>
								<c:param name="seq" value="2"/>
							 </c:url>" target="_blank">
						<c:out value="${weakPlaceVO.filename2}"/>
			       	</a>
				</td>
			</tr>
		   	</c:if>
		</table>
	</div>
</div>
<form:form commandName="weakPlaceVO" name="menuForm" method="post">
	<form:hidden path="place1" />
	<form:hidden path="wpNo" />
	<div class="boardviewinfo">
		<ul class="right btn-style">
		<c:if test="${loginUserVO.authAdmin == 1}">
  			<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="/target/weakplace/list.do"><spring:message code="button.goList" /></a>
            </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/weakplace/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/weakplace/delete.do'/>";
    	   	document.menuForm.submit();	
    	}
	}
	
	/* 출력 */
	function fn_print(){
		var divPrintTitle = document.getElementById("divPrintTitle");
		divPrintTitle.style.display = "inline";
		printDiv($("#divPrintArea").html());
		divPrintTitle.style.display = "none";
	}
	-->
</script>