diff --git a/app/devices/devices.php b/app/devices/devices.php
index 1aab17908b..ed74fc54b7 100644
--- a/app/devices/devices.php
+++ b/app/devices/devices.php
@@ -253,24 +253,11 @@ else {
} //end if results
echo "
\n";
- echo "\n";
- echo " \n";
- echo " \n";
- echo " | | \n";
- echo " ".$paging_controls." | \n";
- echo " ";
- if (permission_exists('device_add')) {
- if ($_SESSION['limit']['devices']['numeric'] == '' || ($_SESSION['limit']['devices']['numeric'] != '' && $total_devices < $_SESSION['limit']['devices']['numeric'])) {
- echo " ".$v_link_label_add."";
- }
- }
- echo " | \n";
- echo " \n";
- echo " \n";
- echo " | \n";
- echo "
\n";
- echo "";
- echo "
";
+ echo "\n";
+ echo "
\n";
+
+ echo $paging_controls."\n";
+ echo "
\n";
//include the footer
require_once "resources/footer.php";
diff --git a/app/extensions/extensions.php b/app/extensions/extensions.php
index be6435605e..f8ef4f8da7 100644
--- a/app/extensions/extensions.php
+++ b/app/extensions/extensions.php
@@ -219,7 +219,8 @@ require_once "resources/paging.php";
echo "";
if (strlen($paging_controls) > 0) {
- echo "".$paging_controls."\n";
+ echo "
";
+ echo $paging_controls."\n";
}
echo "
".((is_array($extensions)) ? "
" : null);
diff --git a/app/gateways/gateways.php b/app/gateways/gateways.php
index a84dc4ed7e..dfc5336d70 100644
--- a/app/gateways/gateways.php
+++ b/app/gateways/gateways.php
@@ -111,19 +111,12 @@ else {
unset($sql, $prep_statement, $row);
//prepare to page the results
- $sql = "select count(*) as num_rows from v_gateways ";
- $sql .= "where (domain_uuid = '$domain_uuid' or domain_uuid is null) ";
- $prep_statement = $db->prepare($sql);
- if ($prep_statement) {
- $prep_statement->execute();
- $row = $prep_statement->fetch(PDO::FETCH_ASSOC);
- if ($row['num_rows'] > 0) {
- $num_rows = $row['num_rows'];
- }
- else {
- $num_rows = '0';
- }
- }
+ $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
+ $param = "&order_by=".$order_by."&order=".$order;
+ if (!isset($_GET['page'])) { $_GET['page'] = 0; }
+ $_GET['page'] = check_str($_GET['page']);
+ list($paging_controls, $rows_per_page, $var_3) = paging($total_gateways, $param, $rows_per_page);
+ $offset = $rows_per_page * $_GET['page'];
//get the list
$sql = "select * from v_gateways ";
@@ -134,18 +127,12 @@ else {
else {
$sql .= "order by $order_by $order ";
}
+ $sql .= "limit $rows_per_page offset $offset ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$gateways = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset ($prep_statement, $sql);
- $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
- $param = "";
- $page = check_str($_GET['page']);
- if (strlen($page) == 0) { $page = 0; }
- list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
- $offset = $rows_per_page * $page;
-
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
@@ -171,7 +158,7 @@ else {
echo "\n";
echo "\n";
- if ($num_rows > 0) {
+ if ($total_gateways > 0) {
foreach($gateways as $row) {
$tr_link = (permission_exists('gateway_edit')) ? "href='gateway_edit.php?id=".$row['gateway_uuid']."'" : null;
echo "\n";
@@ -236,25 +223,11 @@ else {
} //end if results
echo "
\n";
- echo "\n";
- echo " \n";
- echo " \n";
- echo " | | \n";
- echo " $paging_controls | \n";
- echo " ";
- if (permission_exists('gateway_add')) {
- if ($_SESSION['limit']['gateways']['numeric'] == '' || ($_SESSION['limit']['gateways']['numeric'] != '' && $total_gateways < $_SESSION['limit']['gateways']['numeric'])) {
- echo "".$v_link_label_add."";
- }
- }
- else {
- echo " ";
- }
- echo " | \n";
- echo " \n";
- echo " ";
- echo "
";
+ echo "\n";
+ echo " \n";
+ echo $paging_controls."\n";
+ echo "
\n";
//include the footer
require_once "resources/footer.php";
diff --git a/core/users/users.php b/core/users/users.php
index 304508b86d..b9a191c982 100644
--- a/core/users/users.php
+++ b/core/users/users.php
@@ -238,24 +238,10 @@ else {
} //end if results
echo " |
\n";
- echo "\n";
- echo " \n";
- echo " \n";
- echo " | | \n";
- echo " $paging_controls | \n";
- echo " ";
- if (permission_exists('user_add')) {
- if ($_SESSION['limit']['users']['numeric'] == '' || ($_SESSION['limit']['users']['numeric'] != '' && $total_users < $_SESSION['limit']['users']['numeric'])) {
- echo "".$v_link_label_add."";
- }
- }
- echo " | \n";
- echo " \n";
- echo " \n";
- echo " | \n";
- echo "
\n";
+ echo "\n";
+ echo "
\n";
- echo "";
- echo "
";
+ echo $paging_controls."\n";
+ echo "
\n";
?>
\ No newline at end of file