From 9d1d287e9a12dccd0fc913ce513b01769d6c29fb Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Tue, 2 Jan 2024 11:31:41 +0700 Subject: [PATCH 1/2] 2024.1.2 --- CHANGELOG.md | 4 ++++ version.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3b6bfa5..70e55327 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ # CHANGELOG +## 2024.1.2 + +- Pagination User Expired by @Focuslinkstech + ## 2023.12.21 - Modern AdminLTE by @sabtech254 diff --git a/version.json b/version.json index 09de8a94..eb2e0bbd 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "2023.12.21" + "version": "2024.1.2" } \ No newline at end of file From a25112a37f4ada517482794f417929b4cda6390c Mon Sep 17 00:00:00 2001 From: Focuslinkstech <45756999+Focuslinkstech@users.noreply.github.com> Date: Wed, 27 Dec 2023 20:10:56 +0100 Subject: [PATCH 2/2] add paginator add paginator to dashboard expire user list --- system/controllers/dashboard.php | 20 +++++++++++++++++++- ui/ui/dashboard.tpl | 3 ++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/system/controllers/dashboard.php b/system/controllers/dashboard.php index e3e3705d..fdef3aee 100644 --- a/system/controllers/dashboard.php +++ b/system/controllers/dashboard.php @@ -52,7 +52,25 @@ if (empty($c_all)) { $ui->assign('c_all', $c_all); //user expire -$expire = ORM::for_table('tbl_user_recharges')->whereLte('expiration', $mdate)->order_by_desc('id')->limit(30)->find_many(); +$paginator = Paginator::build(ORM::for_table('tbl_user_recharges')); +$expire = ORM::for_table('tbl_user_recharges') + ->where_lte('expiration', $mdate) + ->offset($paginator['startpoint']) + ->limit($paginator['limit']) + ->order_by_desc('id') + ->find_many(); + +// Get the total count of expired records for pagination +$totalCount = ORM::for_table('tbl_user_recharges') + ->where_lte('expiration', $mdate) + ->count(); + +// Pass the total count and current page to the paginator +$paginator['total_count'] = $totalCount; +$paginator['current_page'] = $paginator['current_page']; + +// Assign the pagination HTML to the template variable +$ui->assign('paginator', $paginator); $ui->assign('expire', $expire); //activity log diff --git a/ui/ui/dashboard.tpl b/ui/ui/dashboard.tpl index f3fbc7be..a063292e 100644 --- a/ui/ui/dashboard.tpl +++ b/ui/ui/dashboard.tpl @@ -119,6 +119,7 @@ {/foreach} +   {$paginator['contents']} @@ -162,4 +163,4 @@ }); -{include file="sections/footer.tpl"} \ No newline at end of file +{include file="sections/footer.tpl"}