<%@ 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"%>
<form:form commandName="searchVO" name="searchForm" method="get">
	<div id="search">
		<ul>
			<li>
				<label for="place"><spring:message code="target.ferry.route" /></label>
				<form:select path="ferryRoute" cssClass="use">
					<c:forEach var="result" items="${routeList}" varStatus="status">
						<form:option value="${result.code}" label="${result.value}" />
					</c:forEach>
    			</form:select>
			</li>
			<li>
				<span class="btn_blue_l"> 
					<a href="javascript:fn_selectList();">
						<spring:message code="button.goSearch" />
					</a> 
					<img src="<c:url value='/images/rte/btn_bg_r.gif'/>" style="margin-left: 6px;" alt="<spring:message code="button.goSearch" />" />
				</span>
			</li>
		</ul>
	</div>
</form:form>
<div id="divPrintArea">
	<div id ="divPrintTitle" style="display: none;margin: 10px 0 10px 0;"><spring:message code="target.ferry" /></div>
	<form:form name="listForm" method="get">
		<input type="hidden" name="idx" />
		<!-- List -->
		<div id="table">
			검색결과&nbsp;:&nbsp;${ferryList.size()}건
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				summary="<spring:message code="target.ferry" /> 목록을 확인 할 수 있습니다.">
				<caption><spring:message code="target.ferry" /> 목록</caption>
				<thead>
					<tr>
						<th align="center" rowspan="2"><spring:message code="target.ferry.no" /></th>
						<th align="center" rowspan="2"><spring:message code="target.ferry.name" /></th>
						<th align="center" rowspan="2"><spring:message code="target.ferry.office" /></th>
						<th align="center" rowspan="2"><spring:message code="target.ferry.ton" /></th>
						<th align="center" rowspan="2"><spring:message code="target.ferry.ferrySosok" /></th>
						<th align="center" rowspan="2"><spring:message code="target.ferry.route" /></th>
						<th align="center" rowspan="2"><spring:message code="target.ferry.sailingDistance" /></th>
						<th align="center" rowspan="2"><spring:message code="target.ferry.ferryTime" /></th>
						<th align="center"><spring:message code="target.ferry.speed" /></th>
						<th align="center" colspan="3"><spring:message code="target.ferry.capacity" /></th>
						<th align="center" rowspan="2"><spring:message code="target.ferry.runCnt" /></th>
						<th align="center" rowspan="2"><spring:message code="target.ferry.sailingDate" /></th>
						<th align="center" rowspan="2"><spring:message code="target.ferry.isCooperate" /></th>
					</tr>
					<tr>
						<th align="center"><spring:message code="target.ferry.speedNor" /></th>
						<th align="center"><spring:message code="target.ferry.capacityTot" /></th>
						<th align="center"><spring:message code="target.ferry.guestCnt" /></th>
						<th align="center"><spring:message code="target.ferry.clueCnt" /></th>
					</tr>
				</thead>
				<tbody>
				<c:choose>
				<c:when test="${ferryList.size() > 0}">
					<c:forEach var="result" items="${ferryList}" varStatus="status">
					<tr>
						<td align="center" class="listtd"><c:out value="${status.index+1}" /></td>
						<td align="center" class="listtd">
							<a href="<c:url value="/target/ferry/view.do">
										<c:param name="serNo" value="${result.serNo}" />
									 </c:url>">
								<c:out value="${result.ferryName}" />
							</a>
						</td>
						<td align="center" class="listtd"><c:out value="${result.ferryOffice}" /></td>
						<td align="center" class="listtd"><c:out value="${result.ferryTon}" /></td>
						<td align="center" class="listtd"><c:out value="${result.ferrySosok}" /></td>
						<td align="center" class="listtd"><c:out value="${result.ferryRouteStr}" /></td>
						<td align="center" class="listtd"><c:out value="${result.sailingDistance}" /></td>
						<td align="center" class="listtd"><c:out value="${result.ferryTime}" /></td>
						<td align="center" class="listtd"><c:out value="${result.ferrySpeedNor}" /></td>
						<td align="center" class="listtd"><c:out value="${result.capacity}" /></td>
						<td align="center" class="listtd"><c:out value="${result.ferryGuestCnt}" /></td>
						<td align="center" class="listtd"><c:out value="${result.ferryClueCnt}" /></td>
						<td align="center" class="listtd"><c:out value="${result.runCntStr}" /></td>
						<td align="center" class="listtd"><c:out value="${result.sailingDate}" /></td>
						<td align="center" class="listtd"><c:out value="${result.isCooperateStr}" /></td>
					</tr>
					</c:forEach>
				</c:when>
				<c:otherwise>
					<tr>
						<td class="listtd" align="center" colspan="15">
							<spring:message code="msg.nodata" />
						</td>
					</tr>
				</c:otherwise>
				</c:choose>
				</tbody>
			</table>
		</div>
		<!-- /List -->
	</form:form>
</div>
<!-- /PrintArea -->
<form:form name="menuForm" method="get">
	<div id="sysbtn">
		<ul>
   			<c:if test="${loginUserVO.isAdmin}" >
   			<li>
        		<span class="btn_blue_l">
              		<a href="<c:url value="/target/ferry/add.do" />"><spring:message code="button.create" /></a>
              		<img src="<c:url value='/images/rte/btn_bg_r.gif'/>" style="margin-left:6px;" alt="<spring:message code="button.create" />"/>
        		</span>
   			</li>
   			</c:if>
			<li>
        		<span class="btn_blue_l">
              		<a href="javascript:fn_print();"><spring:message code="button.print" /></a>
              		<img src="<c:url value='/images/rte/btn_bg_r.gif'/>" style="margin-left:6px;" alt="<spring:message code="button.print" />"/>
        		</span>
   			</li>
		</ul>
	</div>
</form:form>

<script type="text/javaScript" defer="defer">
<!--
	/* 목록 화면 function */
	function fn_selectList() {
		document.searchForm.submit();
	}

	/* 출력 */
	function fn_print(){
		var divPrintTitle = document.getElementById("divPrintTitle");
		divPrintTitle.style.display = "inline";
		printDiv($("#divPrintArea").html());
		divPrintTitle.style.display = "none";
	}
//-->
</script>