diff --git a/system/autoload/Paginator.php b/system/autoload/Paginator.php index 28372fd3..f6fdf9c6 100644 --- a/system/autoload/Paginator.php +++ b/system/autoload/Paginator.php @@ -8,6 +8,88 @@ class Paginator { + public static function build($table, $colVal = [], $query='', $per_page = '10') + { + global $routes; + global $_L; + $url = U . implode('/', $routes); + $query = urlencode($query); + $adjacents = "2"; + $page = (int)(empty(_get('p')) ? 1 : _get('p')); + $pagination = ""; + foreach($colVal as $k=>$v) { + if(!empty($query)){ + $table = $table->where_like($k, $v); + }else{ + $table = $table->where($k, $v); + } + } + $totalReq = $table->count(); + $page = ($page == 0 ? 1 : $page); + $next = $page + 1; + $lastpage = ceil($totalReq / $per_page); + $lpm1 = $lastpage - 1; + $limit = $per_page; + $startpoint = ($page * $limit) - $limit; + if ($lastpage >= 1) { + $pagination .= '"; + + return array("startpoint" => $startpoint, "limit" => $limit, "found" => $totalReq, "page" => $page, "lastpage" => $lastpage, "contents" => $pagination); + } + } + public static function bootstrap($table, $w1 = '', $c1 = '', $w2 = '', $c2 = '', $w3 = '', $c3 = '', $w4 = '', $c4 = '', $per_page = '10') { global $routes; @@ -17,16 +99,30 @@ class Paginator $page = (int)(!isset($routes['2']) ? 1 : $routes['2']); $pagination = ""; - if ($w1 != '') { - $totalReq = ORM::for_table($table)->where($w1, $c1)->count(); - } elseif ($w2 != '') { - $totalReq = ORM::for_table($table)->where($w1, $c1)->where($w2, $c2)->count(); - } elseif ($w3 != '') { - $totalReq = ORM::for_table($table)->where($w1, $c1)->where($w2, $c2)->where($w3, $c3)->count(); - } elseif ($w4 != '') { - $totalReq = ORM::for_table($table)->where($w1, $c1)->where($w2, $c2)->where($w3, $c3)->where($w4, $c4)->count(); - } else { - $totalReq = ORM::for_table($table)->count(); + if(is_object($table)){ + if ($w1 != '') { + $totalReq = $table->where($w1, $c1)->count(); + } elseif ($w2 != '') { + $totalReq = $table->where($w1, $c1)->where($w2, $c2)->count(); + } elseif ($w3 != '') { + $totalReq = $table->where($w1, $c1)->where($w2, $c2)->where($w3, $c3)->count(); + } elseif ($w4 != '') { + $totalReq = $table->where($w1, $c1)->where($w2, $c2)->where($w3, $c3)->where($w4, $c4)->count(); + } else { + $totalReq = $table->count(); + } + }else{ + if ($w1 != '') { + $totalReq = ORM::for_table($table)->where($w1, $c1)->count(); + } elseif ($w2 != '') { + $totalReq = ORM::for_table($table)->where($w1, $c1)->where($w2, $c2)->count(); + } elseif ($w3 != '') { + $totalReq = ORM::for_table($table)->where($w1, $c1)->where($w2, $c2)->where($w3, $c3)->count(); + } elseif ($w4 != '') { + $totalReq = ORM::for_table($table)->where($w1, $c1)->where($w2, $c2)->where($w3, $c3)->where($w4, $c4)->count(); + } else { + $totalReq = ORM::for_table($table)->count(); + } } $i = 0; @@ -109,11 +205,18 @@ class Paginator $adjacents = "2"; $page = (int)(!isset($routes['2']) ? 1 : $routes['2']); $pagination = ""; - - if ($w1 != '') { - $totalReq = ORM::for_table($table)->where_raw($w1, $c1)->count(); - } else { - $totalReq = ORM::for_table($table)->count(); + if(is_object($table)){ + if ($w1 != '') { + $totalReq = $table->where_raw($w1, $c1)->count(); + } else { + $totalReq = $table->count(); + } + }else{ + if ($w1 != '') { + $totalReq = ORM::for_table($table)->where_raw($w1, $c1)->count(); + } else { + $totalReq = ORM::for_table($table)->count(); + } } $i = 0; diff --git a/system/controllers/logs.php b/system/controllers/logs.php index 4a04d3a3..51936bad 100644 --- a/system/controllers/logs.php +++ b/system/controllers/logs.php @@ -20,43 +20,42 @@ if ($admin['user_type'] != 'Admin') { switch ($action) { case 'list': - $name = _post('name'); + $q = (_post('q') ? _post('q') : _get('q')); $keep = _post('keep'); if (!empty($keep)) { ORM::raw_execute("DELETE FROM tbl_logs WHERE date < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL $keep DAY))"); r2(U . "logs/list/", 's', "Delete logs older than $keep days"); } - if ($name != '') { - $paginator = Paginator::bootstrap('tbl_logs', 'description', '%' . $name . '%'); - $d = ORM::for_table('tbl_logs')->where_like('description', '%' . $name . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); + if ($q != '') { + $paginator = Paginator::build(ORM::for_table('tbl_logs'), ['description' => '%' . $q . '%'], $q); + $d = ORM::for_table('tbl_logs')->where_like('description', '%' . $q . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); } else { - $paginator = Paginator::bootstrap('tbl_logs'); + $paginator = Paginator::build(ORM::for_table('tbl_logs')); $d = ORM::for_table('tbl_logs')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); } - $ui->assign('name', $name); $ui->assign('d', $d); + $ui->assign('q', $q); $ui->assign('paginator', $paginator); $ui->display('logs.tpl'); break; case 'radius': - $name = _post('name'); + $q = (_post('q') ? _post('q') : _get('q')); $keep = _post('keep'); - $page = (isset($routes['2']) ? intval($routes['2']) : 0); - $pageNow = $page * 20; if (!empty($keep)) { ORM::raw_execute("DELETE FROM radpostauth WHERE UNIX_TIMESTAMP(authdate) < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL $keep DAY))", [], 'radius'); r2(U . "logs/radius/", 's', "Delete logs older than $keep days"); } - if ($name != '') { - $d = ORM::for_table('radpostauth', 'radius')->where_like('username', '%' . $name . '%')->offset($pageNow)->limit(10)->order_by_desc('id')->find_many(); + if ($q != '') { + $paginator = Paginator::build(ORM::for_table('radpostauth', 'radius'), ['username' => '%' . $q . '%'], $q); + $d = ORM::for_table('radpostauth', 'radius')->where_like('username', '%' . $q . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); } else { - $d = ORM::for_table('radpostauth', 'radius')->offset($pageNow)->limit(10)->order_by_desc('id')->find_many(); + $paginator = Paginator::build(ORM::for_table('radpostauth', 'radius')); + $d = ORM::for_table('radpostauth', 'radius')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); } - $ui->assign('page', $page); - $ui->assign('name', $name); $ui->assign('d', $d); + $ui->assign('q', $q); $ui->assign('paginator', $paginator); $ui->display('logs-radius.tpl'); break; diff --git a/system/controllers/order.php b/system/controllers/order.php index 741ec14e..5c47d0b2 100644 --- a/system/controllers/order.php +++ b/system/controllers/order.php @@ -31,43 +31,51 @@ switch ($action) { run_hook('customer_view_order_history'); #HOOK $ui->display('user-orderHistory.tpl'); break; - case 'package': - if (strpos($user['email'], '@') === false) { - r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address")); - } - $ui->assign('_title', 'Order Plan'); - $ui->assign('_system_menu', 'package'); - if (!empty($_SESSION['nux-router'])) { - if ($_SESSION['nux-router'] == 'radius') { + case 'balance': + if (strpos($user['email'], '@') === false) { + r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address")); + } + $ui->assign('_title', 'Top Up'); + $ui->assign('_system_menu', 'balance'); + $plans_balance = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->find_many(); + $ui->assign('plans_balance', $plans_balance); + $ui->display('user-orderBalance.tpl'); + break; + case 'package': + if (strpos($user['email'], '@') === false) { + r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address")); + } + $ui->assign('_title', 'Order Plan'); + $ui->assign('_system_menu', 'package'); + if (!empty($_SESSION['nux-router'])) { + if ($_SESSION['nux-router'] == 'radius') { + $radius_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'PPPOE')->find_many(); + $radius_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'Hotspot')->find_many(); + } else { + $routers = ORM::for_table('tbl_routers')->where('id', $_SESSION['nux-router'])->find_many(); + $rs = []; + foreach ($routers as $r) { + $rs[] = $r['name']; + } + $plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'PPPOE')->find_many(); + $plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'Hotspot')->find_many(); + } + } else { $radius_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'PPPOE')->find_many(); $radius_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'Hotspot')->find_many(); - } else { - $routers = ORM::for_table('tbl_routers')->where('id', $_SESSION['nux-router'])->find_many(); - $rs = []; - foreach ($routers as $r) { - $rs[] = $r['name']; - } - $plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'PPPOE')->find_many(); - $plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'Hotspot')->find_many(); - } - } else { - $radius_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'PPPOE')->find_many(); - $radius_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'Hotspot')->find_many(); - $routers = ORM::for_table('tbl_routers')->find_many(); - $plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 0)->where('type', 'PPPOE')->find_many(); - $plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 0)->where('type', 'Hotspot')->find_many(); - } - $plans_balance = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->find_many(); - $ui->assign('routers', $routers); - $ui->assign('radius_pppoe', $radius_pppoe); - $ui->assign('radius_hotspot', $radius_hotspot); - $ui->assign('plans_pppoe', $plans_pppoe); - $ui->assign('plans_hotspot', $plans_hotspot); - $ui->assign('plans_balance', $plans_balance); - run_hook('customer_view_order_plan'); #HOOK - $ui->display('user-orderPlan.tpl'); - break; + $routers = ORM::for_table('tbl_routers')->find_many(); + $plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 0)->where('type', 'PPPOE')->find_many(); + $plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 0)->where('type', 'Hotspot')->find_many(); + } + $ui->assign('routers', $routers); + $ui->assign('radius_pppoe', $radius_pppoe); + $ui->assign('radius_hotspot', $radius_hotspot); + $ui->assign('plans_pppoe', $plans_pppoe); + $ui->assign('plans_hotspot', $plans_hotspot); + run_hook('customer_view_order_plan'); #HOOK + $ui->display('user-orderPlan.tpl'); + break; case 'unpaid': $d = ORM::for_table('tbl_payment_gateway') ->where('username', $user['username']) diff --git a/system/controllers/pages.php b/system/controllers/pages.php index ce43e33e..d77f8edb 100644 --- a/system/controllers/pages.php +++ b/system/controllers/pages.php @@ -12,7 +12,19 @@ $action = $routes['1']; $admin = Admin::_info(); $ui->assign('_admin', $admin); -if(strpos($action,"-post")===false){ +if(strpos($action,"-reset")!==false){ + $action = str_replace("-reset","",$action); + $path = "pages/".str_replace(".","",$action).".html"; + $temp = "pages_template/".str_replace(".","",$action).".html"; + if(file_exists($temp)){ + if(!copy($temp, $path)){ + file_put_contents($path, Http::getData('https://raw.githubusercontent.com/hotspotbilling/phpnuxbill/master/pages_template/'.$action.'.html')); + } + }else{ + file_put_contents($path, Http::getData('https://raw.githubusercontent.com/hotspotbilling/phpnuxbill/master/pages_template/'.$action.'.html')); + } + r2(U . 'pages/'.$action); +}else if(strpos($action,"-post")===false){ $path = "pages/".str_replace(".","",$action).".html"; //echo $path; run_hook('view_edit_pages'); #HOOK diff --git a/system/lan/english/common.lan.php b/system/lan/english/common.lan.php index e5670719..8a4fae6f 100644 --- a/system/lan/english/common.lan.php +++ b/system/lan/english/common.lan.php @@ -355,7 +355,7 @@ $_L['Invoice_Balance_Message'] = 'Invoice Balance Message'; $_L['Invoice_Notification_Payment'] = 'Invoice Notification Payment'; $_L['Balance_Notification_Payment'] = 'Balance Notification Payment'; $_L['Balance_Plans'] = 'Balance Plans'; -$_L['Buy_Balance'] = 'Buy Balance?'; +$_L['Buy_Balance'] = 'Buy Balance'; $_L['Price'] = 'Price'; $_L['Validity'] = 'Validity'; $_L['Disable_auto_renewal'] = 'Disable auto renewal?'; @@ -403,8 +403,8 @@ $_L['Deactivate'] = 'Deactivate'; $_L['Sync'] = 'Sync'; $_L['Failed_to_create_PaymeTrust_transaction'] = 'Failed to create PaymeTrust transaction.'; $_L['Location'] = 'Location'; -$_L['Radius_Plans'] = 'Radius Plans'; -$_L['Change_title_in_user_Plan_order'] = 'Change title in user Plan order'; -$_L['Logs'] = 'Logs'; -$_L['Voucher_Format'] = 'Voucher Format'; -$_L['Resend_To_Customer'] = 'Resend To Customer'; +$_L['Radius_Plans'] = 'Radius Plans'; +$_L['Change_title_in_user_Plan_order'] = 'Change title in user Plan order'; +$_L['Logs'] = 'Logs'; +$_L['Voucher_Format'] = 'Voucher Format'; +$_L['Resend_To_Customer'] = 'Resend To Customer'; diff --git a/system/lan/indonesia/common.lan.php b/system/lan/indonesia/common.lan.php index 32db9bad..2f70f35f 100644 --- a/system/lan/indonesia/common.lan.php +++ b/system/lan/indonesia/common.lan.php @@ -355,7 +355,7 @@ $_L['User_Cannot_change_this_only_admin_if_it_Empty_it_will_use_user_password'] $_L['Invoice_Balance_Message'] = 'Invoice Balance Message'; $_L['Invoice_Notification_Payment'] = 'Invoice Notification Payment'; $_L['Balance_Notification_Payment'] = 'Balance Notification Payment'; -$_L['Buy_Balance'] = 'Buy Balance?'; +$_L['Buy_Balance'] = 'Buy Balance'; $_L['Price'] = 'Price'; $_L['Validity'] = 'Validity'; $_L['Disable_auto_renewal'] = 'Disable auto renewal?'; diff --git a/system/lan/spanish/common.lan.php b/system/lan/spanish/common.lan.php index 52b1a2e1..2c13913a 100644 --- a/system/lan/spanish/common.lan.php +++ b/system/lan/spanish/common.lan.php @@ -354,7 +354,7 @@ $_L['User_Cannot_change_this_only_admin_if_it_Empty_it_will_use_user_password'] $_L['Invoice_Balance_Message'] = 'Invoice Balance Message'; $_L['Invoice_Notification_Payment'] = 'Invoice Notification Payment'; $_L['Balance_Notification_Payment'] = 'Balance Notification Payment'; -$_L['Buy_Balance'] = 'Buy Balance?'; +$_L['Buy_Balance'] = 'Buy Balance'; $_L['Price'] = 'Price'; $_L['Validity'] = 'Validity'; $_L['Disable_auto_renewal'] = 'Disable auto renewal?'; diff --git a/system/lan/turkish/common.lan.php b/system/lan/turkish/common.lan.php index dc873e93..d7d5dd59 100755 --- a/system/lan/turkish/common.lan.php +++ b/system/lan/turkish/common.lan.php @@ -330,7 +330,7 @@ $_L['Invoice_Balance_Message'] = 'Invoice Balance Message'; $_L['Invoice_Notification_Payment'] = 'Invoice Notification Payment'; $_L['Balance_Notification_Payment'] = 'Balance Notification Payment'; $_L['Balance_Plans'] = 'Balance Plans'; -$_L['Buy_Balance'] = 'Buy Balance?'; +$_L['Buy_Balance'] = 'Buy Balance'; $_L['Price'] = 'Price'; $_L['Validity'] = 'Validity'; $_L['Disable_auto_renewal'] = 'Disable auto renewal?'; diff --git a/ui/ui/logs-radius.tpl b/ui/ui/logs-radius.tpl index 580c35ef..0cf672d5 100644 --- a/ui/ui/logs-radius.tpl +++ b/ui/ui/logs-radius.tpl @@ -14,7 +14,7 @@
-
@@ -53,16 +53,7 @@
- + {$paginator['contents']} diff --git a/ui/ui/logs.tpl b/ui/ui/logs.tpl index 0cbcd8ad..1745db02 100644 --- a/ui/ui/logs.tpl +++ b/ui/ui/logs.tpl @@ -14,7 +14,7 @@
-
diff --git a/ui/ui/page-edit.tpl b/ui/ui/page-edit.tpl index 8816cc46..7360a4ed 100644 --- a/ui/ui/page-edit.tpl +++ b/ui/ui/page-edit.tpl @@ -2,7 +2,13 @@
-
{$pageHeader}
+
+
+ +
+ {$pageHeader} +
{$htmls}
{if $writeable} @@ -36,20 +42,20 @@ {literal} - + function saveIt() { + //alert(document.getElementById('panel-edit').innerHTML); + document.getElementById('html').value = nicEditors.findEditor('panel-edit').getContent() + document.getElementById('formpages').submit(); + } + {/literal} {include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/sections/user-header.tpl b/ui/ui/sections/user-header.tpl index bdf8b379..1ad17207 100644 --- a/ui/ui/sections/user-header.tpl +++ b/ui/ui/sections/user-header.tpl @@ -125,6 +125,14 @@ {/if} {if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' } + {if $_c['enable_balance'] == 'yes'} +
  • + + + {Lang::T('Buy Balance')} + +
  • + {/if}
  • diff --git a/ui/ui/user-orderBalance.tpl b/ui/ui/user-orderBalance.tpl new file mode 100644 index 00000000..a7aa4aa8 --- /dev/null +++ b/ui/ui/user-orderBalance.tpl @@ -0,0 +1,37 @@ +{include file="sections/user-header.tpl"} + + +
  • +{include file="sections/user-footer.tpl"} \ No newline at end of file diff --git a/ui/ui/user-orderPlan.tpl b/ui/ui/user-orderPlan.tpl index ef9e7a87..56893749 100644 --- a/ui/ui/user-orderPlan.tpl +++ b/ui/ui/user-orderPlan.tpl @@ -5,153 +5,125 @@
    {Lang::T('Order Internet Package')}
    - {if $_c['enable_balance'] == 'yes'} -
    -
    {Lang::T('Balance Plans')}
    -
    - {foreach $plans_balance as $plan} + {if $_c['radius_enable']} + {if Lang::arrayCount($radius_hotspot)>0} + +
    + {foreach $radius_hotspot as $plan} +
    +
    +
    {$plan['name_plan']}
    +
    + + + + + + + + + + + + + + + +
    {Lang::T('Type')}{$plan['type']}
    {Lang::T('Price')}{Lang::moneyFormat($plan['price'])}
    {Lang::T('Validity')}{$plan['validity']} {$plan['validity_unit']}
    +
    +
    +
    + Buy + {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Pay With Balance')} + {/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_pppoe)>0} + +
    + {foreach $radius_pppoe as $plan}
    -
    +
    {$plan['name_plan']}
    + + + + + + + +
    {Lang::T('Type')}{$plan['type']}
    {Lang::T('Price')} {Lang::moneyFormat($plan['price'])}
    {Lang::T('Validity')}{$plan['validity']} {$plan['validity_unit']}
    - Buy +
    + Buy + {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Pay With Balance')} + {/if} +
    + {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Buy for friend')} + {/if}
    {/foreach}
    -
    - {/if} - {if $_c['radius_enable']} -
    -
    {if $_c['radius_plan']==''}Radius - Plan{else}{$_c['radius_plan']} - {/if}
    - {if Lang::arrayCount($radius_hotspot)>0} -
    {if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
    -
    - {foreach $radius_hotspot as $plan} -
    -
    -
    {$plan['name_plan']}
    -
    - - - - - - - - - - - - - - - -
    {Lang::T('Type')}{$plan['type']}
    {Lang::T('Price')}{Lang::moneyFormat($plan['price'])}
    {Lang::T('Validity')}{$plan['validity']} {$plan['validity_unit']}
    -
    -
    -
    - Buy - {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} - {Lang::T('Pay With Balance')} - {/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_pppoe)>0} -
    {if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}
    -
    - {foreach $radius_pppoe as $plan} -
    -
    -
    {$plan['name_plan']}
    -
    - - - - - - - - - - - - - - - -
    {Lang::T('Type')}{$plan['type']}
    {Lang::T('Price')}{Lang::moneyFormat($plan['price'])}
    {Lang::T('Validity')}{$plan['validity']} {$plan['validity_unit']}
    -
    -
    -
    - Buy - {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} - {Lang::T('Pay With Balance')} - {/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'])} -
    -
    {$router['name']}
    +
    +
    {$router['name']}
    {if $router['description'] != ''}
    {$router['description']}
    {/if} {if Validator::countRouterPlan($plans_hotspot, $router['name'])>0} -
    {if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
    +
    {if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
    {foreach $plans_hotspot as $plan} {if $router['name'] eq $plan['routers']}
    -
    {$plan['name_plan']}
    +
    {$plan['name_plan']}
    @@ -194,13 +166,13 @@ {/if} {if Validator::countRouterPlan($plans_pppoe,$router['name'])>0} -
    {if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}
    +
    {if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}
    {foreach $plans_pppoe as $plan} {if $router['name'] eq $plan['routers']}
    -
    {$plan['name_plan']}
    +
    {$plan['name_plan']}