<%@ 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="ckeditor" uri="http://ckeditor.com" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib prefix="ct" tagdir="/WEB-INF/tags" %>

<div class="search2">	
	<form:form commandName="reportSearchVO" name="searchForm" method="get">
		<form:hidden path="orderCol"/>
		<form:hidden path="orderAsc"/>
		<form:hidden path="pageIndex" />	
		<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="board.header.title" /></b> 　</li>
		 	<li class="w-300">
		 		<form:input path="subject"/>
		 	</li>
			<li>
				<span class="btn_blue"> 
					<a href="javascript:fn_search();"><spring:message code="button.goSearch" /></a>
				</span>
			</li>
		</ul>	  
	</form:form>	
</div>

<!-- List -->
<div id="table">
	<div class="pageinfo">
		<ct:pageInfo />
		<ul class="right btn-style">
			<li><a href="javascript:fn_get_excel();" class="btn_excel"></a></li>
			<li><a href="#" class="btn_reset" onclick="location.reload();"></a></li>
		</ul>
	</div>
	
	<table class="tbl_list3" width="100%" border="0" cellpadding="0" cellspacing="0" summary="게시판 목록을 확인 할 수 있습니다.">
		<caption class="hidden">게시판 목록</caption>
		<colgroup>
			<col width="110">
			<col width="100">
			<col width="?">
			<col width="75">			
		</colgroup>
		<thead>
			<tr>
				<th align="center" rowspan="2"><span class="order" value="in_seq"><spring:message code="report.list.num" /><img src="/images/cmmn/blank_1x1.png" /></span></th>
				<th align="center" rowspan="2"><span class="order" value="in_name"><spring:message code="report.search.reporter" /></span></th>
				<th align="center" rowspan="2"><span class="order" value="in_subject"><spring:message code="board.header.title" /></span></th>
				<th align="center" rowspan="2"><span class="order" value="in_infodate"><spring:message code="report.view.infodate" /></span></th>
				<th align="center" colspan="2" class="tbl_list3_col"><spring:message code="report.view.approval" /></th>
				<th align="center" colspan="7" class="tbl_list3_col"><spring:message code="report.type.judge" /></th>
				<th align="center" colspan="2" class="tbl_list3_col"><spring:message code="report.type.fullReport" /></th>
				<th align="center" rowspan="2"><span class="order" value="in_category1"><spring:message code="report.view.category1" /></span></th>
				<th align="center" rowspan="2"><span class="order" value="in_category2"><spring:message code="report.view.category2" /></span></th>
				<th align="center" rowspan="2"><span class="order" value="in_category3"><spring:message code="report.view.category3" /></span></th>
				<th align="center" rowspan="2"><span class="order" value="in_category4"><spring:message code="report.view.category4" /></span></th>
			</tr>
			<tr>
				<th align="center"><spring:message code="member.view.rptPermission.head" /></th>
				<th align="center"><spring:message code="member.view.rptPermission.section" /></th>
				<th align="center"><spring:message code="report.type.newsflash" /></th>
				<th align="center"><spring:message code="report.type.judge" /></th>
				<th align="center"><spring:message code="report.type.middle" /></th>
				<th align="center"><spring:message code="report.type.notice" /></th>
				<th align="center"><spring:message code="report.type.record" /></th>
				<th align="center"><spring:message code="report.type.survey" /></th>
				<th align="center"><spring:message code="report.type.reference" /></th>
				<th align="center"><spring:message code="report.type.fullReport1" /></th>
				<th align="center"><spring:message code="report.type.fullReport2" /></th>
			</tr>
		</thead>
		<c:forEach var="result" items="${reportList}" varStatus="status">
			<tr>
				<td align="left">
					<c:out value="${result.docNo}"/>
				</td>
				<td align="center">
					<c:out value="${result.reporter}" />
				</td>
				<td align="left">
					<a href="<c:url value="/report/updateMyReport.do"><c:param name="inSeq" value="${result.inSeq}" /></c:url>">
						<c:out value="${result.inSubject}"/>
					</a>
				</td>
				<td align="center">
					<c:out value="${result.inInfodate}" />
				</td>
				<td align="center">
					<c:out value="${result.isHead}" />
				</td>
				<td align="center">
					<c:out value="${result.isSection}" />
				</td>
				<td align="center" class="bold">
					<c:out value="${result.isJudge1}" />
				</td>
				<td align="center" class="bold">
					<c:out value="${result.isJudge2}" />
				</td>
				<td align="center" class="bold">
					<c:out value="${result.isJudge3}" />
				</td>
				<td align="center" class="bold">
					<c:out value="${result.isJudge4}" />
				</td>
				<td align="center" class="bold">
					<c:out value="${result.isJudge5}" />
				</td>
				<td align="center" class="bold">
					<c:out value="${result.isJudge6}" />
				</td>
				<td align="center" class="bold">
					<c:out value="${result.isJudge7}" />
				</td>
				<td align="center" class="bold">
					<c:out value="${result.isReport1}" />
				</td>
				<td align="center" class="bold">
					<c:out value="${result.isReport2}"/>
				</td>
				<td align="center">
					<c:out value="${result.inCategory1Str}"/>
				</td>
				<td align="center">
					<c:out value="${result.inCategory2Str}"/>
				</td>
				<td align="center">
					<c:out value="${result.inCategory3Str}"/>
				</td>
				<td align="center">
					<c:out value="${result.inCategory4Str}"/>
				</td>
			</tr>
		</c:forEach>
		<c:if test="${reportList.size() <= 0 }">
			<tr><td align="center" colspan="19"><spring:message code="report.nodata" /></td></tr>
		</c:if>
	</table>
