Home > Backend Development > PHP Tutorial > The paging class I wrote today...share_PHP tutorial

The paging class I wrote today...share_PHP tutorial

WBOY
Release: 2016-07-13 17:23:54
Original
881 people have browsed it

Since I wrote it while at work, I would be sorry for the company if I posted it all from the department, so I deleted the form jumps. Don't be surprised. . . The format is relatively standard for PHP code:------------------------------------------------ ------------------------------------- /********** | +--------------------------------------------------- | CLASS NAME: PageBar | +--------------------------------------------------- | Author: Arvan [E-mail:Arvan@5n9.com QQ:8817776] | Create date: 2003-7-17 | Note: | Do for pagination | +--------------------------------------------------- | Warning: no... | +--------------------------------------------------- **********/ class PageBar { var $total; var $onepage; var $num; var $pagecount; var $total_page; var $offset; var $linkhead; function PageBar($total, $onepage, $form_vars=) { $pagecount = $_GET[pagecount ]; $this->total = $total; $this->onepage = $onepage; $this->total_page = ceil($total/$onepage); if (empty($pagecount)) { $this->pagecount = 1; $this->offset = 0; } else { $this->pagecount = $pagecount; $this->offset = ($pagecount-1)*$onepage; } if (!empty($form_vars)) { $ vars = explode("|", $form_vars); $chk = $vars[0]; $chk_value = $_POST[$chk]; if (empty($chk_value)) { $formlink = ""; } else { for ($i=0; $ilinkhead = $_SERVER[PHP_SELF]."?".$formlink; } else { $this->linkhead = $_SERVER[PHP_SELF]."?".$linkft.$formlink ; } } #End function PageBar(); function offset() { return $this->offset; } #End function offset(); function pre_page($char=) { $linkhead = $this->linkhead; $pagecount = $this->pagecount; if (empty($char)) { $char = "[1) { $pre_page = $pagecount - 1; return "$char"; } else { return ; } } #End function pre_page(); function next_page($char=) { $linkhead = $this->linkhead; $total_page = $this->total_page; $pagecount = $this->pagecount; if (empty($char)) { $char = "[

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532181.htmlTechArticleSince I wrote it at work, I would be sorry for the company if I posted it all, so I posted the form Jump deleted. Don't be surprised. . . The writing format is relatively standard...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template