<%@ 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="susa.in.view.title" /></label></th>
				<td class="tbtd_content" colspan="3">
					<c:out value="${incidentVO.title}" />
				</td>
			</tr>
			<tr>
				<th>
					<label for="title"><spring:message code="susa.in.view.place1" /></label>
				</th>
				<td>
					<c:out value="${incidentVO.place1Str}" />
				</td>
				<th><label for="title"><spring:message code="susa.in.view.chargeNm" /></label></th>
				<td>
					<c:out value="${incidentVO.chargeNm}" />
				</td>
			</tr>
			<tr>
				<th class="tbtd_caption"><label for="title"><spring:message code="susa.in.view.sdate" /></label></th>
				<td>
					<fmt:parseDate value="${incidentVO.sdate}" pattern="yyyyMMdd" var="sdate" scope="page" />
					<fmt:formatDate value="${sdate}" pattern="yyyy-MM-dd" />
				</td>
				<th><label for="title"><spring:message code="susa.in.view.edate" /></label></th>
				<td>
					<fmt:parseDate value="${incidentVO.edate}" pattern="yyyyMMdd" var="edate" scope="page" />
					<fmt:formatDate value="${edate}" pattern="yyyy-MM-dd" />
				</td>
			</tr>	
			<c:if test="${susaFileVO ne null && fn:length(susaFileVO) > 0}">
	   		<tr>
	   			<th><label for="contents"><spring:message code="board.view.attach" /></label></th>
	   			<td colspan="3">
					<c:forEach var="file" items="${susaFileVO}" varStatus="status">
						<a href="/susa/incident/download.do?seq=<c:out value="${file.seq}"/>" target="_blank">
				       	<c:out value="${file.orgName}"/>
				       	</a><br>
					</c:forEach>
				</td>
			</tr>
   			</c:if>	
  			<tr>
				<th><label for="title"><spring:message code="susa.in.view.contents" /></label></th>
				<td colspan="3">
					<c:out value="${incidentVO.contents}" />
				</td>
			</tr>
			<tr>
				<th><label for="title"><spring:message code="susa.in.view.result" /></label></th>
				<td colspan="3">
				<c:out value="${incidentVO.result}" />
				</td>
			</tr>   	
  		</tbody>	
	</table>
</div>

<form:form commandName="incidentVO" name="menuForm" method="post">
	<form:hidden path="idx" />
	<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.authAdmin == 1 || loginUserVo.userid == incidentVO.writer}">
   			   	<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>


<script type="text/javascript" defer="defer">
<!--
	/* 글 목록 화면 function */
	function fn_selectList() {
		document.menuForm.action = "<c:url value='/susa/incident/list.do'/>";
		document.menuForm.submit();
	}
	
	function fn_modify() {
		document.menuForm.method = "get";
	   	document.menuForm.action = "<c:url value='/susa/incident/update.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='/susa/incident/delete.do'/>";
    	   	document.menuForm.submit();	
    	}
	}
	-->
</script>