<%@page import="java.net.URLEncoder"%>
<%
            /************************************************************@@
             * Program Name	: doc_list.jsp
             * Description		: /집계자/내문서함/등록함/문서 목록
             * Author				: 강원중
             * Create Date		: 2004.10.11
             * History				:
            @@************************************************************/
%>
<%@ page contentType="text/html; charset=UTF-8" 
         import="java.net.URLDecoder" import="kr.co.kihyun.lang.Encoder"
         import="kr.co.kihyun.lang.MString" import="kr.co.kihyun.lang.MInteger"%>
<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%>
<%
    try {
        /******* Parameter *********/
        request.setCharacterEncoding("UTF-8");
        String uri = URLDecoder.decode(MString.checkNull(request.getParameter("uri")), "UTF-8");
        String findWord = MString.checkNull(request.getParameter("findWord"));
        uri += "&findWord=" + findWord;
        int pageSize = MInteger.parseInt(request.getParameter("pageSize"));
        int currentPage = MInteger.parseInt(request.getParameter("currentPage"));
        int currentPageSetUp = MInteger.parseInt(request.getParameter("currentPageSetUp"));%>
<table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td align="right">
        <%  //이전 40개
            //System.out.println("currentPageSetUp::::::" + currentPageSetUp + ":::currentPage::" + currentPage + ":::::pageSize:::" + pageSize);
        if (currentPage > 10) {%>
            <a href="./<%= uri%>&strPage=1" style="text-decoration: none;">
                <img src="/totsys/common/images/bt_list_pre.gif" style="vertical-align: top;" />
            </a>
        <%} else {%>            
            <img src="/totsys/common/images/bt_list_pre.gif" style="vertical-align: top;" />
        <%}%>
        <%if (currentPage > 10) {//이전 10개%>
            <a href="./<%= uri%>&strPage=<%= (currentPageSetUp - 9)%>" style="text-decoration: none;">
                <img src="/totsys/common/images/prev_text.gif" style="vertical-align: top;" />
            </a>
        <%} else {%>
                <img src="/totsys/common/images/prev_text.gif" style="vertical-align: top;" />
        <%}%>
        </td>
        <% //페이지 선택
            //System.out.println("pageSize:::::" + pageSize);
            for (int i = (currentPageSetUp + 1); i <= pageSize && i <= (currentPageSetUp + 10); i++) {
                if (i != 1) {%>
        <!--td nowrap>&nbsp;<img src="/totsys/common/images/pagebar.gif">&nbsp;</td-->
        <%      }
                if (i != currentPage) {%>
        <td nowrap>&nbsp;
            <a border=0 href="./<%= uri%>&strPage=<%= i%>" style="text-decoration: none;">
                <span style="font-family: 돋움; font-size: 12px; color: #7a7a7a; font-weight: bold;"><%= i%></span>
            </a>&nbsp;
        </td>
        <%      } else {%>
        <td nowrap>&nbsp;
            <span style="font-family: 돋움; font-size: 12px; color: #508ac3; font-weight: bold;"><%= i%></span>&nbsp;&nbsp;
        </td>
        <%
                }
            }
        %>
        <td>
        <%if ((pageSize - currentPageSetUp) > 10) {//다음 10개%>
            <a href="./<%= uri%>&strPage=<%= (currentPageSetUp + 11)%>" style="text-decoration: none;">
                <img src="/totsys/common/images/next_text.gif" style="vertical-align: top;" />
            </a>
        <%} else {%>
            <img src="/totsys/common/images/next_text.gif" style="vertical-align: top;" />
        <%}%>
        <%  //다음 40개
            //System.out.println("currentPageSetUp End::::::" + currentPageSetUp + ":::currentPage::" + currentPage + ":::pageSize:::" + pageSize);
            if ((pageSize - currentPageSetUp) > 20) {%>
            <a href="./<%= uri%>&strPage=<%= pageSize%>" style="text-decoration: none;">
                <img src="/totsys/common/images/bt_list_next.gif" style="vertical-align: top;" />
            </a>
        <%} else {%>
            <img src="/totsys/common/images/bt_list_next.gif" style="vertical-align: top;" />
        <%}%>
        </td>
    </tr>
</table>
<%
    } catch (Exception ex) {
        ex.printStackTrace();
        out.println(kr.co.kihyun.text.html.ServletUtil.getJavaScript("location='/servlet/kr.co.kihyun.beans.user.HttpSSOLogin?mode=logout';"));
    } finally {
    }
%>
