Update paginate.php

This commit is contained in:
Namhyeon Go 2018-07-01 17:09:16 +09:00 committed by GitHub
parent 0daa277032
commit 337c19a714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,18 @@
* @brief Page navigation helper
*/
if(!function_exists("paginate_get_current_page")) {
function paginate_get_current_page($page=1) {
$current_page = 1;
if($page > 0) {
$current_page = $page;
}
return $current_page;
}
}
if(!function_exists("paginate_get_total_pages")) {
function paginate_get_total_pages($item_per_page=1.0, $total_records=1.0) {
$total_pages = 1;
@ -18,6 +30,14 @@ if(!function_exists("paginate_get_total_pages")) {
}
}
if(!function_exists("paginate_get_query_string")) {
function paginate_get_query_string() {
loadHelper("networktool");
$net_event = get_network_event();
return get_value_in_array("query", $net_event, "");
}
}
// https://www.sanwebe.com/2011/05/php-pagination-function
if(!function_exists("paginate_make_html")) {
function paginate_make_html($item_per_page, $current_page, $total_records, $total_pages, $page_url, $qry='') {