The paging class written today... share

Source: Internet
Author: User
Because it was written at work, I am afraid I am sorry if it is all posted by the department, so I have deleted the form jump. Don't be surprised... The format is relatively standard PHP code :-----------------------------------------------------------------------------

Because it was written at work, I am afraid I am sorry if it is all posted by the department, so I have deleted the form jump. Don't be surprised... The format is relatively standard PHP code: Example/*********** | + ------------------------------------------------------- | class name: PageBar | + example | 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) {$ th Is-> 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; $ I Linkhead = $ _ 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 = "[<]";} if ($ pagecount> 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 = "[

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.