Warning: Creating default object from empty value in /home/thescrip/public_html/jclass/load_globes.php on line 22

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/thescrip/public_html/jclass/load_globes.php:22) in /home/thescrip/public_html/jincludes/globals.php on line 43

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/thescrip/public_html/jclass/load_globes.php:22) in /home/thescrip/public_html/jincludes/globals.php on line 43

Warning: Creating default object from empty value in /home/thescrip/public_html/jclass/load_globes.php on line 22

Warning: Creating default object from empty value in /home/thescrip/public_html/jclass/db_func.php on line 61

Warning: Creating default object from empty value in /home/thescrip/public_html/jclass/db_func.php on line 61

Warning: Creating default object from empty value in /home/thescrip/public_html/jclass/db_func.php on line 61
Pagination Class
TheScriptCenter.com


print page

Pagination Class

 

PAGINATION CLASS

Use this class to pass record count, and build page navigation for your site. What this script is not: not a database class.  You have to generate your own record counts and queries. This class will only create a navigation based on the record count, and other variables you pass along. It's up to you to integrate it with your script/website.
 
Built this so that a user can use this with virtually any program they want. Configure it how they want and create their own query string in order to fit into their own custom programs.  Or you can use my BUILT IN VARIABLES
 
View Demo
 
First create new instance of class
Example: $pag = new jpagination();
 
Pass array of variables to build_nav_button for building navigation.
in my example I used an array called getvars.  not to be confused with _GET 
 
$navigation = $pag->build_nav_button($getvars);
 
$getvars["start"] = starting record. IE: 0
$getvars["limit"] = 25 What is our limit? 25 per page? 10 per page? For showing All records pass the variable "all"
$getvars["count"] = pass the total amount of records to the script.
$getvars["sb"] = "sorting by" field name in your database. I.E. sb=Firstname
$getvars["faction"] = a form or script function like manage_customers, or view_orders, etc.. could be anything. need to check with the program you are using.
$getvars["acdc"] = "sort asc or desc" sorting records via acsending or descending. With SQL in mind. 
$getvars["nav_query_string"] =Used to pass your own query string. In case there's extra variables this script doesn't have
$getvars["script"] = The name of the script. For example search.php or orders.php. If nothing passed will use self.   
$getvars["label_go_back"] = "Go Back";//can customize this label as anything you want. Pass it in an array.
$getvars["label_sort_of"] = "Of";//can customize this label as anything you want.  I.E. Now showing 150 "Of" 200 records
$getvars["label_sort_records"] = "Records";// I.E Now showing 150 of 200 "Records"
$getvars["label_display_all"] = "View All";// for viewing all records link. 
 
Download Pagination.zip