ERP-node/WebContent/WEB-INF/view/ions/common/paging.jsp

71 lines
2.4 KiB
Plaintext

<%
/**
* 공통 페이징
* @since 2021.10.01
* @author kim
* @version 1.0
*
* << 개정 이력 >>
*
* 수정일 수정자 수정내용
* ---------------- --------------------- --------------------------------------------------------
* 2021.10.01 김효일 최초작성
**/
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!-- //JSTL 페이징 변수선언 -->
<c:set var="totalCount" value="${empty TOTAL_COUNT?0:TOTAL_COUNT}" />
<c:set var="maxPage" value="${empty MAX_PAGE_SIZE?1:MAX_PAGE_SIZE}" />
<c:set var="nPage" value="${empty param.page?1:param.page}" />
<c:set var="pageIndex" value="${(nPage-1)/10}" />
<c:set var="nextPage" value="${empty NEXT_PAGE?1:NEXT_PAGE}" />
<c:set var="prevPage" value="${empty PREV_PAGE?1:PREV_PAGE}" />
<div class="pdm_page">
<input type="hidden" name="page" id="page" value="${nPage}"/>
<c:if test="${!empty LIST}">
<div class="page_pro">
<table align="center">
<tr>
<c:choose>
<c:when test="${nPage > 1}">
<td><a href="javascript:fnc_goPrev('${prevPage}');">prev</a></td>
<td>&nbsp;&nbsp;&nbsp;</td>
</c:when>
<c:otherwise>
<td class="no_more_page">prev</td>
<td>&nbsp;&nbsp;&nbsp;</td>
</c:otherwise>
</c:choose>
<c:forEach var="v" begin="${nPage>5?nPage-5:1}" end="${nPage>5?nPage+4:10}" step="1" varStatus="status">
<c:if test="${status.index -1 < maxPage}">
<c:choose>
<c:when test="${status.index eq nPage}">
<td><a href="#" class="now_page">${nPage}</a></td>
<td>&nbsp;&nbsp;&nbsp;</td>
</c:when>
<c:otherwise>
<td><a href="javascript:fnc_goPage('${status.index}');">${status.index}</a></td>
<td>&nbsp;&nbsp;&nbsp;</td>
</c:otherwise>
</c:choose>
</c:if>
</c:forEach>
<c:choose>
<c:when test="${nPage < maxPage}">
<td><a href="javascript:fnc_goNext('${nextPage}');">next</a></td>
</c:when>
<c:otherwise>
<td class="no_more_page">next</td>
</c:otherwise>
</c:choose>
</tr>
</table>
<c:if test="${!empty LIST}">
<p id="adminPageCount">총 ${totalCount}건</p>
</c:if>
</div>
</c:if>
</div>