}
}
pageNavigation += "</select>页 共" + curPageNos
+ "页 ";
// 如果不是第一页,导航条将包含"首页"和"上一页"的连接
if (curPageNo > 0) {
pageNavigation += "[<a href=\"javascript:void(0);\" onclick=\"gotoPage(0);return false;\">首页</a>] "
+ "[<a href=\"javascript:void(0);\" onclick=\"gotoPage("
+ (curPageNo - 1) + ");return false;\">上一页</a>] "; } else {
pageNavigation += "[首页] [上一页] ";
}
// 如果不是最后一页,导航条将包含"末页"和"下一页"
if (curPageNo < curPageNos - 1) {
pageNavigation += "[<a href=\"javascript:void(0);\" onclick=\"gotoPage(" + (curPageNo + 1)
+ ");return false;\">下一页</a>] "
+ "[<a href=\"javascript:void(0);\" onclick=\"gotoPage(" + (curPageNos - 1) + ");return false;\">末页</a>]";
} else {
pageNavigation += "[下一页] [末页]";
}
}
return pageNavigation;
}
/**
* 返回分页后的总页数
*
* @return pagecount int 总页数
*/
public int getPageCount() {
int pagecount = 0;
if (size % pageSize == 0) {
pagecount = size / pageSize;
} else {
pagecount = size / pageSize + 1;
}
return pagecount;
}
/**
* 返回最后一页的记录数
*
* @return lastpagesize int 最后一页的记录数