<%@ 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>