diff --git a/system/controllers/dashboard.php b/system/controllers/dashboard.php index e3e3705..fdef3ae 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 f3fbc7b..a063292 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"}