Home  >  Article  >  Backend Development  >  今天写的分页类......分享_PHP教程

今天写的分页类......分享_PHP教程

WBOY
WBOYOriginal
2016-07-13 17:23:54778browse

由于是上班时候写的,所以如果全部由部贴出来恐怕对不起公司,所以我把其中的表单跳转删去了。别见怪哦。。。 格式写法是比较标准的了 PHP代码:-------------------------------------------------------------------------------- /********** | +--------------------------------------------------- | 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.htmlTechArticle由于是上班时候写的,所以如果全部由部贴出来恐怕对不起公司,所以我把其中的表单跳转删去了。别见怪哦。。。 格式写法是比较标准的...
Statement:
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