<%@ 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" %>
<style>table {table-layout: fixed;}</style>

<form:form commandName="reportSearchVO" id="searchForm" name="searchForm" method="post">
	<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="judges" value="${judgeCode.code}" label="${judgeCode.name}" /></li>
					</c:forEach>
				</ul>
			</div>
		</div>
		<div class="search_list">
			<div class="list-box list3">
				<h2 class="select_title"><spring:message code="report.view.category1" /></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" /></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>
			
	<div class="search2">
		<ul>
		 	<li><b><spring:message code="board.header.title" /></b>　</li>
		 	<li class="w-320 margin-left">
		 		<form:input path="subject"/>
		 	</li>	 
		 	<li class="margin-left"><b><spring:message code="report.search.attachnm" /></b></li>
		 	<li>
				<input type="button" value="<spring:message code="button.goSearch" />" onclick="javascript:fn_search();" />
			</li>  
			<li>
				<input class="gray" type="button" value="<spring:message code="button.getExcel" />" onclick="javascript:fn_get_excel();" />
			</li> 
		</ul>				    	       
	</div>	
</form:form>
	
<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.length <= 0) {
			var today = new Date();
			$('#dateEnd').val($.datepicker.formatDate('yy-mm-dd', today));
			today.setMonth(today.getMonth()-1);
			$('#dateStart').val($.datepicker.formatDate('yy-mm-dd', today));
		}
		
	});

	//견문 검색하기
	function fn_search() {
		document.searchForm.action = "<c:out value='/report/searchResult.do' />";
		document.searchForm.submit();
	}
	
	//견문 엑셀받기
	function fn_get_excel() {
		document.searchForm.action = "<c:out value='/report/listtoexcel.do' />";
		document.searchForm.submit();
	}
	
-->
</script>