代码如下 | 复制代码 |
class ajaxpage{ var $result; var $anchors; var $total; var $db; var $网页特效p/jsp.html target=_blank >jsp教程agination; function __construct($qry,$starting,$recpage,$jspagination) { $this->db = &$globals['db']; $this->jspagination = $jspagination; $rst = $this->db->query($qry); $numrows = $this->db->num_rows; $qry .= " limit $starting, $recpage"; $this->result = $this->db->get_results($qry,array_a); $next = $starting+$recpage;//the number next time end //$var = ((intval($numrows/$recpage))-1)*$recpage; $page_showing = intval($starting/$recpage)+1;//the str shows on the page bar $total_page = ceil($numrows/$recpage); //total page if($numrows % $recpage != 0){ $last = ((intval($numrows/$recpage)))*$recpage; }else{ $last = ((intval($numrows/$recpage))-1)*$recpage; } $previous = $starting-$recpage; $anc = "
if($previous $anc .= " $anc .= " }else{ $anc .= " $anc .= " } ################if you dont want the numbers just comment this block############### $norepeat = 3;//no of pages showing in the left and right side of the current page in the anchors $j = 1; $anch = ""; for($i=$page_showing; $i>1; $i--){ $fpreviouspage = $i-1; $page = ceil($fpreviouspage*$recpage)-$recpage; $anch = " if($j == $norepeat) break; $j++; } $anc .= $anch; $anc .= " $j = 1; for($i=$page_showing; $i $fnextpage = $i+1; $page = ceil($fnextpage*$recpage)-$recpage; $anc .= " if($j==$norepeat) break; $j++; } ############################################################ if($next >= $numrows){ $anc .= " $anc .= " }else{ $anc .= " $anc .= " } $anc .= " $this->anchors = $anc; $this->totalstr = "page : $page_showing of $total_page . total records found: $numrows"; } } |
永久地址:
转载随意~请带上教程地址吧^^

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools
