function getPager(url, sum, int currnum, int length) { if (length >= sum) { return ""; } var showsum = "总共"; var showitem = "条数据"; var showfirstpage = "首页"; var showuppage = "上一页"; var shownextpage = "下一页"; var showlastpage = "末页"; var showjump = "跳转到"; var showselect = "请选择"; var showtotal = "共"; var showpage = "页"; var pagerinfo = ''; var sbinfo = ''; sbinfo+="
"; var pagenum = 0; if (sum % length == 0) { pagenum = sum / length; } else { pagenum = sum / length-0 + 1; } var first = ""; if (url.indexOf("?") != -1) { first = "&"; } else { first = "?"; } var pageUrl = ""; sbinfo+=(showsum + "" + sum + "" + showitem + "   "); var firstUrl = url + first + "currpage=" + 1 + "&" + condtion; sbinfo+=("" + showfirstpage + "  "); if (1 == currnum) { sbinfo+=(showuppage + " "); } else { pageUrl = url + first + "currpage=" + (currnum - 1) + "&" + condtion; sbinfo+=("" + showuppage + " "); } String tempstr = ""; if (pagenum < 6) { for (int i = 1; i < pagenum + 1; i++) { pageUrl = url + first + "currpage=" + i + "&" + condtion; if (i == currnum) { tempstr = "" + i + " "; } else { tempstr = "" + i + " "; } sbinfo+=(tempstr); } } else if (currnum > pagenum - 3) { sbinfo+=(". . . "); for (int i = currnum - 4; i < pagenum + 1; i++) { pageUrl = url + first + "currpage=" + i + "&" + condtion; if (i == currnum) { tempstr = "" + i + " "; } else { tempstr = "" + i + " "; } sbinfo+=(tempstr); } } else if (currnum < 4) { for (int i = 1; i < currnum + 3; i++) { pageUrl = url + first + "currpage=" + i + "&" + condtion; if (i == currnum) { tempstr = "" + i + " "; } else { tempstr = "" + i + " "; } sbinfo+=(tempstr); } sbinfo+=(". . . "); } else { sbinfo+=(". . . "); for (int i = currnum - 2; i < currnum + 3; i++) { pageUrl = url + first + "currpage=" + i + "&" + condtion; if (i == currnum) { tempstr = "" + i + " "; } else { tempstr = "" + i + " "; } sbinfo+=tempstr); } sbinfo+=(". . . "); } if (currnum == pagenum) { sbinfo+=(shownextpage); } else { pageUrl = url + first + "currpage=" + (currnum + 1) + "&" + condtion; sbinfo+=("" + shownextpage + ""); } String endUrl = url + first + "currpage=" + pagenum + "&" + condtion; sbinfo+=(" " + showlastpage + "   "); String selecturl = url + first + condtion; sbinfo+=showjump + "