diff --git a/system/autoload/User.php b/system/autoload/User.php index c8b09197..86d42c31 100644 --- a/system/autoload/User.php +++ b/system/autoload/User.php @@ -56,6 +56,22 @@ class User return [$bills, $addcost]; } + public static function getBillNames($id = 0) + { + if (!$id) { + $id = User::getID(); + if (!$id) { + return []; + } + } + $bills = []; + $attrs = User::getAttributes('Bill', $id); + foreach ($attrs as $k => $v) { + $bills[] = str_replace(' Bill', '', $k); + } + return $bills; + } + public static function billsPaid($bills, $id = 0) { if (!$id) { diff --git a/system/controllers/autoload_user.php b/system/controllers/autoload_user.php index 5fabf893..78c2b2ab 100644 --- a/system/controllers/autoload_user.php +++ b/system/controllers/autoload_user.php @@ -29,7 +29,7 @@ switch ($action) { if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) { die('' . Lang::T('Not Online, Login now?') . ''); } else { - die(Lang::T('Your account not connected to internet')); + die(Lang::T('-')); } } } else { diff --git a/system/controllers/home.php b/system/controllers/home.php index 7971f43a..71c7645d 100644 --- a/system/controllers/home.php +++ b/system/controllers/home.php @@ -291,5 +291,9 @@ $ui->assign('unpaid', ORM::for_table('tbl_payment_gateway') ->where('status', 1) ->find_one()); $ui->assign('code', alphanumeric(_get('code'), "-")); + +$abills = User::getAttributes("Bill"); +$ui->assign('abills', $abills); + run_hook('view_customer_dashboard'); #HOOK $ui->display('user-dashboard.tpl'); diff --git a/system/lan/english.json b/system/lan/english.json index a8dfe950..77eebd2e 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -658,6 +658,8 @@ "Activate_Voucher": "Activate Voucher", "Voucher_invalid": "Voucher invalid", "Account_Not_Found": "Account Not Found", - "Voucher_activation_success__now_you_can_login": "Voucher activation success, now you can login", - "Internet_Voucher_Expired": "Internet Voucher Expired" + "Internet_Voucher_Expired": "Internet Voucher Expired", + "": "", + "Additional_Billing": "Additional Billing", + "_": "-" } \ No newline at end of file diff --git a/ui/ui/user-dashboard.tpl b/ui/ui/user-dashboard.tpl index 158a4803..34c12fbc 100644 --- a/ui/ui/user-dashboard.tpl +++ b/ui/ui/user-dashboard.tpl @@ -106,6 +106,36 @@ {/if} + {if $abills && count($abills)>0} +
{str_replace(' Bill', '', $k)} | ++ {if strpos($v, ':') === false} + {Lang::moneyFormat($v)} + ∞ + {assign var="total" value=$v+$total} + {else} + {assign var="exp" value=explode(':',$v)} + {Lang::moneyFormat($exp[0])} + {$exp[1]}x + {assign var="total" value=$exp[0]+$total} + {/if} + | +
{Lang::T('Total')} | +{Lang::moneyFormat($total)} | +