forked from kevinowino869/mitrobill
getting ready for customizeable dashboard with widget
This commit is contained in:
30
system/widgets/customer_expired.php
Normal file
30
system/widgets/customer_expired.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
|
||||
class customer_expired
|
||||
{
|
||||
|
||||
|
||||
public function getWidget()
|
||||
{
|
||||
global $ui, $current_date;
|
||||
|
||||
//user expire
|
||||
$query = ORM::for_table('tbl_user_recharges')
|
||||
->where_lte('expiration', $current_date)
|
||||
->order_by_desc('expiration');
|
||||
$expire = Paginator::findMany($query);
|
||||
|
||||
// Get the total count of expired records for pagination
|
||||
$totalCount = ORM::for_table('tbl_user_recharges')
|
||||
->where_lte('expiration', $current_date)
|
||||
->count();
|
||||
|
||||
// Pass the total count and current page to the paginator
|
||||
$paginator['total_count'] = $totalCount;
|
||||
|
||||
// Assign the pagination HTML to the template variable
|
||||
$ui->assign('expire', $expire);
|
||||
return $ui->fetch('widget/customer_expired.tpl');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user