<%@ 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="table">
   	<table class="tbl_add">	
   		<colgroup>
  			<col width="166">
  			<col width="334">  			
  			<col width="166">  			
  			<col width="334"> 		
  		</colgroup>
		<tbody>
			<tr>
				<th><label for="title"><spring:message code="equip.num" /></label></th>
				<td class="tbtd_content" colspan="1">
					<c:out value="${equipVO.num}" /> 호
				</td>
				
				<td class="tbtd_content" colspan="2" rowspan="8" style="background-color:#fefefe;">
					<c:if test="${equipVO.fileName3 eq null }">
						<img src="/images/basic_img.jpg" style="max-width:480px;"/>
					</c:if>
					<c:if test="${equipVO.fileName3 ne null and equipVO.fileName3 ne ' '}">
						<a href="<spring:message code="Equip.fileStoreUrl" /><c:out value="${equipVO.fileName3}"/>" target="_blank"><img src="<spring:message code="Equip.fileStoreUrl"/><c:out value="${equipVO.fileName3}" />" style="max-width:480px;"/></a>	
					</c:if>					
				</td>
			</tr>
			<tr>
				<th><label for="title"><spring:message code="equip.police" /></label></th>
				<td class="tbtd_content" colspan="1">
					<c:out value="${equipVO.policeStr}" />
				</td>
			</tr>
			<tr>
				<th><label for="title"><spring:message code="equip.equipType" /></label></th>
				<td class="tbtd_content" colspan="1">
					<c:out value="${equipVO.equipTypeName}" />
				</td>
			</tr>
			<tr>
				<th><label for="title"><spring:message code="equip.equipName" /></label></th>
				<td class="tbtd_content" colspan="1">
					<c:out value="${equipVO.equipName}" />
				</td>
			</tr>
			<tr>
				<th><label for="title"><spring:message code="equip.buyDate" /></label></th>
				<td class="tbtd_content" colspan="1">
					<c:out value="${equipVO.buyDate}" />
				</td>
			</tr>
			<tr>
				<th><label for="title"><spring:message code="equip.useTerm" /></label></th>
				<td class="tbtd_content" colspan="1">
					<c:out value="${equipVO.useTerm}" />
				</td>
			</tr>
			<tr>
				<th><label for="title"><spring:message code="equip.standard" /></label></th>
				<td class="tbtd_content" colspan="1">
					<c:out value="${equipVO.standard}" />
				</td>
			</tr>
			<tr>
				<th><label for="title"><spring:message code="equip.purpose" /></label></th>
				<td class="tbtd_content" colspan="1">
					<c:out value="${equipVO.purpose}" />
				</td>
			</tr>			
			<tr>
				<th>
					<label for="title"><spring:message code="equip.buyPlace" /></label>
				</th>
				<td>
					<c:out value="${equipVO.buyPlace}" />
				</td>
				<th><label for="title"><spring:message code="equip.price" /></label></th>
				<td>
					<c:out value="${equipVO.price}" />
				</td>
			</tr>
			<tr>
				<th class="tbtd_caption"><label for="title"><spring:message code="equip.madeIn" /></label></th>
				<td>
					<c:out value="${equipVO.madeIn}" />
				</td>
				<th><label for="title"><spring:message code="equip.serialNo" /></label></th>
				<td>
					<c:out value="${equipVO.serialNo}" />
				</td>
			</tr>				
	   		<tr>
	   			<th><label for="contents"><spring:message code="equip.useSection" /></label></th>
	   			<td colspan="3">
						<c:out value="${equipVO.useSection}"/><br/>
						<a href="<c:url value="/equip/download.do">								
								<c:param name="serNo" value="${equipVO.serNo}" />
								<c:param name="fileName" value="${equipVO.fileName1 }" />
							  </c:url>" target="_blank">
				       	<c:out value="${equipVO.fileName1}"/>
				       	</a><br>
					
				</td>
			</tr>
   			
  			<tr>
				<th><label for="title"><spring:message code="equip.operate" /></label></th>
				<td colspan="3">
					<c:out value="${equipVO.operate}"/><br/>
					<a href="<c:url value="/equip/download.do">								
								<c:param name="serNo" value="${equipVO.serNo}" />
								<c:param name="fileName" value="${equipVO.fileName2 }" />
							  </c:url>" target="_blank">
				       	<c:out value="${equipVO.fileName2}"/>
				       	</a><br>
				</td>
			</tr>
			<tr>
				<th><label for="title"><spring:message code="equip.bigo" /></label></th>
				<td colspan="3">
					<c:out value="${equipVO.bigo}"/>
				</td>
			</tr>   	
  		</tbody>	
	</table>
</div>
<form:form commandName="equipSearchVO" name="listForm" method="post">
	<form:hidden path="type" name="type" value="${equipVO.equipType }"/>
</form:form>
<form:form commandName="equipVO" name="menuForm" method="post">
	
	<form:hidden path="serNo" />
	<form:hidden path="equipType"/>
	<div class="boardviewinfo">
		<ul class="right btn-style">
  			<li>
  				<a href="javascript:fn_selectList();"><spring:message code="button.goList" /></a>
            </li>
            
   			<c:if test="${ loginUserVO.place1 eq 'PS00' or ( loginUserVO.authAdmin == 1 and equipVO.police eq loginUserVO.place1 ) }">
   			   	<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>
   		</ul>
	</div>	
	<!--<div id="sysbtn">
		<a href="javascript:fn_selectList();"><spring:message code="button.goList" /></a>
		<c:if test="${loginUserVO.authAdmin == 1 || loginUserVO.userid == incidentVO.writer}">
  		<a href="javascript:fn_modify();"><spring:message code="button.goModify" /></a>
        <a href="javascript:fn_delete();"><spring:message code="button.goDelete" /></a>
		</c:if>
	</div>-->
</form:form>
<div style="display:none">
	writer: <c:out value="${equipVO.writer }"/>
    loginid: <c:out value="${loginUserVO.userid }"/>
</div>

<script type="text/javascript" defer="defer">
<!--
	/* 글 목록 화면 function */
	function fn_selectList() {
		document.listForm.action = "<c:url value='/equip/equipList.do'/>";
		document.listForm.submit();
	}
	
	function fn_modify() {
		document.menuForm.method = "get";
	   	document.menuForm.action = "<c:url value='/equip/equipAdd.do'/>";
	   	document.menuForm.submit();
	}
	
	function fn_delete() {
		if (confirm("<spring:message code="confirm.msg.askDel" />")){
			document.menuForm.method = "post";
    		document.menuForm.action = "<c:url value='/equip/equipDelete.do'/>";
    	   	document.menuForm.submit();	
    	}
	}
	-->
</script>