diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8b873a0b..27896602 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,11 @@
# CHANGELOG
+## 2024.9.23
+
+- Discount Price
+- Burst Preset
+
## 2024.9.20
- Forgot Password
diff --git a/system/controllers/services.php b/system/controllers/services.php
index 9bc32e5e..40e546c8 100644
--- a/system/controllers/services.php
+++ b/system/controllers/services.php
@@ -83,9 +83,9 @@ switch ($action) {
$bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'Hotspot')->findArray();
$ids = array_column($bws, 'id_bw');
- if(count($ids)){
+ if (count($ids)) {
$ui->assign('bws', ORM::for_table('tbl_bandwidth')->select("id")->select('name_bw')->where_id_in($ids)->findArray());
- }else{
+ } else {
$ui->assign('bws', []);
}
$ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type"));
@@ -321,6 +321,7 @@ switch ($action) {
$id_bw = _post('id_bw');
$typebp = _post('typebp');
$price = _post('price');
+ $price_old = _post('price_old');
$limit_type = _post('limit_type');
$time_limit = _post('time_limit');
$time_unit = _post('time_unit');
@@ -353,6 +354,11 @@ switch ($action) {
} else {
$msg .= Lang::T('Data Not Found') . '
';
}
+
+ if ($price_old <= $price) {
+ $price_old = '';
+ }
+
run_hook('edit_plan'); #HOOK
if ($msg == '') {
$b = ORM::for_table('tbl_bandwidth')->where('id', $id_bw)->find_one();
@@ -378,6 +384,7 @@ switch ($action) {
$d->name_plan = $name;
$d->id_bw = $id_bw;
$d->price = $price; // Set price with or without tax based on configuration
+ $d->price_old = $price_old;
$d->typebp = $typebp;
$d->limit_type = $limit_type;
$d->time_limit = $time_limit;
@@ -453,9 +460,9 @@ switch ($action) {
$bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'PPPOE')->findArray();
$ids = array_column($bws, 'id_bw');
- if(count($ids)){
+ if (count($ids)) {
$ui->assign('bws', ORM::for_table('tbl_bandwidth')->select("id")->select('name_bw')->where_id_in($ids)->findArray());
- }else{
+ } else {
$ui->assign('bws', []);
}
$ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type"));
@@ -705,6 +712,7 @@ switch ($action) {
$name = _post('name_plan');
$id_bw = _post('id_bw');
$price = _post('price');
+ $price_old = _post('price_old');
$validity = _post('validity');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
@@ -728,6 +736,10 @@ switch ($action) {
$msg .= Lang::T('All field is required') . '
';
}
+ if ($price_old <= $price) {
+ $price_old = '';
+ }
+
$d = ORM::for_table('tbl_plans')->where('id', $id)->find_one();
$old = ORM::for_table('tbl_plans')->where('id', $id)->find_one();
if ($d) {
@@ -758,6 +770,7 @@ switch ($action) {
$d->name_plan = $name;
$d->id_bw = $id_bw;
$d->price = $price;
+ $d->price_old = $price_old;
$d->plan_type = $plan_type;
$d->validity = $validity;
$d->validity_unit = $validity_unit;
@@ -835,6 +848,7 @@ switch ($action) {
$id = _post('id');
$name = _post('name');
$price = _post('price');
+ $price_old = _post('price_old');
$enabled = _post('enabled');
$prepaid = _post('prepaid');
@@ -851,11 +865,15 @@ switch ($action) {
} else {
$msg .= Lang::T('Data Not Found') . '
';
}
+ if ($price_old <= $price) {
+ $price_old = '';
+ }
run_hook('edit_ppoe'); #HOOK
if ($msg == '') {
$d->name_plan = $name;
$d->price = $price;
$d->enabled = $enabled;
+ $d->price_old = $price_old;
$d->prepaid = 'yes';
$d->save();
@@ -935,9 +953,9 @@ switch ($action) {
$bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'VPN')->findArray();
$ids = array_column($bws, 'id_bw');
- if(count($ids)){
+ if (count($ids)) {
$ui->assign('bws', ORM::for_table('tbl_bandwidth')->select("id")->select('name_bw')->where_id_in($ids)->findArray());
- }else{
+ } else {
$ui->assign('bws', []);
}
$ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type"));
@@ -1187,6 +1205,7 @@ switch ($action) {
$name = _post('name_plan');
$id_bw = _post('id_bw');
$price = _post('price');
+ $price_old = _post('price_old');
$validity = _post('validity');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
@@ -1210,6 +1229,10 @@ switch ($action) {
$msg .= Lang::T('All field is required') . '
';
}
+ if($price_old<=$price){
+ $price_old = '';
+ }
+
$d = ORM::for_table('tbl_plans')->where('id', $id)->find_one();
$old = ORM::for_table('tbl_plans')->where('id', $id)->find_one();
if ($d) {
@@ -1240,6 +1263,7 @@ switch ($action) {
$d->name_plan = $name;
$d->id_bw = $id_bw;
$d->price = $price;
+ $d->price_old = $price_old;
$d->plan_type = $plan_type;
$d->validity = $validity;
$d->validity_unit = $validity_unit;
diff --git a/ui/ui/balance-edit.tpl b/ui/ui/balance-edit.tpl
index 5c7d53ad..d26ff488 100644
--- a/ui/ui/balance-edit.tpl
+++ b/ui/ui/balance-edit.tpl
@@ -1,59 +1,68 @@
{include file="sections/header.tpl"}
-
-
-
-
{Lang::T('Edit Service Package')}
-
-
-
-{include file="sections/footer.tpl"}
+{include file="sections/footer.tpl"}
\ No newline at end of file
diff --git a/ui/ui/balance.tpl b/ui/ui/balance.tpl
index 8a09dad1..ce2b8b38 100644
--- a/ui/ui/balance.tpl
+++ b/ui/ui/balance.tpl
@@ -36,7 +36,9 @@
{foreach $d as $ds}
{$ds['name_plan']} |
- {Lang::moneyFormat($ds['price'])} |
+ {Lang::moneyFormat($ds['price'])}{if !empty($ds['price_old'])}
+ {Lang::moneyFormat($ds['price_old'])}
+ {/if} |
{Lang::T('Edit')}
diff --git a/ui/ui/hotspot-edit.tpl b/ui/ui/hotspot-edit.tpl
index 0818009a..86fe3c42 100644
--- a/ui/ui/hotspot-edit.tpl
+++ b/ui/ui/hotspot-edit.tpl
@@ -151,7 +151,7 @@
-
@@ -72,7 +72,7 @@
@@ -81,7 +81,7 @@
@@ -136,39 +136,43 @@
|
{foreach $d as $ds}
-
- {$ds['name_plan']} |
- {if $ds['prepaid'] == no}Postpaid{else}Prepaid{/if} {$ds['plan_type']} |
- {$ds['name_bw']} |
- {$ds['typebp']} |
- {Lang::moneyFormat($ds['price'])} |
- {$ds['validity']} {$ds['validity_unit']} |
- {$ds['time_limit']} {$ds['time_unit']} |
- {$ds['data_limit']} {$ds['data_unit']} |
-
- {if $ds['is_radius']}
- RADIUS
- {else}
- {if $ds['routers']!=''}
- {$ds['routers']}
- {/if}
- {/if}
- |
- {$ds['device']} |
- {if $ds['plan_expired']}{Lang::T('Yes')}{else}{Lang::T('No')}
- {/if} |
- {if $ds['prepaid'] == no}{$ds['expired_date']}{/if} |
- {$ds['id']} |
-
- {Lang::T('Edit')}
-
- |
-
+
+ {$ds['name_plan']} |
+ {if $ds['prepaid'] == no}Postpaid{else}Prepaid{/if} {$ds['plan_type']} |
+ {$ds['name_bw']} |
+ {$ds['typebp']} |
+ {Lang::moneyFormat($ds['price'])}
+ {if !empty($ds['price_old'])}
+ {Lang::moneyFormat($ds['price_old'])}
+ {/if}
+ |
+ {$ds['validity']} {$ds['validity_unit']} |
+ {$ds['time_limit']} {$ds['time_unit']} |
+ {$ds['data_limit']} {$ds['data_unit']} |
+
+ {if $ds['is_radius']}
+ RADIUS
+ {else}
+ {if $ds['routers']!=''}
+ {$ds['routers']}
+ {/if}
+ {/if}
+ |
+ {$ds['device']} |
+ {if $ds['plan_expired']}{Lang::T('Yes')}{else}{Lang::T('No')}
+ {/if} |
+ {if $ds['prepaid'] == no}{$ds['expired_date']}{/if} |
+ {$ds['id']} |
+
+ {Lang::T('Edit')}
+
+ |
+
{/foreach}
diff --git a/ui/ui/pppoe-edit.tpl b/ui/ui/pppoe-edit.tpl
index 448b9b6b..66250c48 100644
--- a/ui/ui/pppoe-edit.tpl
+++ b/ui/ui/pppoe-edit.tpl
@@ -91,7 +91,7 @@
-
@@ -72,7 +72,7 @@
@@ -81,7 +81,7 @@
@@ -132,12 +132,18 @@
{foreach $d as $ds}
-
- {$ds['name_plan']} |
- {$ds['plan_type']} {if $ds['prepaid'] !=
- 'yes'}{Lang::T('Postpaid')}{else}{Lang::T('Prepaid')}{/if} |
+
+ {$ds['name_plan']} |
+ {$ds['plan_type']} {if $ds['prepaid'] !=
+ 'yes'}{Lang::T('Postpaid')}
+ {else}
+ {Lang::T('Prepaid')}
+ {/if} |
{$ds['name_bw']} |
- {Lang::moneyFormat($ds['price'])} |
+ {Lang::moneyFormat($ds['price'])}{if !empty($ds['price_old'])}
+ {Lang::moneyFormat($ds['price_old'])}
+ {/if}
+ |
{$ds['validity']} {$ds['validity_unit']} |
{$ds['pool']} |
{if $ds['plan_expired']}{if $ds['prepaid'] == no}{$ds['expired_date']}{/if} |
{if $ds['is_radius']}
- RADIUS
+ RADIUS
{else}
- {if $ds['routers']!=''}
- {$ds['routers']}
- {/if}
+ {if $ds['routers']!=''}
+ {$ds['routers']}
+ {/if}
{/if}
|
{$ds['device']} |
diff --git a/ui/ui/user-ui/orderBalance.tpl b/ui/ui/user-ui/orderBalance.tpl
index e541751d..86296053 100644
--- a/ui/ui/user-ui/orderBalance.tpl
+++ b/ui/ui/user-ui/orderBalance.tpl
@@ -3,35 +3,39 @@
{if $_c['enable_balance'] == 'yes'}
-
-
-
- {foreach $plans_balance as $plan}
-
-
-
-
-
-
-
-
- {Lang::T('Price')} |
- {Lang::moneyFormat($plan['price'])} |
-
-
-
+
+
+
+ {foreach $plans_balance as $plan}
+
+
+
+
+
+
+
+
+ {Lang::T('Price')} |
+ {Lang::moneyFormat($plan['price'])}
+ {if !empty($plan['price_old'])}
+ {Lang::moneyFormat($plan['price_old'])}
+ {/if}
+ |
+
+
+
+
+
+
-
-
+ {/foreach}
- {/foreach}
-
{/if}
diff --git a/ui/ui/user-ui/orderPlan.tpl b/ui/ui/user-ui/orderPlan.tpl
index 9db514ff..27d366a8 100644
--- a/ui/ui/user-ui/orderPlan.tpl
+++ b/ui/ui/user-ui/orderPlan.tpl
@@ -6,113 +6,121 @@
{if $_c['radius_enable']}
- {if $_user['service_type'] == 'PPPoE'}
- {if Lang::arrayCount($radius_pppoe)>0}
-
- - {if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}
- - {if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}
-
-
- {foreach $radius_pppoe as $plan}
-
-
-
-
-
-
-
-
- {Lang::T('Type')} |
- {$plan['type']} |
-
-
- {Lang::T('Price')} |
- {Lang::moneyFormat($plan['price'])} |
-
-
- {Lang::T('Validity')} |
- {$plan['validity']} {$plan['validity_unit']} |
-
-
-
+ {if $_user['service_type'] == 'PPPoE'}
+ {if Lang::arrayCount($radius_pppoe)>0}
+
+ - {if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}
+ - {if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}
+
+
+ {foreach $radius_pppoe as $plan}
+
+
+
+
+
+
+
+
+ {Lang::T('Type')} |
+ {$plan['type']} |
+
+
+ {Lang::T('Price')} |
+ {Lang::moneyFormat($plan['price'])}
+ {if !empty($plan['price_old'])}
+ {Lang::moneyFormat($plan['price_old'])}
+ {/if}
+ |
+
+
+ {Lang::T('Validity')} |
+ {$plan['validity']} {$plan['validity_unit']} |
+
+
+
+
+
+
+
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
+ $_user['balance']>=$plan['price']}
+
{Lang::T('Buy for friend')}
+ {/if}
+
+
-
-
-
- {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
- $_user['balance']>=$plan['price']}
-
{Lang::T('Buy for friend')}
- {/if}
-
+ {/foreach}
-
- {/foreach}
-
- {/if}
+ {/if}
{elseif $_user['service_type'] == 'Hotspot'}
- {if Lang::arrayCount($radius_hotspot)>0}
-
- - {if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}
- - {if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
-
-
- {foreach $radius_hotspot as $plan}
-
-
-
-
-
-
-
-
- {Lang::T('Type')} |
- {$plan['type']} |
-
-
- {Lang::T('Price')} |
- {Lang::moneyFormat($plan['price'])} |
-
-
- {Lang::T('Validity')} |
- {$plan['validity']} {$plan['validity_unit']} |
-
-
-
+ {if Lang::arrayCount($radius_hotspot)>0}
+
+ - {if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}
+ - {if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
+
+
+ {foreach $radius_hotspot as $plan}
+
+
+
+
+
+
+
+
+ {Lang::T('Type')} |
+ {$plan['type']} |
+
+
+ {Lang::T('Price')} |
+ {Lang::moneyFormat($plan['price'])}
+ {if !empty($plan['price_old'])}
+ {Lang::moneyFormat($plan['price_old'])}
+ {/if}
+ |
+
+
+ {Lang::T('Validity')} |
+ {$plan['validity']} {$plan['validity_unit']} |
+
+
+
+
+
+
+
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
+ $_user['balance']>=$plan['price']}
+
{Lang::T('Buy for friend')}
+ {/if}
+
-
-
- {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
- $_user['balance']>=$plan['price']}
-
{Lang::T('Buy for friend')}
- {/if}
-
-
+ {/foreach}
- {/foreach}
-
{/if}
{elseif $_user['service_type'] == 'Others' || $_user['service_type'] == '' && (Lang::arrayCount($radius_pppoe)>0
|| Lang::arrayCount($radius_hotspot)>0)}
@@ -121,274 +129,294 @@
{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}
{if Lang::arrayCount($radius_pppoe)>0}
-
- {foreach $radius_pppoe as $plan}
-
-
-
-
-
-
-
-
- {Lang::T('Type')} |
- {$plan['type']} |
-
-
- {Lang::T('Price')} |
- {Lang::moneyFormat($plan['price'])} |
-
-
- {Lang::T('Validity')} |
- {$plan['validity']} {$plan['validity_unit']} |
-
-
-
-
-
-
-
-
{Lang::T('Buy')}
- {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
-
{Lang::T('Pay With Balance')}
+
+ {foreach $radius_pppoe as $plan}
+
+
+
+
+
+
+
+
+ {Lang::T('Type')} |
+ {$plan['type']} |
+
+
+ {Lang::T('Price')} |
+ {Lang::moneyFormat($plan['price'])}
+ {if !empty($plan['price_old'])}
+ {Lang::moneyFormat($plan['price_old'])}
+ {/if}
+ |
+
+
+ {Lang::T('Validity')} |
+ {$plan['validity']} {$plan['validity_unit']} |
+
+
+
+
+
+
+
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
+ $_user['balance']>=$plan['price']}
+
{Lang::T('Buy for friend')}
{/if}
- {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
- $_user['balance']>=$plan['price']}
-
{Lang::T('Buy for friend')}
- {/if}
-
{/foreach}
{/if}
{if Lang::arrayCount($radius_hotspot)>0}
-
- - {if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}
- - {if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
-
-
- {foreach $radius_hotspot as $plan}
-
-
-
-
-
-
-
-
- {Lang::T('Type')} |
- {$plan['type']} |
-
-
- {Lang::T('Price')} |
- {Lang::moneyFormat($plan['price'])} |
-
-
- {Lang::T('Validity')} |
- {$plan['validity']} {$plan['validity_unit']} |
-
-
-
-
-
-
-
-
{Lang::T('Buy')}
- {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
-
{Lang::T('Pay With Balance')}
+
+ - {if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}
+ - {if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
+
+
+ {foreach $radius_hotspot as $plan}
+
+
+
+
+
+
+
+
+ {Lang::T('Type')} |
+ {$plan['type']} |
+
+
+ {Lang::T('Price')} |
+ {Lang::moneyFormat($plan['price'])}
+ {if !empty($plan['price_old'])}
+ {Lang::moneyFormat($plan['price_old'])}
+ {/if}
+ |
+
+
+ {Lang::T('Validity')} |
+ {$plan['validity']} {$plan['validity_unit']} |
+
+
+
+
+
+
+
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
+ $_user['balance']>=$plan['price']}
+
{Lang::T('Buy for friend')}
{/if}
- {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
- $_user['balance']>=$plan['price']}
-
{Lang::T('Buy for friend')}
- {/if}
-
{/foreach}
{/if}
{/if}
{/if}
{foreach $routers as $router}
- {if Validator::isRouterHasPlan($plans_hotspot, $router['name']) || Validator::isRouterHasPlan($plans_pppoe,
- $router['name']) || Validator::isRouterHasPlan($plans_vpn,
- $router['name'])}
-
-
- {if $router['description'] != ''}
-
- {$router['description']}
-
- {/if}
- {if $_user['service_type'] == 'Hotspot' && Validator::countRouterPlan($plans_hotspot, $router['name'])>0}
-
-
- {foreach $plans_hotspot as $plan}
- {if $router['name'] eq $plan['routers']}
-
-
-
-
-
-
-
-
- {Lang::T('Type')} |
- {$plan['type']} |
-
-
- {Lang::T('Price')} |
- {Lang::moneyFormat($plan['price'])} |
-
-
- {Lang::T('Validity')} |
- {$plan['validity']} {$plan['validity_unit']} |
-
-
-
-
-
-
-
- {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
- $_user['balance']>=$plan['price']}
-
{Lang::T('Buy for friend')}
- {/if}
-
+ {if Validator::isRouterHasPlan($plans_hotspot, $router['name']) || Validator::isRouterHasPlan($plans_pppoe,
+ $router['name']) || Validator::isRouterHasPlan($plans_vpn,
+ $router['name'])}
+
+
+ {if $router['description'] != ''}
+
+ {$router['description']}
-
{/if}
- {/foreach}
-
+ {if $_user['service_type'] == 'Hotspot' && Validator::countRouterPlan($plans_hotspot, $router['name'])>0}
+
+
+ {foreach $plans_hotspot as $plan}
+ {if $router['name'] eq $plan['routers']}
+
+
+
+
+
+
+
+
+ {Lang::T('Type')} |
+ {$plan['type']} |
+
+
+ {Lang::T('Price')} |
+ {Lang::moneyFormat($plan['price'])}
+ {if !empty($plan['price_old'])}
+ {Lang::moneyFormat($plan['price_old'])}
+ {/if}
+ |
+
+
+ {Lang::T('Validity')} |
+ {$plan['validity']} {$plan['validity_unit']} |
+
+
+
+
+
+
+
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
+ $_user['balance']>=$plan['price']}
+
{Lang::T('Buy for friend')}
+ {/if}
+
+
+
+ {/if}
+ {/foreach}
+
{/if}
{if $_user['service_type'] == 'PPPoE' && Validator::countRouterPlan($plans_pppoe,$router['name'])>0}
-
-
- {foreach $plans_pppoe as $plan}
- {if $router['name'] eq $plan['routers']}
-
-
-
-
-
-
-
-
- {Lang::T('Type')} |
- {$plan['type']} |
-
-
- {Lang::T('Price')} |
- {Lang::moneyFormat($plan['price'])} |
-
-
- {Lang::T('Validity')} |
- {$plan['validity']} {$plan['validity_unit']} |
-
-
-
+
+
+ {foreach $plans_pppoe as $plan}
+ {if $router['name'] eq $plan['routers']}
+
+
+
+
+
+
+
+
+ {Lang::T('Type')} |
+ {$plan['type']} |
+
+
+ {Lang::T('Price')} |
+ {Lang::moneyFormat($plan['price'])}
+ {if !empty($plan['price_old'])}
+ {Lang::moneyFormat($plan['price_old'])}
+ {/if}
+ |
+
+
+ {Lang::T('Validity')} |
+ {$plan['validity']} {$plan['validity_unit']} |
+
+
+
+
+
+
+
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
+ $_user['balance']>=$plan['price']}
+
{Lang::T('Buy for friend')}
+ {/if}
+
-
-
- {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
- $_user['balance']>=$plan['price']}
-
{Lang::T('Buy for friend')}
- {/if}
-
-
-
- {/if}
+ {/if}
{/foreach}
{/if}
- {if $_user['service_type'] == 'VPN' && Validator::countRouterPlan($plans_vpn,$router['name'])>0}
-
-
- {foreach $plans_vpn as $plan}
- {if $router['name'] eq $plan['routers']}
-
-
-
-
-
-
-
-
- {Lang::T('Type')} |
- {$plan['type']} |
-
-
- {Lang::T('Price')} |
- {Lang::moneyFormat($plan['price'])} |
-
-
- {Lang::T('Validity')} |
- {$plan['validity']} {$plan['validity_unit']} |
-
-
-
+ {if $_user['service_type'] == 'VPN' && Validator::countRouterPlan($plans_vpn,$router['name'])>0}
+
+
+ {foreach $plans_vpn as $plan}
+ {if $router['name'] eq $plan['routers']}
+
+
+
+
+
+
+
+
+ {Lang::T('Type')} |
+ {$plan['type']} |
+
+
+ {Lang::T('Price')} |
+ {Lang::moneyFormat($plan['price'])}
+ {if !empty($plan['price_old'])}
+ {Lang::moneyFormat($plan['price_old'])}
+ {/if}
+ |
+
+
+ {Lang::T('Validity')} |
+ {$plan['validity']} {$plan['validity_unit']} |
+
+
+
+
+
+
+
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
+ $_user['balance']>=$plan['price']}
+
{Lang::T('Buy for friend')}
+ {/if}
+
-
-
- {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
- $_user['balance']>=$plan['price']}
-
{Lang::T('Buy for friend')}
- {/if}
-
-
-
- {/if}
+ {/if}
{/foreach}
{/if}
@@ -400,150 +428,162 @@
{foreach $plans_hotspot as $plan}
- {if $router['name'] eq $plan['routers']}
-
-
-
-
-
-
-
-
- {Lang::T('Type')} |
- {$plan['type']} |
-
-
- {Lang::T('Price')} |
- {Lang::moneyFormat($plan['price'])} |
-
-
- {Lang::T('Validity')} |
- {$plan['validity']} {$plan['validity_unit']} |
-
-
-
-
-
-
-
-
{Lang::T('Buy')}
- {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
-
{Lang::T('Pay With Balance')}
+ {if $router['name'] eq $plan['routers']}
+
+
+
+
+
+
+
+
+ {Lang::T('Type')} |
+ {$plan['type']} |
+
+
+ {Lang::T('Price')} |
+ {Lang::moneyFormat($plan['price'])}
+ {if !empty($plan['price_old'])}
+ {Lang::moneyFormat($plan['price_old'])}
+ {/if}
+ |
+
+
+ {Lang::T('Validity')} |
+ {$plan['validity']} {$plan['validity_unit']} |
+
+
+
+
+
+
+
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
+ $_user['balance']>=$plan['price']}
+
{Lang::T('Buy for friend')}
{/if}
- {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
- $_user['balance']>=$plan['price']}
-
{Lang::T('Buy for friend')}
- {/if}
-
{/if}
{/foreach}
{foreach $plans_pppoe as $plan}
- {if $router['name'] eq $plan['routers']}
-
-
-
-
-
-
-
-
- {Lang::T('Type')} |
- {$plan['type']} |
-
-
- {Lang::T('Price')} |
- {Lang::moneyFormat($plan['price'])} |
-
-
- {Lang::T('Validity')} |
- {$plan['validity']} {$plan['validity_unit']} |
-
-
-
-
-
-
-
-
{Lang::T('Buy')}
- {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
-
{Lang::T('Pay With Balance')}
+ {if $router['name'] eq $plan['routers']}
+
+
+
+
+
+
+
+
+ {Lang::T('Type')} |
+ {$plan['type']} |
+
+
+ {Lang::T('Price')} |
+ {Lang::moneyFormat($plan['price'])}
+ {if !empty($plan['price_old'])}
+ {Lang::moneyFormat($plan['price_old'])}
+ {/if}
+ |
+
+
+ {Lang::T('Validity')} |
+ {$plan['validity']} {$plan['validity_unit']} |
+
+
+
+
+
+
+
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
+ $_user['balance']>=$plan['price']}
+
{Lang::T('Buy for friend')}
{/if}
- {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
- $_user['balance']>=$plan['price']}
-
{Lang::T('Buy for friend')}
- {/if}
-
{/if}
{/foreach}
{foreach $plans_vpn as $plan}
- {if $router['name'] eq $plan['routers']}
-
-
-
-
-
-
-
-
- {Lang::T('Type')} |
- {$plan['type']} |
-
-
- {Lang::T('Price')} |
- {Lang::moneyFormat($plan['price'])} |
-
-
- {Lang::T('Validity')} |
- {$plan['validity']} {$plan['validity_unit']} |
-
-
-
-
-
-
-
-
{Lang::T('Buy')}
- {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
-
{Lang::T('Pay With Balance')}
+ {if $router['name'] eq $plan['routers']}
+
+
+
+
+
+
+
+
+ {Lang::T('Type')} |
+ {$plan['type']} |
+
+
+ {Lang::T('Price')} |
+ {Lang::moneyFormat($plan['price'])}
+ {if !empty($plan['price_old'])}
+ {Lang::moneyFormat($plan['price_old'])}
+ {/if}
+ |
+
+
+ {Lang::T('Validity')} |
+ {$plan['validity']} {$plan['validity_unit']} |
+
+
+
+
+
+
+
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
+ $_user['balance']>=$plan['price']}
+
{Lang::T('Buy for friend')}
{/if}
- {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
- $_user['balance']>=$plan['price']}
-
{Lang::T('Buy for friend')}
- {/if}
-
{/if}
{/foreach}
diff --git a/ui/ui/user-ui/selectGateway.tpl b/ui/ui/user-ui/selectGateway.tpl
index 1cf6a490..8c649034 100644
--- a/ui/ui/user-ui/selectGateway.tpl
+++ b/ui/ui/user-ui/selectGateway.tpl
@@ -46,11 +46,12 @@
{$plan['type']}
- {Lang::T('Plan Price')} {if $using eq
- 'zero'}{Lang::moneyFormat(0)}
- {else}
- {Lang::moneyFormat($plan['price'])}
- {/if}
+ {Lang::T('Plan Price')}
+ {if !empty($plan['price_old'])}
+ {Lang::moneyFormat($plan['price_old'])}
+ {/if}
+ {Lang::moneyFormat($plan['price'])}
+
{if $plan['validity']}
@@ -121,4 +122,4 @@
-{include file="user-ui/footer.tpl"}
+{include file="user-ui/footer.tpl"}
\ No newline at end of file
diff --git a/ui/ui/vpn-edit.tpl b/ui/ui/vpn-edit.tpl
index 53428605..1344ac84 100644
--- a/ui/ui/vpn-edit.tpl
+++ b/ui/ui/vpn-edit.tpl
@@ -91,7 +91,7 @@
-