diff --git a/public/include/classes/user.class.php b/public/include/classes/user.class.php index b37c7d4d..6d78c7e3 100644 --- a/public/include/classes/user.class.php +++ b/public/include/classes/user.class.php @@ -120,7 +120,7 @@ class User extends Base { * @param none * @return data array All users with db columns as array fields **/ - public function getLastRegisteredUsers($limit=10) { + public function getLastRegisteredUsers($limit=10,$start=0) { $this->debug->append("STA " . __METHOD__, 4); $invitation = new Invitation(); $invitation->setMysql($this->mysqli); @@ -132,8 +132,8 @@ class User extends Base { ON a.email = i.email LEFT JOIN " . $this->getTableName() . " AS u ON i.account_id = u.id - ORDER BY a.id DESC LIMIT ?"); - if ($this->checkStmt($stmt) && $stmt->bind_param("i", $limit) && $stmt->execute() && $result = $stmt->get_result()) { + ORDER BY a.id DESC LIMIT ?,?"); + if ($this->checkStmt($stmt) && $stmt->bind_param("ii", $start, $limit) && $stmt->execute() && $result = $stmt->get_result()) { return $result->fetch_all(MYSQLI_ASSOC); } } @@ -143,7 +143,7 @@ class User extends Base { * @param none * @return data array All users with db columns as array fields **/ - public function getTopInviters($limit=10) { + public function getTopInviters($limit=10,$start=0) { $this->debug->append("STA " . __METHOD__, 4); $invitation = new Invitation(); $invitation->setMysql($this->mysqli); @@ -157,8 +157,8 @@ class User extends Base { ON a.id = i.account_id GROUP BY i.account_id ORDER BY invitationcount ASC - LIMIT ?"); - if ($this->checkStmt($stmt) && $stmt->bind_param("i", $limit) && $stmt->execute() && $result = $stmt->get_result()) { + LIMIT ?,?"); + if ($this->checkStmt($stmt) && $stmt->bind_param("ii", $start, $limit) && $stmt->execute() && $result = $stmt->get_result()) { return $result->fetch_all(MYSQLI_ASSOC); } } diff --git a/public/include/pages/admin/dashboard.inc.php b/public/include/pages/admin/dashboard.inc.php index 32ee6a7d..0769c9ff 100644 --- a/public/include/pages/admin/dashboard.inc.php +++ b/public/include/pages/admin/dashboard.inc.php @@ -7,6 +7,12 @@ if (!$user->isAuthenticated() || !$user->isAdmin($_SESSION['USERDATA']['id'])) { die("404 Page not found"); } +// Some defaults +$iLimit = 10; +$smarty->assign('LIMIT', $iLimit); +empty($_REQUEST['registeredstart']) ? $registeredstart = 0 : $registeredstart = $_REQUEST['registeredstart']; +empty($_REQUEST['invitersstart']) ? $invitersstart = 0 : $invitersstart = $_REQUEST['invitersstart']; + if ($bitcoin->can_connect() === true){ $aGetInfo = $bitcoin->getinfo(); } else { @@ -65,13 +71,13 @@ $aRegistrationInfo = array( $smarty->assign('USER_REGISTRATIONS', $aRegistrationInfo); // get last 10 Registrations -$aLastRegisteredUsers = $user->getLastRegisteredUsers(); +$aLastRegisteredUsers = $user->getLastRegisteredUsers($iLimit, $registeredstart); $smarty->assign("LASTREGISTEREDUSERS", $aLastRegisteredUsers); // Fetching invitation Informations if (!$setting->getValue('disable_invitations')) { // get last 10 Inviters - $aTopInviters = $user->getTopInviters(); + $aTopInviters = $user->getTopInviters($iLimit, $invitersstart); $smarty->assign("TOPINVITERS", $aTopInviters); // Fetch global invitation information diff --git a/public/templates/mpos/admin/dashboard/invitation.tpl b/public/templates/mpos/admin/dashboard/invitation.tpl index 7b90b42d..cbaf2e72 100644 --- a/public/templates/mpos/admin/dashboard/invitation.tpl +++ b/public/templates/mpos/admin/dashboard/invitation.tpl @@ -25,6 +25,22 @@

Top 10 Inviters

+ + + + + + +
+{if $smarty.request.invitersstart|default:"0" > 0} + Previous 10 +{else} + +{/if} + + Next 10 +
+ diff --git a/public/templates/mpos/admin/dashboard/registrations.tpl b/public/templates/mpos/admin/dashboard/registrations.tpl index 43977924..c1b7700e 100644 --- a/public/templates/mpos/admin/dashboard/registrations.tpl +++ b/public/templates/mpos/admin/dashboard/registrations.tpl @@ -26,8 +26,25 @@
-

Last 10 registered Users

+

Last registered Users

+ +
+ + + + + +
+{if $smarty.request.registeredstart|default:"0" > 0} + Previous 10 +{else} + +{/if} + + Next 10 +
+