<%@ page 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"%>
	<div class="pageinfo">
		<ul class="left">		
			 <c:if test="${arrestCntList eq null }"><li>&lt; <spring:message code="arrest.list.searchresult"/>  :0건  &gt;</li></c:if>
			 <c:if test="${arrestCntList ne null }"><li>&lt; <spring:message code="arrest.list.searchresult"/>  :<c:out value="${arrestCntList.totalCnt }"/><spring:message code="arrest.list.count"/>  &gt;</li></c:if>
		</ul>
		<ul class="right btn-style">
			<!-- <li><a class="btn_print" href="javascript:fn_print();"></a></li> -->
			<c:choose>
			<c:when test="${userVO.place1 eq 'PS00' }">
				<li><a class="btn_excel" href="javascript:fn_goExcel();"></a></li>
			</c:when>		
			<c:when test="${userVO.place1 ne 'PS00' and userVO.isAdmin eq true }">
				<li><a class="btn_excel" href="javascript:fn_goExcel();"></a></li>
			</c:when>
			<c:otherwise>
				<li><a class="btn_excel" href="javascript:alert('담당자만 엑셀다운로드가 가능합니다.');"></a></li>
			</c:otherwise>	
			</c:choose>
		</ul>	
		
	</div>
	<div id ="divPrintTitle" style="display: none;margin: 10px 0 10px 0;"><spring:message code="arrest.list.title"/></div>
	<div class="tbl_scroll_wrap" style="width:100%">
		<div id="divPrintHeader" class="tbl_scroll_h">
		<table id="tblArrestHeader" class="tbl_listview" border="0" cellpadding="0" cellspacing="0" style="table-layout:fixed;">
			<caption class="hidden">중국어선 나포정보 목록현황</caption>
			<colgroup>
				<col width="50px"/>
				<col width="60px"/>
				<col width="80px"/>
				<col width="220px"/>
				<col width="170px"/>
				<col width="50px"/>
				<col width="40px"/>
				<col width="65px"/>
				<col width="55px"/>
				<col width="55px"/>
				<col width="40px"/>
				<col width="130px"/>
				<col width="80px"/>
				<col width="80px"/>
				<col width="50px"/>
				<col width="50px"/>
				<col width="45px"/>
				<col width="50px"/>
				<col width="75px"/>
				<col width="50px"/>
				<col width="80px"/>
				<col width="65px"/>
				<col width="85px"/>
				<col width="55px"/>
				<col width="45px"/>
				<col width="90px"/>
				<col width="80px"/>
				<col width="45px"/>
				<col width="100px"/>
				<col width="65px"/>
				<col width="45px"/>
				<col width="65px"/>
				<col width="45px"/>
				<col width="45px"/>
				<col width="50px"/>
				<col width="45px"/>
				<col width="55px"/>
				<col width="55px"/>
				<col width="45px"/>
				
				<col width="60px"/>
				<col width="45px"/>
				<col width="80px"/>
				<col width="80px"/>
				<col width="50px"/>
				<col width="85px"/>
				<col width="50px"/>
				<col width="55px"/>
				<col width="*"/>
			</colgroup>
			<thead>
				<tr>
					<th rowspan="2" scope="col">NO</th>
					<th rowspan="2" scope="col"><spring:message code="arrest.list.status"/></th>
					<th rowspan="2" scope="col"><spring:message code="arrest.arrestDate"/></th>
					<th rowspan="2" scope="col"><spring:message code="arrest.violatePlace"/></th>
					<th rowspan="2" scope="col"><spring:message code="arrest.violateType"/></th>
					<th colspan="5" scope="col"><spring:message code="arrest.invasionType"/></th>
					<th rowspan="2" scope="col"><spring:message code="arrest.nllYn"/></th>
					<th colspan="2" scope="col"><spring:message code="arrest.agencyType"/></th>
					<th colspan="5" scope="col"><spring:message code="arrest.shipData"/></th>
					<th rowspan="2" scope="col"><spring:message code="arrest.captain"/>(<spring:message code="arrest.age"/>)</th>
					<th rowspan="2" scope="col"><spring:message code="arrest.shipType"/></th>
					<th colspan="3" scope="col"><spring:message code="arrest.violation"/></th>
					<th colspan="2" scope="col"><spring:message code="arrest.procCondition"/></th>
					<th colspan="2" scope="col"><spring:message code="arrest.marginPayment"/></th>
					<th colspan="2" scope="col"><spring:message code="arrest.noMarginPayment"/></th>
					<th colspan="5" scope="col"><spring:message code="arrest.shipProcType"/></th>
					<th colspan="5" scope="col"><spring:message code="arrest.detention"/></th>
					<th rowspan="2" scope="col"><spring:message code="arrest.noSuspension"/><br/><spring:message code="arrest.withoutDetention"/></th>
					<th colspan="3" scope="col"><spring:message code="arrest.feildSurvey"/></th>
					<th rowspan="2" scope="col"><spring:message code="arrest.leadDistance"/><br>(<spring:message code="arrest.knot"/>)</th>
					<th rowspan="2" scope="col"><spring:message code="arrest.trustMoney"/></th>
					<th colspan="3" scope="col"><spring:message code="arrest.fishingGear"/></th>
				</tr>
				<tr>
					<th scope="col"><spring:message code="arrest.invasionType.territWaters"/></th>
					<th scope="col"><spring:message code="arrest.invasionType.eez"/></th>
					<th scope="col"><spring:message code="arrest.invasionType.particularBan"/></th>
					<th scope="col"><spring:message code="arrest.invasionType.withoutLicense"/></th>
					<th scope="col"><spring:message code="arrest.invasionType.specBatl"/></th>
					<th scope="col"><spring:message code="arrest.agencyType"/></th>
					<th scope="col"><spring:message code="arrest.list.agencyVessel"/></th>
					<th scope="col"><spring:message code="arrest.shipName"/></th>
					<th scope="col"><spring:message code="arrest.shipTonnage"/></th>
					<th scope="col"><spring:message code="arrest.shipCrewCnt"/></th>
					<th scope="col"><spring:message code="arrest.shipQuality"/></th>
					<th scope="col"><spring:message code="arrest.shipMent"/></th>
					<th scope="col"><spring:message code="arrest.type"/></th>
					<th scope="col"><spring:message code="arrest.vioCnt2"/></th>
					<th scope="col"><spring:message code="arrest.vioPriatedAmt2"/></th>
					
					<th scope="col"><spring:message code="arrest.procCondition.underExam"/></th>
					<th scope="col"><spring:message code="arrest.procCondition.finish"/></th>
					
					<th scope="col"><spring:message code="arrest.marginPaymentAmt2"/></th>
					<th scope="col"><spring:message code="arrest.marginPaymentDate"/></th>
					
					<th scope="col"><spring:message code="arrest.marginPayment.default"/></th>
					<th scope="col"><spring:message code="arrest.marginPayment.defaultAmt2"/></th>
					
					<th scope="col"><spring:message code="arrest.shipProcType.commission"/></th>
					<th scope="col"><spring:message code="arrest.shipProcType.eviction"/></th>
					<th scope="col"><spring:message code="arrest.shipProcType.direct"/></th>
					<th scope="col"><spring:message code="arrest.shipProcType.discard"/></th>
					<th scope="col"><spring:message code="arrest.shipProcType.forfeit"/></th>
					
					<th scope="col"><spring:message code="arrest.totalCount"/></th>
					<th scope="col"><spring:message code="arrest.captainCount"/></th>
					<th scope="col"><spring:message code="arrest.mateCount"/></th>
					<th scope="col"><spring:message code="arrest.engineerCount"/></th>
					<th scope="col"><spring:message code="arrest.crewCount"/></th>
					<th scope="col"></th>			
					<th scope="col"><spring:message code="arrest.fieldArrestDate"/></th>
					<th scope="col"><spring:message code="arrest.fieldReleaseDate"/></th>
					<th scope="col"><spring:message code="arrest.gearCast"/></th>
					<th scope="col"><spring:message code="arrest.gearWidth"/></th>
					<th scope="col"><spring:message code="arrest.gearEtc"/></th>
				</tr>
			</thead>
			<tbody>
				<c:if test="${arrestCntList eq null  or arrestCntList.totalCnt eq 0 }">
				<tr style="background-color:#ececec;">
					<th scope="row" colSpan="49" style="height:40px;text-align:left;"><div id="divEmpty">데이터가 존재하지 않습니다.</div></th>				
				</tr>
				</c:if>
				<c:if test="${arrestCntList.totalCnt > 0}">
					<tr style="background-color:#efefef;">
						<th scope="row">계</th>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.invasion3 }" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.invasion4 }" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.invasion1 }" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.invasion2 }" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.specBatlCnt }" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.nllCnt }" pattern="#,###"/></td>
											
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td class="text_num"><fmt:formatNumber value="${arrestCntList.shipCrewCnt }" pattern="#,###"/></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td class="text_num"><fmt:formatNumber value="${arrestCntList.vioCnt}" pattern="#,###"/></td>
						<td class="text_num"><fmt:formatNumber value="${arrestCntList.vioPriatedAmt}" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.procCondN}" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.procCondY}" pattern="#,###"/></td>
						<td class="text_num"><fmt:formatNumber value="${arrestCntList.marginPaymentAmt}" pattern="#,###"/></td>
						<td></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.notPayment}" pattern="#,###"/></td>
						<td class="text_num"><fmt:formatNumber value="${arrestCntList.noMarginPaymentAmt}" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.shipProcTypeA}" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.shipProcTypeB}" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.shipProcTypeC}" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.shipProcTypeD}" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.shipProcTypeE}" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.captainCount+arrestCntList.mateCount+arrestCntList.engineerCount+arrestCntList.crewCount }" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.captainCount}" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.mateCount}" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.engineerCount}" pattern="#,###"/></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.crewCount}" pattern="#,###"/></td>
						<td></td>
						<td class="text_ct"><fmt:formatNumber value="${arrestCntList.fieldCnt}" pattern="#,###"/></td>
						<td></td>
						<td></td>
						<td></td>
						<td class="text_num"><fmt:formatNumber value="${arrestCntList.commissionCost}" pattern="#,###"/></td>
						<td class="text_num"><fmt:formatNumber value="${arrestCntList.gearCast}" pattern="#,###"/></td>
						<td class="text_num"><fmt:formatNumber value="${arrestCntList.gearWidth}" pattern="#,###"/></td>
						<td></td>
					</tr>			
				</c:if>
				</tbody>
			</table>
		</div>
		<div id="divPrintArea" class="tbl_scroll_b">
		<table id="tblArrest" class="tbl_listview" border="0" cellpadding="0" cellspacing="0" style="table-layout:fixed;">
			<colgroup>
				<col width="50px"/>
				<col width="60px"/>
				<col width="80px"/>
				<col width="220px"/>
				<col width="170px"/>
				<col width="50px"/>
				<col width="40px"/>
				<col width="65px"/>
				<col width="55px"/>
				<col width="55px"/>
				<col width="40px"/>
				<col width="130px"/>
				<col width="80px"/>
				<col width="80px"/>
				<col width="50px"/>
				<col width="50px"/>
				<col width="45px"/>
				<col width="50px"/>
				<col width="75px"/>
				<col width="50px"/>
				<col width="80px"/>
				<col width="65px"/>
				<col width="85px"/>
				<col width="55px"/>
				<col width="45px"/>
				<col width="90px"/>
				<col width="80px"/>
				<col width="45px"/>
				<col width="100px"/>
				<col width="65px"/>
				<col width="45px"/>
				<col width="65px"/>
				<col width="45px"/>
				<col width="45px"/>
				<col width="50px"/>
				<col width="45px"/>
				<col width="55px"/>
				<col width="55px"/>
				<col width="45px"/>
				
				<col width="60px"/>
				<col width="45px"/>
				<col width="80px"/>
				<col width="80px"/>
				<col width="50px"/>
				<col width="85px"/>
				<col width="50px"/>
				<col width="55px"/>
				<col width="*"/>
			</colgroup>
			<tbody>
			<c:if test="${arrestCntList.totalCnt > 0}">
				<c:forEach var="result" items="${arrestList}" varStatus="status">
				<tr style="height:44px;">			
					<td><c:out value="${status.index+1 }"/></td>
					<td>
						<c:choose>
							<c:when test="${ result.status eq '0' }"><spring:message code="button.goSaveTemp"/></c:when>
							<c:when test="${ result.status eq '1' }"><spring:message code="button.finishReport"/></c:when>
							<c:otherwise></c:otherwise>
						</c:choose>
					</td>
					<td><c:out value="${result.arrestDate }"/></td>
					<td class="text_str"><c:out value="${result.latD }"/>º <c:out value="${result.latM }"/>′ <c:out value="${result.latS }"/>″&nbsp;
						<c:out value="${result.lonD }"/>º<c:out value="${result.lonM }"/>′ <c:out value="${result.lonS }"/>″ <br>
						(<c:out value="${result.addrAreaStr}"/>&nbsp;<c:out value="${result.addrStr }"/>) <c:out value="${result.addrDetail }"/> &nbsp;
						<c:if test="${result.leadDistance ne 0}">
							<c:out value="${result.leadDistance }"/>해리    
						</c:if>
					</td>
					<c:if test="${result.status eq '0'}"><!-- 임시저장 -->
						<c:choose>		
							<c:when test="${ userVO.place1 eq result.regAgency and userVO.isAdmin eq true }">
								<td class="text_str"><a href="javascript:fnArrestView('<c:out value="${result.arrestId }"/>')" style="color:#0000ff;"><c:out value="${result.violateDetail }"/></a></td>
							</c:when>			
							<c:when test="${ userVO.place1 eq 'PS00' }">
								<td class="text_str"><a href="javascript:fnArrestView('<c:out value="${result.arrestId }"/>')" style="color:#0000ff;"><c:out value="${result.violateDetail }"/></a></td>
							</c:when>
							<c:when test="${ userVO.place1 eq result.regAgency and userVO.usegrade eq 13  }">
								<td class="text_str"><a href="javascript:fnArrestView('<c:out value="${result.arrestId }"/>')" style="color:#0000ff;"><c:out value="${result.violateDetail }"/></a></td>
							</c:when>
							<c:otherwise>
								<td class="text_str"><c:out value="${result.violateDetail }"/></td>
							</c:otherwise>
						</c:choose>
					</c:if>
					<c:if test="${result.status ne '0'}"><!-- 제춣완료 -->
						<c:choose>
							<c:when test="${ userVO.place1 eq 'PS00' }">
								<td class="text_str"><a href="javascript:fnArrestView('<c:out value="${result.arrestId }"/>')" style="color:#0000ff;"><c:out value="${result.violateDetail }"/></a></td>
							</c:when>
							<c:otherwise>
								<td class="text_str"><c:out value="${result.violateDetail }"/></td>
							</c:otherwise>
						</c:choose>
					</c:if>					
					<td><c:out value="${result.invasion3 }"/></td>
					<td><c:out value="${result.invasion4 }"/></td>
					<td><c:out value="${result.invasion1 }"/></td>
					<td><c:out value="${result.invasion2 }"/></td>
					<td><c:out value="${result.specBatlYn }"/></td>
					<td><c:out value="${result.nllYn }"/></td>
					<td><c:if test="${result.agencyType eq '01'}">해양경찰청<br><c:out value="${result.agencyGuardStr }"/></c:if>
						<c:if test="${result.agencyType eq '02'}">해수부</c:if>
						<c:if test="${result.agencyType eq '03'}">해군</c:if>
					</td><!-- 검거기관 -->
					<td><c:out value="${result.agencyVessel }"/></td>
					<td><c:out value="${result.shipName }"/></td>
					<td class="text_num"><c:out value="${result.shipTonnage }"/></td>
					<td class="text_num"><c:out value="${result.shipCrewCnt }"/></td>
					<td><c:out value="${result.shipQualityStr }"/></td>
					<td><c:out value="${result.shipMentStr }"/></td>
					<td><c:out value="${result.capName }"/><br/>(<c:out value="${result.capAge }"/>)</td>
					<td><c:out value="${result.shipTypeStr }"/></td>
					<td class="text_str"><c:out value="${result.vioFish }"/></td>
					<td class="text_num"><fmt:formatNumber value="${result.vioCnt}" pattern="#,###"/></td>
					<td class="text_num"><fmt:formatNumber value="${result.vioPriatedAmt}" pattern="#,###"/></td>
					<td><c:if test="${result.procCondition eq '01'}">1</c:if></td>
					<td><c:if test="${result.procCondition eq '02'}">1</c:if></td>
					<td class="text_num"><c:if test="${result.marginPaymentYn eq 'Y'}"><fmt:formatNumber value="${result.marginPaymentAmt}" pattern="#,###"/></c:if></td>	<!-- 납부액 -->
					<td><c:if test="${result.marginPaymentYn eq 'Y'}"><c:out value="${result.marginPaymentDate }"/></c:if></td> 	<!-- 납부일시 -->
					<td><c:out value="${result.notPayment }"/></td>				  	<!-- 미납 -->
					<td class="text_num"><c:if test="${result.marginPaymentYn eq 'N'}"><fmt:formatNumber value="${result.noMarginPaymentAmt}" pattern="#,###"/></c:if></td>				<!-- 미납금액 -->
					<td><c:out value="${result.shipProcTypeA }"/></td>
					<td><c:out value="${result.shipProcTypeB }"/></td>
					<td><c:out value="${result.shipProcTypeC }"/></td>
					<td><c:out value="${result.shipProcTypeD }"/></td>
					<td><c:out value="${result.shipProcTypeE }"/></td>
					
					<td><c:out value="${result.detentionTotalCnt }"/></td>
					<td><c:out value="${result.captainCount }"/></td>
					<td><c:out value="${result.mateCount }"/></td>
					<td><c:out value="${result.engineerCount }"/></td>
					<td><c:out value="${result.crewCount }"/></td>
					
					<td><c:out value="${result.woDetentionStr }"/></td>
					<td><c:out value="${result.fieldCnt }"/></td>
					<td><c:out value="${result.fieldArrestDate }"/></td>
					<td><c:out value="${result.fieldReleaseDate }"/></td>
					<td><c:out value="${result.leadDistance }"/></td>
					<td class="text_num"><fmt:formatNumber value="${result.commissionCost}" pattern="#,###"/></td>
					<td class="text_num"><fmt:formatNumber value="${result.gearCast}" pattern="#,###"/></td>
					<td class="text_num"><fmt:formatNumber value="${result.gearWidth}" pattern="#,###"/></td>
					<td class="text_str"><c:out value="${result.gearEtc }"/></td>
				</tr>
				</c:forEach>
			</c:if>
		</tbody>
	</table>
	</div>	
</div>
