Recommend this page to a friend! |
Download .zip |
Info | Screenshots | View files (130) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2014-05-17 (2 years ago) | Not enough user ratings | Total: 424 This week: 2 | All time: 6,043 This week: 591 |
Version | License | PHP version | Categories | |||
teapagination 1.0.0 | BSD License | 3.0 | HTML, PHP 5, Data types |
Description | Author | ||||||||
This class can display pagination for database queries using PDO. |
|
teaPagination ============= teaPagination is a script that allows you to paginate a sql statement or an array of data, is powerful and flexible as it has all the functionality to page any data you want. ![Alt text](assets/img/datatable.png) ![Alt text](assets/img/listdata.png) Installation ------------ <ol> <li>Unzip the file on the server root</li> <li>Included in their projects teaPagination.php file. <br/><br/> <pre><?php require('your/path/teaPagination.php'); ?></pre> <br/> </li> <li>Open in folder examples setting/setting.php and write your data connection to the database</li> <li>Execute countries.sql in your database.</li> <li>If you use the ajax page should include jquery plugin that is disposed within the header labels html document. <br/><br/> <pre><script src="your/path/teaPaginate.js" type="text/javascript"></script></pre> <br/> </li> </ol> Features -------- <ol> <li>Easy to use, with a few lines of code get great results</li> <li>Url and Ajax Pagination</li> <li>Allows friendly url</li> <li>The list is customizable</li> <li>It is very extensible</li> <li>has added a jquery plugin to interact with the server in the most simple</li> </ol> How to use ---------- <p>Before initializing the object must have prepared the data, which can be an array or sql query already formed.</p> <pre>$data = 'Select * from countries'; /*or*/ $data = array('a','b','c','d');</pre> <p>Set options for pagination</p> <pre>$options = array();</pre> <table><tr><td style="width:20%">Option</td><td style="width:50%">Description</td><td>Default Value</td></tr> <tbody> <tr><td>maxButtons (integer)</td><td>Sets the number of buttons to display</td><td>5</td></tr> <tr><td>itemsPage (integer)</td><td>Number of rows to display</td><td>5</td></tr> <tr><td>beginLoop (string)</td><td>Sets string to the begin of the loop</td><td>NONE</td></tr> <tr><td>endLoop (string)</td><td>Sets string to the end of the loop</td><td>NONE</td></tr> <tr><td>beginTagItem (string)</td><td>Sets a string at the beginning of the iteration</td><td>NONE</td></tr> <tr><td>endTagItem (string)</td><td>Sets a string at the end of the iteration</td><td>NONE</td></tr> <tr><td>ajax (boolean)</td><td>It does not show the button link page</td><td>false</td></tr> <tr><td>nameVar (string)</td><td>Parameter name containing the page number</td><td>page</td></tr> <tr><td>urlPage (string)</td><td>Allows you to customize the output url</td><td>NONE</td></tr> <tr><td>textNotFound (string)</td><td>Text to be displayed when the data list is empty</td><td>Not found Record.</td></tr> <tr><td>connect_db (array)</td><td>This option sets the connection parameters to the database:<ol><li>user: name user</li><li>database: name database</li><li>password</li></ol></td><td>array('user' => '','database' => '','password' => '')</td></tr> <tr><td>buttons (array)</td><td>Customize output buttons: <ol> <li>btNext(boolean): Display the next button</li> <li>btNextTitle(string): Set button text</li> <li>btPrevious(boolean): Display the previous button</li> <li>btPreviousTitle(string): Set button text</li> <li>btFirst (boolean): Display first button</li> <li>btFirstTitle(string): Set button text</li> <li>btLast(boolean): Display last button</li> <li>btLastTitle(string): Set button text</li> <li>class(string): Define button styles</li> </ol></td><td>array('btNext' => true,'btNextTitle' => 'Next »','btPreviousTitle' => '« Previous','btPrevious' => true,'btLastTitle' => 'Last','btLast' => true,'btFirstTitle' => 'First','btFirst' => true,'class' => '')</td></tr> </tbody> </table> <p>Create an instance of the class</p> <pre>$pagination = new teaPagination($data, $options);</pre> <p>Create the list using the loop method</p> <pre>$pagination->loop($item_design, $callback=null, $callArgs=array());</pre> <p><b>$item_design</b> is a string that replaces a word key by the value obtained from the data source. For example, if you have a field named 'lastName' that it replaced by its value chain adding the word {lastName}. <b>$callback</b> is a name function for display a more complete list, so calling an external function that will be called for each iteration of data. For example, to obtain a list of active users from the data source: </p> <pre>function create_list($data){if($data['user'] == 'active')return '<div>'.$data['name'].'</div>';}</pre> <p>And finally display the list and buttons</p> <pre>echo $pagination->render(); /* list */ echo $pagination->buttons(); /* buttons */</pre> <h3>Public variables:</h3> <ul> <li><b>currentPage</b>: returns the current page number</li> <li><b>TotalPage</b>: returns total pages of the list</li> <li><b>TotalRecord</b>: returns total records of the list</li> </ul> JavaScript ---------- <p>For ajax paging to use the plugin for jquery teaPaginate.js, add the following line of code between the head tags in html document:</p> <pre><script src="your/path/teaPaginate.js" type="text/javascript"></script></pre> <p>Now create the object for manipulation</p> <pre>var element = document.getElementById('example'); var paginateExample = new teaPaginate(element,{ url : server.php, buttonsContainer : 'nameElement', OnLoad : handlePagerSuccess, OnBefore: handlePagerBefore, textLoading: 'Loading...', data:{page:1,init:true} }).init(); </pre> <br/> <h3>Options:</h3> <ul> <li><b>url</b>: url server</li> <li><b>buttonsContainer</b>: element that contains the buttons</li> <li><b>OnLoad</b>: processed function call after loading the list</li> <li><b>OnBefore</b>: processed function call before loading the list</li> <li><b>textLoading</b>: alternative text during the loading process</li> <li><b>data</b>: data sent to the server for processing (POST request)</li> </ul> <h3>Methods:</h3> <ul> <li><b>update({data{options}})</b>: update the current page number (making a call to the server), data is sent (POST) to the server for processing.</li> <li><b>currentPage()</b>: return current page</li> </ul> |
Screenshots | ||
Files |
File | Role | Description | ||
---|---|---|---|---|
assets (1 directory) | ||||
examples (12 files, 4 directories) | ||||
js (1 file) | ||||
teaPagination (2 files, 3 directories) | ||||
index.html | Data | Example Application | ||
LICENSE | Lic. | License | ||
README.md | Doc. | Auxiliary data | ||
teaPagination.php | Class | Class source |
Files | / | assets | / | img |
File | Role | Description |
---|---|---|
datatable.png | Data | Auxiliary data |
listdata.png | Data | Auxiliary data |
Files | / | examples |
File | Role | Description | ||
---|---|---|---|---|
assets (3 directories) | ||||
debug (2 files) | ||||
extendsPaginate (1 file) | ||||
setting (1 file) | ||||
.htaccess | Data | Auxiliary data | ||
ajaxTable.html | Doc. | Documentation | ||
ajaxTable.php | Example | Example script | ||
ArrayData.php | Example | Sample output | ||
countries.sql | Data | Auxiliary data | ||
customize.html | Doc. | Documentation | ||
customize.php | Example | Example script | ||
friendlyUrl.php | Example | Example script | ||
itemReplace.php | Example | Example script | ||
simple.php | Example | Example script | ||
simpleAjax.html | Doc. | Documentation | ||
simpleAjax.php | Example | Example script |
Files | / | examples | / | assets | / | css |
File | Role | Description | ||
---|---|---|---|---|
font-awesome (2 directories) | ||||
fonts (1 file) | ||||
highlight (1 file) | ||||
bootstrap.min.css | Data | Auxiliary data |
Files | / | examples | / | assets | / | css | / | font-awesome | / | css |
File | Role | Description |
---|---|---|
font-awesome.css | Data | Auxiliary data |
font-awesome.min.css | Data | Auxiliary data |
Files | / | examples | / | assets | / | css | / | font-awesome | / | fonts |
File | Role | Description |
---|---|---|
fontawesome-webfont.svg | Data | Auxiliary data |
Files | / | examples | / | assets | / | css | / | fonts |
File | Role | Description |
---|---|---|
glyphicons-halflings-regular.svg | Data | Auxiliary data |
Files | / | examples | / | assets | / | images |
File | Role | Description | ||
---|---|---|---|---|
products (8 files) | ||||
addtocart.gif | Icon | Icon image | ||
cart.gif | Icon | Icon image | ||
compare.gif | Icon | Icon image | ||
delete.png | Icon | Icon image | ||
favorites.gif | Icon | Icon image | ||
favs.gif | Icon | Icon image | ||
products_details_bg.gif | Icon | Icon image | ||
product_box_bottom.gif | Icon | Icon image | ||
product_box_center.gif | Icon | Icon image | ||
product_box_top.gif | Icon | Icon image | ||
square-blue-add.gif | Icon | Icon image |
Files | / | examples | / | assets | / | images | / | products |
File | Role | Description |
---|---|---|
camera.png | Icon | Icon image |
iphone.png | Icon | Icon image |
laptop1.gif | Icon | Icon image |
laptop2.gif | Icon | Icon image |
monitor.jpg | Icon | Icon image |
pad.gif | Icon | Icon image |
pc.jpg | Icon | Icon image |
printer.jpg | Icon | Icon image |
Files | / | examples | / | assets | / | js |
File | Role | Description |
---|---|---|
bootstrap.min.js | Data | Auxiliary data |
highlight.pack.js | Data | Auxiliary data |
jquery-1.7.2.min.js | Data | Auxiliary data |
Files | / | examples | / | debug |
File | Role | Description |
---|---|---|
fb.php | Class | Class source |
FirePHP.php | Class | Class source |
Files | / | teaPagination |
File | Role | Description | ||
---|---|---|---|---|
DOC (1 file, 1 directory) | ||||
examples (12 files, 4 directories) | ||||
js (1 file) | ||||
index.html | Doc. | Documentation | ||
teaPagination.php | Class | Class source |
Files | / | teaPagination | / | DOC |
File | Role | Description | ||
---|---|---|---|---|
assets (2 directories) | ||||
index.html | Doc. | Documentation |
Files | / | teaPagination | / | DOC | / | assets |
File | Role | Description | ||
---|---|---|---|---|
blueprint-css (3 files, 2 directories) | ||||
images (2 files) |
Files | / | teaPagination | / | DOC | / | assets | / | blueprint-css |
File | Role | Description | ||
---|---|---|---|---|
plugins (4 directories) | ||||
src (7 files) | ||||
ie.css | Data | Auxiliary data | ||
print.css | Data | Auxiliary data | ||
screen.css | Data | Auxiliary data |
Files | / | teaPagination | / | DOC | / | assets | / | blueprint-css | / | plugins |
File | Role | Description | ||
---|---|---|---|---|
buttons (2 files, 1 directory) | ||||
fancy-type (2 files) | ||||
link-icons (2 files, 1 directory) | ||||
rtl (2 files) |
Files | / | teaPagination | / | DOC | / | assets | / | blueprint-css | / | plugins | / | fancy-type |
File | Role | Description |
---|---|---|
readme.txt | Doc. | read me |
screen.css | Data | style |
Files | / | teaPagination | / | DOC | / | assets | / | blueprint-css | / | plugins | / | link-icons |
File | Role | Description | ||
---|---|---|---|---|
icons (8 files) | ||||
readme.txt | Doc. | read me | ||
screen.css | Data | style |
Files | / | teaPagination | / | DOC | / | assets | / | blueprint-css | / | plugins | / | link-icons | / | icons |
File | Role | Description |
---|---|---|
doc.png | Icon | image |
email.png | Icon | image |
external.png | Icon | image |
feed.png | Icon | image |
im.png | Icon | image |
pdf.png | Icon | image |
visited.png | Icon | image |
xls.png | Icon | image |
Files | / | teaPagination | / | DOC | / | assets | / | blueprint-css | / | plugins | / | rtl |
File | Role | Description |
---|---|---|
readme.txt | Doc. | read me |
screen.css | Data | style |
Files | / | teaPagination | / | DOC | / | assets | / | blueprint-css | / | src |
Files | / | teaPagination | / | DOC | / | assets | / | images |
File | Role | Description |
---|---|---|
datatable.png | Data | Auxiliary data |
listdata.png | Data | Auxiliary data |
Files | / | teaPagination | / | examples |
File | Role | Description | ||
---|---|---|---|---|
assets (3 directories) | ||||
debug (2 files) | ||||
extendsPaginate (1 file) | ||||
setting (1 file) | ||||
.htaccess | Data | Auxiliary data | ||
ajaxTable.html | Doc. | Documentation | ||
ajaxTable.php | Example | Example script | ||
ArrayData.php | Output | Sample output | ||
countries.sql | Data | Auxiliary data | ||
customize.html | Doc. | Documentation | ||
customize.php | Example | Example script | ||
friendlyUrl.php | Example | Example script | ||
itemReplace.php | Example | Example script | ||
simple.php | Example | Example script | ||
simpleAjax.html | Doc. | Documentation | ||
simpleAjax.php | Example | Example script |
Files | / | teaPagination | / | examples | / | assets |
Files | / | teaPagination | / | examples | / | assets | / | css |
File | Role | Description | ||
---|---|---|---|---|
font-awesome (2 directories) | ||||
fonts (1 file) | ||||
highlight (1 file) | ||||
bootstrap.min.css | Data | Auxiliary data |
Files | / | teaPagination | / | examples | / | assets | / | css | / | font-awesome |
Files | / | teaPagination | / | examples | / | assets | / | css | / | font-awesome | / | css |
File | Role | Description |
---|---|---|
font-awesome.css | Data | style |
font-awesome.min.css | Data | style |
Files | / | teaPagination | / | examples | / | assets | / | css | / | font-awesome | / | fonts |
File | Role | Description |
---|---|---|
fontawesome-webfont.svg | Data | font |
Files | / | teaPagination | / | examples | / | assets | / | css | / | fonts |
File | Role | Description |
---|---|---|
glyphicons-halflings-regular.svg | Data | font |
Files | / | teaPagination | / | examples | / | assets | / | css | / | highlight |
File | Role | Description |
---|---|---|
default.css | Data | css style |
Files | / | teaPagination | / | examples | / | assets | / | images |
File | Role | Description | ||
---|---|---|---|---|
products (8 files) | ||||
addtocart.gif | Icon | Icon image | ||
cart.gif | Icon | Icon image | ||
compare.gif | Icon | Icon image | ||
delete.png | Icon | Icon image | ||
favorites.gif | Icon | Icon image | ||
favs.gif | Icon | Icon image | ||
products_details_bg.gif | Icon | Icon image | ||
product_box_bottom.gif | Icon | Icon image | ||
product_box_center.gif | Icon | Icon image | ||
product_box_top.gif | Icon | Icon image | ||
square-blue-add.gif | Icon | Icon image |
Files | / | teaPagination | / | examples | / | assets | / | images | / | products |
File | Role | Description |
---|---|---|
camera.png | Icon | image |
iphone.png | Icon | image |
laptop1.gif | Icon | image |
laptop2.gif | Icon | image |
monitor.jpg | Icon | image |
pad.gif | Icon | image |
pc.jpg | Icon | image |
printer.jpg | Icon | image |
Files | / | teaPagination | / | examples | / | assets | / | js |
File | Role | Description |
---|---|---|
bootstrap.min.js | Data | Auxiliary data |
highlight.pack.js | Data | Auxiliary data |
jquery-1.7.2.min.js | Data | Auxiliary data |
Files | / | teaPagination | / | examples | / | debug |
File | Role | Description |
---|---|---|
fb.php | Class | Class source |
FirePHP.php | Class | Class source |
Files | / | teaPagination | / | examples | / | extendsPaginate |
File | Role | Description |
---|---|---|
PaginateCustomize.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
98% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Related pages |
teaPagination Repository Github Proyect |