* @brief Page navigation helper */ if(!check_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(!check_function_exists("paginate_get_total_pages")) { function paginate_get_total_pages($item_per_page=1.0, $total_records=1.0) { $total_pages = 1; if($item_per_page > 0) { $total_pages = ceil($total_records / $item_per_page); } return $total_pages; } } if(!check_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(!check_function_exists("paginate_make_html")) { function paginate_make_html($item_per_page, $current_page, $total_records, $total_pages, $page_url, $qry='') { $pagination = ''; if($total_pages > 0 && $total_pages != 1 && $current_page <= $total_pages) { //verify total pages and current page number $pagination .= ''; } return $pagination; //return pagination links } }