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


<div>
<h1 class="searchResults" style="padding : 20px 0 10px;">통합검색결과</h1>
	<div class="find_data" style="font-weight : 600;">검색결과 : 총 <span class="clr_yellow">${data.totalCnt}</span>건 관련 글 발견</div>
	<ul class="resultList" style="border-top : 2px solid #29559f; margin : 30px 0 0; padding : 15px 0 0;">
		<c:forEach items="${data.list}" var="board">
	<p class="second_title" style="font-weight : 600;">${board.name} <span class="clr_red">${board.cnt}</span> 건</p><br/>
			<c:set var="cnt" value="1"></c:set>
			<c:forEach items="${board.contentList}" var="item" varStatus="status">
			<li>
				<a href="/bbs/view.do?bdIdx=${item.bdIdx}&bbsId=${item.bbsId}">${cnt}. [제목]${item.bdSubject}</a>
				<span class="result_date"> (<fmt:formatDate value="${item.bdRegdate}" pattern="yyyy-MM-dd" />)</span>
			</li>
			<c:set var="cnt" value="${cnt + 1}"></c:set>
			</c:forEach>
			<c:forEach items="${board.subjectList}" var="item">
			<li>
				<a href="/bbs/view.do?bdIdx=${item.bdIdx}&bbsId=${item.bbsId}">${cnt}. [본문]${item.bdContent}</a>
				<span class="result_date"> (<fmt:formatDate value="${item.bdRegdate}" pattern="yyyy-MM-dd" />)</span>
			</li>
			<c:set var="cnt" value="${cnt + 1}"></c:set>
			</c:forEach>
			<c:forEach items="${board.fileList}" var="item">
			<li>
				<a href="/bbs/view.do?bdIdx=${item.bdIdx}&bbsId=${item.bbsId}">${cnt}. [첨부파일]${item.bdFilenames}</a>
				<span class="result_date"> (<fmt:formatDate value="${item.bdRegdate}" pattern="yyyy-MM-dd" />)</span>
			</li>
			<c:set var="cnt" value="${cnt + 1}"></c:set>
			</c:forEach>
			<c:forEach items="${board.nameList}" var="item">
			<li>
				<a href="/bbs/view.do?bdIdx=${item.bdIdx}&bbsId=${item.bbsId}">${cnt}. [작성자]${item.usrName}(${item.bdSubject})</a>
				<span class="result_date"> (<fmt:formatDate value="${item.bdRegdate}" pattern="yyyy-MM-dd" />)</span>
			</li>
			<c:set var="cnt" value="${cnt + 1}"></c:set>
			</c:forEach>
		</c:forEach>
	</ul>
</div>
