diff --git a/system/controllers/settings.php b/system/controllers/settings.php index 6a5625c6..8423c91b 100644 --- a/system/controllers/settings.php +++ b/system/controllers/settings.php @@ -206,6 +206,8 @@ switch ($action) { case 'app-post': $company = _post('company'); $footer = _post('footer'); + $enable_balance = _post('enable_balance'); + $allow_balance_transfer = _post('allow_balance_transfer'); $disable_voucher = _post('disable_voucher'); $telegram_bot = _post('telegram_bot'); $telegram_target_id = _post('telegram_target_id'); @@ -257,6 +259,28 @@ switch ($action) { $d->save(); } + $d = ORM::for_table('tbl_appconfig')->where('setting', 'enable_balance')->find_one(); + if($d){ + $d->value = $enable_balance; + $d->save(); + }else{ + $d = ORM::for_table('tbl_appconfig')->create(); + $d->setting = 'enable_balance'; + $d->value = $enable_balance; + $d->save(); + } + + $d = ORM::for_table('tbl_appconfig')->where('setting', 'allow_balance_transfer')->find_one(); + if($d){ + $d->value = $allow_balance_transfer; + $d->save(); + }else{ + $d = ORM::for_table('tbl_appconfig')->create(); + $d->setting = 'allow_balance_transfer'; + $d->value = $allow_balance_transfer; + $d->save(); + } + $d = ORM::for_table('tbl_appconfig')->where('setting', 'telegram_bot')->find_one(); if($d){ $d->value = $telegram_bot; diff --git a/ui/ui/app-settings.tpl b/ui/ui/app-settings.tpl index f8ffb419..4a9131d7 100644 --- a/ui/ui/app-settings.tpl +++ b/ui/ui/app-settings.tpl @@ -4,7 +4,13 @@
Voucher activation menu will be hidden
Customer can deposit money to buy voucher
+Allow balance transfer between customers
+{Lang::T('[[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name.')}
+ ++ {Lang::T('[[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name.')} +
{Lang::T('User will get invoice notification when buy package or package refilled')}
++ {Lang::T('User will get invoice notification when buy package or package refilled')}
/ip hotspot walled-garden add dst-host={$_domain} diff --git a/ui/ui/user-dashboard.tpl b/ui/ui/user-dashboard.tpl index ed4a7858..71ec9908 100644 --- a/ui/ui/user-dashboard.tpl +++ b/ui/ui/user-dashboard.tpl @@ -62,6 +62,12 @@ style="background-color: black; color:black; width:100%; border: 0px;" onclick="this.select()"> + {if $_c['enable_balance'] == 'yes'} ++ + {/if}{Lang::T('Balance')} +{Lang::moneyFormat($_user['balance'])} +{$_L['Plan_Name']} {$_bill['namebp']}