add paginator

add paginator to dashboard expire user list
This commit is contained in:
Focuslinkstech 2023-12-27 20:10:56 +01:00
parent c1f04c17a5
commit 43ed5e452e
2 changed files with 21 additions and 2 deletions

View file

@ -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

View file

@ -119,6 +119,7 @@
{/foreach}
</table>
</div>
&nbsp; {$paginator['contents']}
</div>
</div>