<%@ 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="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


<form:form commandName="reportSearchVO" id="searchForm" name="searchForm" method="post">
	<form:hidden path="statsType"/>	
	<div class="search2 m-bottom">
		<ul>
		 	<li><b><spring:message code="report.search.period" /></b></li>
		 	<li class="margin-left">
		 		<form:input path="dateStart" /> ~ 
		 		<form:input path="dateEnd"/>
		 	</li>	 
		 	<%-- <li class="margin-left"><b><spring:message code="report.search.reporter" /></b></li>
		 	<li class="margin-left">
		 		<form:input path="writeName"/>
		 	</li> --%>
			<%-- <li class="margin-left">
				<b><spring:message code="report.search.id" /></b>　
			</li>
			<li class="margin-left">
				<form:input path="writeId"/>
			</li> --%>
		</ul>	       	       
	</div>
	
	<div class="search3 m-bottom">
		<div class="search_list">
			<div class="list-box list1">
				<h2 class="select_title"><spring:message code="report.search.place" /></h2>
				<ul class="select_list">
				<c:choose>
						<c:when test="${myGroupCode eq 1}">
							<li>
								<input type="checkbox" name="places" checked="checked" disabled="disabled" value="${myPlaceCode}"/>
								<c:out value="${myPlaceName}"></c:out>
							</li>
						</c:when>
						<c:otherwise>
							<c:forEach var="placeList" items="${placeList}">
								<li>
									<form:checkbox path="places" value="${placeList.code}" label="${placeList.name}" />
								</li>
							</c:forEach>
						</c:otherwise>
					</c:choose>
				</ul>
			</div>			
		</div>	  
		
		<div class="search_list">
			<div class="list-box list2">
				<h2 class="select_title"><spring:message code="report.view.appraisal" /></h2>
				<ul class="select_list">
					<c:forEach var="judgeCode" items="${judgeList}">
						<li><form:checkbox path="category4" value="${judgeCode.code}" label="${judgeCode.name}" /></li>
					</c:forEach>
					<input type="hidden" id="hdSelectedJudge" name="hdSelectedJudge" />
				</ul>
			</div>
		</div>
		
		<div class="search_list">
			<div class="list-box list3">
				<h2 class="select_title"><spring:message code="report.view.category1" /><form:checkbox path="searchCate1"/></h2>
				<ul class="select_list">
					<c:forEach var="category" items="${category1}">
					<li><form:checkbox path="category1" value="${category.key}" label="${category.value}" /></li>
					</c:forEach>
				</ul>
			</div>
			<div class="list-box list4">
				<h2 class="select_title"><spring:message code="report.view.category2" /><form:checkbox path="searchCate2"/></h2>
				<ul class="select_list">
					<c:forEach var="category" items="${category2}">
					<li><form:checkbox path="category2" value="${category.key}" label="${category.value}" /></li>
				</c:forEach>
				</ul>
			</div>
		</div>	            
	</div>
	
</form:form>

	<div class="boardviewinfo m-top">
		<ul class="right btn-style">
			<li><a href="javascript:fn_categoryStats();"><spring:message code="report.stats.category" /></a></li>
			<li><a href="javascript:fn_categoryExcel();"><spring:message code="report.stats.categoryExcel" /></a></li>
			<li><a href="javascript:fn_judgeStats();"><spring:message code="report.stats.judge" /></a></li>
			<li><a href="javascript:fn_judgeExcel();"><spring:message code="report.stats.judgeExcel" /></a></li>
		</ul>	
	</div>

<script type="text/javaScript" language="javascript" defer="defer">
<!--
	$(document).ready(function(){
		//날짜 설정
		$('input[id^="date"]').datepicker({dateFormat: 'yy-mm-dd'});
		
		var dateS = "<c:out value='${reportSearchVO.dateStart}'/>";
		if (dateS == null || dateS == '') {
			var today = new Date();
			$('#dateEnd').val($.datepicker.formatDate('yy-mm-dd', today));
			today.setYear(today.getFullYear()-1);
			$('#dateStart').val($.datepicker.formatDate('yy-mm-dd', today));
		}
		
	});

	//분야별 통계
	function fn_categoryStats() {
		document.searchForm.statsType.value = "C";
		document.searchForm.action = "<c:out value='/report/statsResult.do' />";
		document.searchForm.submit();
	}
	
	//분야별 엑셀받기
	function fn_categoryExcel() {
		document.searchForm.statsType.value = "C";
		document.searchForm.action = "<c:out value='/report/statsExcel.do' />";
		document.searchForm.submit();
	}

	//평가별 통계
	function fn_judgeStats() {
		document.searchForm.statsType.value = "J";
		document.searchForm.action = "<c:out value='/report/statsResult.do' />";
		document.searchForm.submit();
	}
	
	//평가별 엑셀받기
	function fn_judgeExcel() {
		document.searchForm.statsType.value = "J";
		document.searchForm.action = "<c:out value='/report/statsExcel.do' />";
		document.searchForm.submit();
	}
	
-->
</script>