From 9eafe9af2a2cda4fcc54a60513024989d8e5aa2f Mon Sep 17 00:00:00 2001 From: laf Date: Wed, 29 Oct 2014 18:30:42 +0000 Subject: [PATCH] Added function to generate pagination for mysql results --- html/includes/functions.inc.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index ddc3d62fe4..fc3b0542ba 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -678,4 +678,35 @@ function include_matching_files($dir, $match = "/\.php$/") } } +function generate_pagination($count,$limit,$page,$links = 2) { + $end_page = ceil($count / $limit); + $start = (($page - $links) > 0) ? $page - $links : 1; + $end = (($page + $links) < $end_page) ? $page + $links : $end_page; + $return = ''; + return($return); +} + ?>