Auto Renewal Button

This commit is contained in:
Ibnu Maksum 2023-08-15 10:27:46 +07:00
parent 7e78c5db40
commit 783b541645
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
3 changed files with 47 additions and 29 deletions

View File

@ -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();

View File

@ -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';

View File

@ -65,7 +65,16 @@
{if $_c['enable_balance'] == 'yes'}
<tr>
<td class="small text-warning text-uppercase text-normal">{Lang::T('Balance')}</td>
<td class="small mb15 text-bold">{Lang::moneyFormat($_user['balance'])}</td>
<td class="small mb15 text-bold">
{Lang::moneyFormat($_user['balance'])}
{if $_user['auto_renewal'] == 1}
<a class="label label-success pull-right" href="{$_url}home&renewal=0"
onclick="return confirm('{Lang::T('Disable auto renewal?')}')">{Lang::T('Auto Renewal On')}</a>
{else}
<a class="label label-danger pull-right" href="{$_url}home&renewal=1"
onclick="return confirm('{Lang::T('Enable auto renewal?')}')">{Lang::T('Auto Renewal Off')}</a>
{/if}
</td>
</tr>
{/if}
<tr>