</div>
<!-- /List -->

<div id="paging">
	<ui:pagination paginationInfo="${paginationInfo}" type="image" jsFunction="fn_link_page" />
</div>

<div class="board_buttom">
	<ul class="btn-style right">			
		<li><a href="/report/add.do" class="btn_create"><spring:message code="button.writeReport" /></a></li>
	</ul>
</div>

<script type="text/javascript">
	$(document).ready(function(){
		//날짜 설정
		$('input[id^="date"]').datepicker({dateFormat: 'yy-mm-dd'});
		
		// 조건보기
		$('#btnCondigion').click(function(){
			$('#tbCondition').toggle();
		});

		// 정렬
		if (document.searchForm.orderCol && document.searchForm.orderCol.value.length > 0) {
			$('input[value=' + document.searchForm.orderCol.value + '] img')
				.attr('src', (document.searchForm.orderAsc.value == 'DESC') ? '/images/cmmn/order_desc.gif' : '/images/cmmn/order_asc.gif');
		}
		$('.order').click(function(){
			var ordercode = $(this).attr('value');
			if (document.searchForm.orderCol.value == ordercode) {
				if (document.searchForm.orderAsc.value == 'ASC') {
					document.searchForm.orderAsc.value = 'DESC';
				} else {
					document.searchForm.orderAsc.value = 'ASC';
				}
			} else {
				document.searchForm.orderAsc.value = 'DESC';
			}
			document.searchForm.orderCol.value = ordercode;
			
			document.searchForm.action = "<c:out value='/report/myList.do' />";
			document.searchForm.submit();
		});
	});

	// 검색하기
	function fn_search() {
		document.searchForm.action = "<c:out value='/report/myList.do' />";
		document.searchForm.submit();
	}

	//견문 엑셀받기
	function fn_get_excel() {
		alert('개발중');
		document.searchForm.action = "<c:out value='/report/myListExcel.do' />";
		document.searchForm.submit();
	}
	
	/* pagination 페이지 링크 function */
	function fn_link_page(pageNo) {
		document.searchForm.pageIndex.value = pageNo;
		document.searchForm.action = "<c:url value='/report/myList.do'/>";
		document.searchForm.submit();
	}
-->
</script>
