<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ page import="kcg.faics.sec.LoginUserVO"%>
<% 
	LoginUserVO userVO = (LoginUserVO) session.getAttribute("userVO");
%>
<script type="text/javaScript" language="javascript" defer="defer">
	<!--
	/* 목록 화면 function */
    function fn_searchList() {
       	document.searchForm.action = "<c:url value='/equip/useStateList.do'/>";
       	document.searchForm.submit();
    }
	/* 등록 화면 이동 function */
    function fn_goAddPage() {
       	document.searchForm.method = "post";
       	document.searchForm.action = "<c:url value='/equip/useStateAddView.do'/>";
       	document.searchForm.submit();
    }
	/* 화면 출력 function */
    function fn_goPrint() {
    	var printThis = document.getElementById("table").innerHTML;
    	printDiv(printThis);
    }
	/* 엑셀 다운로드 function */
    function fn_goExcel() {
       	document.searchForm.method = "post";
       	document.searchForm.action = "<c:url value='/equip/useStateExcel.do'/>";
       	document.searchForm.submit();
    }
	//-->
</script>

<form:form commandName="searchVO" name="searchForm" method="get">
		<form:hidden path="police" value="${userVO.place1}" />		
		<div class="search2">
			<ul>
				<li class="margin-left"><b>년도/분기</b> 　</li>
				<li class="form_search margin-left">
					<form:select path="year" cssClass="use">
						<c:forEach var="item" items="${equipStatusYearList}" varStatus="status">
			 				<form:option value="${item.uyear}" label="${item.uyear}년"/>
						</c:forEach>
			 		</form:select>
			 	</li>
			 	<li class="form_search">
					<form:select path="quater" cssClass="use">
						<form:option value="1" label="1분기" />
       					<form:option value="2" label="2분기" />
       					<form:option value="3" label="3분기" />
       					<form:option value="4" label="4분기" />
		 			</form:select>
				</li>
				<li>　<b>종류</b></li>
				<li class="form_radio">
					<form:radiobutton path="type" value="a"/>사용
					<form:radiobutton path="type" value="b"/>점검
				</li>
				<li class="margin-left">
					<span class="btn_blue"> 
						<a href="javascript:fn_searchList();"><spring:message code="button.inquiry" /></a>
					</span>
				</li>
			</ul>	       	       
       	</div>
</form:form>
<div class="pageinfo">
	<ul class="left2">
		<c:if test="${userVO.authAdmin == '1'}">
      			<li>
      	       		<a class="btn_create" href="javascript:fn_goAddPage();"><spring:message code="button.register" /></a>
      	        </li>
		</c:if>
	</ul>
	<ul class="right btn-style">		
		<li><a class="btn_print" href="javascript:fn_goPrint();"></a></li>
		<li><a class="btn_excel" href="javascript:fn_goExcel();"></a></li>
	</ul>	
</div>
<div id="table">		
	<table class="tbl_listview" width="100%" border="1" cellpadding="0" cellspacing="0">
		<thead>
			<tr>
				<th align="center"><spring:message code="equip.name" /></th>
				<th align="center"><spring:message code="equip.total" /></th>
				<th align="center"><spring:message code="equip.ps00" /></th>
				<th align="center"><spring:message code="equip.ps01" /></th>
				<th align="center"><spring:message code="equip.ps02" /></th>
				<th align="center"><spring:message code="equip.ps03" /></th>
				<th align="center"><spring:message code="equip.ps04" /></th>
				<th align="center"><spring:message code="equip.ps05" /></th>
				<th align="center"><spring:message code="equip.ps06" /></th>
				<th align="center"><spring:message code="equip.ps07" /></th>
				<th align="center"><spring:message code="equip.ps08" /></th>
				<th align="center"><spring:message code="equip.ps09" /></th>
				<th align="center"><spring:message code="equip.ps10" /></th>
				<th align="center"><spring:message code="equip.ps11" /></th>
				<th align="center"><spring:message code="equip.ps12" /></th>
				<th align="center"><spring:message code="equip.ps13" /></th>
				<th align="center"><spring:message code="equip.ps14" /></th>
				<th align="center"><spring:message code="equip.ps15" /></th>
				<th align="center"><spring:message code="equip.ps16" /></th>
				<th align="center"><spring:message code="equip.ps17" /></th>
				<th align="center"><spring:message code="equip.ps18" /></th>
				<th align="center"><spring:message code="equip.ps90" /></th>
				<th align="center"><spring:message code="equip.ps91" /></th>
				<th align="center"><spring:message code="equip.ps92" /></th>
				<th align="center"><spring:message code="equip.ps93" /></th>
				<th align="center"><spring:message code="equip.ps94" /></th>
			</tr>
		</thead>
		<c:forEach var="equipStatus" items="${equipStatusList}" varStatus="status">
			<tr>
				<td align="center"><c:out value="${equipStatus.gubun}" /></td>
				<td align="center"><c:out value="${equipStatus.total}" /></td>
				<td align="center"><c:out value="${equipStatus.ps00}" /></td>
				<td align="center"><c:out value="${equipStatus.ps01}" /></td>
				<td align="center"><c:out value="${equipStatus.ps02}" /></td>
				<td align="center"><c:out value="${equipStatus.ps03}" /></td>
				<td align="center"><c:out value="${equipStatus.ps04}" /></td>
				<td align="center"><c:out value="${equipStatus.ps05}" /></td>
				<td align="center"><c:out value="${equipStatus.ps06}" /></td>
				<td align="center"><c:out value="${equipStatus.ps07}" /></td>
				<td align="center"><c:out value="${equipStatus.ps08}" /></td>
				<td align="center"><c:out value="${equipStatus.ps09}" /></td>
				<td align="center"><c:out value="${equipStatus.ps10}" /></td>
				<td align="center"><c:out value="${equipStatus.ps11}" /></td>
				<td align="center"><c:out value="${equipStatus.ps12}" /></td>
				<td align="center"><c:out value="${equipStatus.ps13}" /></td>
				<td align="center"><c:out value="${equipStatus.ps14}" /></td>
				<td align="center"><c:out value="${equipStatus.ps15}" /></td>
				<td align="center"><c:out value="${equipStatus.ps16}" /></td>
				<td align="center"><c:out value="${equipStatus.ps17}" /></td>
				<td align="center"><c:out value="${equipStatus.ps18}" /></td>
				<td align="center"><c:out value="${equipStatus.ps90}" /></td>
				<td align="center"><c:out value="${equipStatus.ps91}" /></td>
				<td align="center"><c:out value="${equipStatus.ps92}" /></td>
				<td align="center"><c:out value="${equipStatus.ps93}" /></td>
				<td align="center"><c:out value="${equipStatus.ps94}" /></td>
			</tr>
		</c:forEach>
	</table>
</div>