From 783b54164510140d4179cee2e58430427023bc68 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Tue, 15 Aug 2023 10:27:46 +0700 Subject: [PATCH] Auto Renewal Button --- system/controllers/home.php | 5 +++ system/lan/english/common.lan.php | 4 ++ ui/ui/user-dashboard.tpl | 67 ++++++++++++++++++------------- 3 files changed, 47 insertions(+), 29 deletions(-) diff --git a/system/controllers/home.php b/system/controllers/home.php index a4372225..6108d816 100644 --- a/system/controllers/home.php +++ b/system/controllers/home.php @@ -9,6 +9,11 @@ $ui->assign('_title', $_L['Dashboard']); $user = User::_info(); $ui->assign('_user', $user); +if(isset($_GET['renewal'])){ + $user->auto_renewal = $_GET['renewal']; + $user->save(); +} + //Client Page $bill = User::_billing(); diff --git a/system/lan/english/common.lan.php b/system/lan/english/common.lan.php index b03853b9..0516eea8 100644 --- a/system/lan/english/common.lan.php +++ b/system/lan/english/common.lan.php @@ -359,3 +359,7 @@ $_L['Balance_Plans'] = 'Balance Plans'; $_L['Buy_Balance'] = 'Buy Balance?'; $_L['Price'] = 'Price'; $_L['Validity'] = 'Validity'; +$_L['Disable_auto_renewal'] = 'Disable auto renewal?'; +$_L['Auto_Renewal_On'] = 'Auto Renewal On'; +$_L['Enable_auto_renewal'] = 'Enable auto renewal?'; +$_L['Auto_Renewal_Off'] = 'Auto Renewal Off'; diff --git a/ui/ui/user-dashboard.tpl b/ui/ui/user-dashboard.tpl index 71ec9908..80851465 100644 --- a/ui/ui/user-dashboard.tpl +++ b/ui/ui/user-dashboard.tpl @@ -65,7 +65,16 @@ {if $_c['enable_balance'] == 'yes'} {Lang::T('Balance')} - {Lang::moneyFormat($_user['balance'])} + + {Lang::moneyFormat($_user['balance'])} + {if $_user['auto_renewal'] == 1} + {Lang::T('Auto Renewal On')} + {else} + {Lang::T('Auto Renewal Off')} + {/if} + {/if} @@ -131,39 +140,39 @@ {/if}
{if $_c['disable_voucher'] != 'yes'} -
-
-

{$_L['Voucher_Activation']}

-
-
-
-
- -
- +
+
+

{$_L['Voucher_Activation']}

+
+
+ +
+ +
+ +
-
-
- -
- -
-
-
- - - {$_L['Order_Voucher']} - - {if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' } - +
+ +
+ +
+
+
+ - {Lang::T('Order Package')} + {$_L['Order_Voucher']} - {/if} + {if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' } + + + {Lang::T('Order Package')} + + {/if} +
-
{/if}