<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/cms4j" prefix="cms4j" %>

<%@ page import = "cn.com.dekn.cms.util.*" %>



<%
	//百度式的分类  上一页  1 2 3 4 5 6 7 8 9 10 下一页

	//当前页数
	int PN = StrUtil.getNotNullIntValue(request.getParameter("pn"),1);
	int PAGE_COUNT = StrUtil.getNotNullIntValue((String)request.getAttribute("PAGE_COUNT"),1);
	int ROW_COUNT = StrUtil.getNotNullIntValue((String)request.getAttribute("ROW_COUNT"),1);
	int PAGE_SIZE = StrUtil.getNotNullIntValue((String)request.getAttribute("PAGE_SIZE"),1);
	
	
	String FIRST_PAGE_URL = URLUtil.addParam(request,"pn","1");
	String PREV_PAGE_URL = URLUtil.addParam(request,"pn",(String)request.getAttribute("PREV_PAGE"));
	String NEXT_PAGE_URL = URLUtil.addParam(request,"pn",(String)request.getAttribute("NEXT_PAGE"));
	String LAST_PAGE_URL = URLUtil.addParam(request,"pn",(String)request.getAttribute("LAST_PAGE"));
	
/***********************************
* CSS样式 参数初始化
***********************************/
//CSS样式
String CSS = StrUtil.getNotNullStringValue(request.getParameter("CSS"),"");

//当前页颜色
String COLOR_CURR_PAGE = StrUtil.getNotNullStringValue(request.getParameter("COLOR_CURR_PAGE"),"#000000");

//其它页颜色
String COLOR_OTHER_PAGE = StrUtil.getNotNullStringValue(request.getParameter("COLOR_OTHER_PAGE"),"#000000");

//上下页
String COLOR_NEXT_PREV_PAGE = StrUtil.getNotNullStringValue(request.getParameter("COLOR_NEXT_PREV_PAGE"),"#000000");


int k = 0;
int i = 1;
if(PN >= 20){
	i = PN - 10;
}
			
%>


<% if(PN > 1){ %>
  <a href="<%=PREV_PAGE_URL%>"><font color="<%=COLOR_NEXT_PREV_PAGE%>">上一页</font></a>
<% } %>

<%
for(;i<=PAGE_COUNT && k < 20 ;i++,k++){
%>

<% if(i == PN) { %>
  <b><font color="<%=COLOR_CURR_PAGE%>">[<%=i%>]</font></b>
<% }else{ %>
  <a href="<%=URLUtil.addParam(request,"pn",String.valueOf(i))%>"><font color="<%=COLOR_OTHER_PAGE%>">[<%=i%>]</font></a>
<% } %>

<%
}
%>

<% if(PN < PAGE_COUNT){ %>
	<a href="<%=NEXT_PAGE_URL%>"><font color="<%=COLOR_NEXT_PREV_PAGE%>">下一页</font></a>
<% } %> 
