From 532fbf733719e9cb525078fa739afe78fe689858 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Fri, 15 Mar 2024 09:46:01 +0700 Subject: [PATCH] Active plan on user page --- system/controllers/customers.php | 8 +- system/lan/english.json | 3 +- ui/compiled/index.html | 8 -- ui/ui/customers-view.tpl | 172 ++++++++++++++++--------------- 4 files changed, 94 insertions(+), 97 deletions(-) delete mode 100644 ui/compiled/index.html diff --git a/system/controllers/customers.php b/system/controllers/customers.php index b2624004..309650cf 100644 --- a/system/controllers/customers.php +++ b/system/controllers/customers.php @@ -216,7 +216,10 @@ switch ($action) { ->find_many(); $v = $routes['3']; - if (empty($v) || $v == 'order') { + if(empty($v)){ + $v = 'activation'; + } + if ($v == 'order') { $v = 'order'; $paginator = Paginator::build(ORM::for_table('tbl_payment_gateway'), ['username' => $customer['username']]); $order = ORM::for_table('tbl_payment_gateway') @@ -238,8 +241,7 @@ switch ($action) { $ui->assign('paginator', $paginator); $ui->assign('activation', $activation); } - $package = ORM::for_table('tbl_user_recharges')->where('username', $customer['username'])->find_one(); - $ui->assign('package', $package); + $ui->assign('packages', User::_billing($customer['id'])); $ui->assign('v', $v); $ui->assign('d', $customer); $ui->assign('customFields', $customFields); diff --git a/system/lan/english.json b/system/lan/english.json index e07b9d38..b8317e06 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -491,5 +491,6 @@ "Not_Found": "Not Found", "Cash": "Cash", "Payment_not_found": "Payment not found", - "If_your_friend_have_Additional_Cost__you_will_pay_for_that_too": "If your friend have Additional Cost, you will pay for that too" + "If_your_friend_have_Additional_Cost__you_will_pay_for_that_too": "If your friend have Additional Cost, you will pay for that too", + "Cache_cleared_successfully_": "Cache cleared successfully!" } \ No newline at end of file diff --git a/ui/compiled/index.html b/ui/compiled/index.html deleted file mode 100644 index 97579708..00000000 --- a/ui/compiled/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - 403 Forbidden - - -

Directory access is forbidden.

- - \ No newline at end of file diff --git a/ui/ui/customers-view.tpl b/ui/ui/customers-view.tpl index 328344d5..8e38dcad 100644 --- a/ui/ui/customers-view.tpl +++ b/ui/ui/customers-view.tpl @@ -30,20 +30,20 @@ onclick="this.select()"> {if $d['pppoe_password'] != ''} -
  • - PPPOE {Lang::T('Password')} -
  • +
  • + PPPOE {Lang::T('Password')} +
  • {/if} {if $customFields} - {foreach $customFields as $customField} -
  • - {$customField.field_name} {$customField.field_value} -
  • - {/foreach} + {foreach $customFields as $customField} +
  • + {$customField.field_name} {$customField.field_value} +
  • + {/foreach} {/if}
  • @@ -54,7 +54,8 @@
  • {Lang::T('Auto Renewal')} {if - $d['auto_renewal']}yes{else}no{/if} + $d['auto_renewal']}yes{else}no + {/if}
  • {Lang::T('Created On')} - {if $package} -
    -
    -

    {$package['type']} - {$package['namebp']}

    -
      + {foreach $packages as $package} +
      +
      +

      {$package['type']} - {$package['namebp']}

      +
        +
      • + {Lang::T('Active')} {if + $package['status']=='on'}yes{else}no + {/if} +
      • - {Lang::T('Active')} {if - $package['status']=='on'}yes{else}no{/if} + {Lang::T('Type')} + {if $package['prepaid'] eq yes}Prepaid{else}Postpaid{/if}
      • {Lang::T('Created On')} {Lang::dateAndTimeFormat($package['recharged_on'],$package['recharged_time'])}
      • - {Lang::T('Expires On')} {Lang::dateAndTimeFormat($package['expiration'], + {Lang::T('Expires On')} {Lang::dateAndTimeFormat($package['expiration'], $package['time'])}
      • @@ -119,10 +124,7 @@
    - {else} - {Lang::T('Recharge')}
    - {/if} + {/foreach} {Lang::T('Back')}
    @@ -135,68 +137,68 @@
    {if Lang::arrayCount($activation)} - - - - - - - - - - - - - - {foreach $activation as $ds} - - - - - - - - - - - {/foreach} - + + + + + + + + + + + + + + {foreach $activation as $ds} + + + + + + + + + + + {/foreach} + {/if} {if Lang::arrayCount($order)} - - - - - - - - - - - - - - - {foreach $order as $ds} - - - - - - - - - - - - {/foreach} - + + + + + + + + + + + + + + + {foreach $order as $ds} + + + + + + + + + + + + {/foreach} + {/if}
    {Lang::T('Invoice')}{Lang::T('Username')}{Lang::T('Plan Name')}{Lang::T('Plan Price')}{Lang::T('Type')}{Lang::T('Created On')}{Lang::T('Expires On')}{Lang::T('Method')}
    {$ds['invoice']}{$ds['username']}{$ds['plan_name']}{Lang::moneyFormat($ds['price'])}{$ds['type']}{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])} - {Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}{$ds['method']}
    {Lang::T('Invoice')}{Lang::T('Username')}{Lang::T('Plan Name')}{Lang::T('Plan Price')}{Lang::T('Type')}{Lang::T('Created On')}{Lang::T('Expires On')}{Lang::T('Method')}
    {$ds['invoice']}{$ds['username']}{$ds['plan_name']}{Lang::moneyFormat($ds['price'])}{$ds['type']}{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])} + {Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}{$ds['method']}
    {Lang::T('Plan Name')}{Lang::T('Gateway')}{Lang::T('Routers')}{Lang::T('Type')}{Lang::T('Plan Price')}{Lang::T('Created On')}{Lang::T('Expires On')}{Lang::T('Date Done')}{Lang::T('Method')}
    {$ds['plan_name']}{$ds['gateway']}{$ds['routers']}{$ds['payment_channel']}{Lang::moneyFormat($ds['price'])}{Lang::dateTimeFormat($ds['created_date'])}{Lang::dateTimeFormat($ds['expired_date'])}{if $ds['status']!=1}{Lang::dateTimeFormat($ds['paid_date'])}{/if}{if $ds['status']==1}{Lang::T('UNPAID')} - {elseif $ds['status']==2}{Lang::T('PAID')} - {elseif $ds['status']==3}{$_L['FAILED']} - {elseif $ds['status']==4}{Lang::T('CANCELED')} - {elseif $ds['status']==5}{Lang::T('UNKNOWN')} - {/if}
    {Lang::T('Plan Name')}{Lang::T('Gateway')}{Lang::T('Routers')}{Lang::T('Type')}{Lang::T('Plan Price')}{Lang::T('Created On')}{Lang::T('Expires On')}{Lang::T('Date Done')}{Lang::T('Method')}
    {$ds['plan_name']}{$ds['gateway']}{$ds['routers']}{$ds['payment_channel']}{Lang::moneyFormat($ds['price'])}{Lang::dateTimeFormat($ds['created_date'])}{Lang::dateTimeFormat($ds['expired_date'])}{if $ds['status']!=1}{Lang::dateTimeFormat($ds['paid_date'])}{/if}{if $ds['status']==1}{Lang::T('UNPAID')} + {elseif $ds['status']==2}{Lang::T('PAID')} + {elseif $ds['status']==3}{$_L['FAILED']} + {elseif $ds['status']==4}{Lang::T('CANCELED')} + {elseif $ds['status']==5}{Lang::T('UNKNOWN')} + {/if}