Merge pull request #86 from Focuslinkstech/master

add paginator
This commit is contained in:
iBNu Maksum 2024-01-02 11:28:27 +07:00 committed by GitHub
commit 4bddaf0260
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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>
@ -162,4 +163,4 @@
});
</script>
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}