add new feature "service type" Hotspot PPPoE and Others

ability to display packages according to the user type.
Hotspot users Can now see only hotspot packages
PPPoE users can now see only PPPoE Packages
Others Can see both Hotspot and PPPoE packages
This commit is contained in:
Focuslinkstech 2023-12-14 03:21:55 +01:00
parent 9190660c1c
commit a7a0f84df5
9 changed files with 480 additions and 279 deletions

View File

@ -27,6 +27,7 @@ CREATE TABLE `tbl_customers` (
`phonenumber` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0', `phonenumber` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0',
`email` varchar(128) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1', `email` varchar(128) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1',
`balance` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT 'For Money Deposit', `balance` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT 'For Money Deposit',
`service_type` ENUM('Hotspot','PPPoE','Others') DEFAULT 'Others' COMMENT 'For selecting user type',
`auto_renewal` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Auto renewall using balance', `auto_renewal` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Auto renewall using balance',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_login` datetime DEFAULT NULL `last_login` datetime DEFAULT NULL

View File

@ -28,7 +28,8 @@ switch ($action) {
'username' => '%' . $search . '%', 'username' => '%' . $search . '%',
'fullname' => '%' . $search . '%', 'fullname' => '%' . $search . '%',
'phonenumber' => '%' . $search . '%', 'phonenumber' => '%' . $search . '%',
'email' => '%' . $search . '%' 'email' => '%' . $search . '%',
'service_type' => '%' . $search . '%'
], $search); ], $search);
$d = ORM::for_table('tbl_customers') $d = ORM::for_table('tbl_customers')
->where_raw("(`username` LIKE '%$search%' OR `fullname` LIKE '%$search%' OR `phonenumber` LIKE '%$search%' OR `email` LIKE '%$search%')", [$search, $search, $search, $search]) ->where_raw("(`username` LIKE '%$search%' OR `fullname` LIKE '%$search%' OR `phonenumber` LIKE '%$search%' OR `email` LIKE '%$search%')", [$search, $search, $search, $search])
@ -227,6 +228,7 @@ switch ($action) {
$email = _post('email'); $email = _post('email');
$address = _post('address'); $address = _post('address');
$phonenumber = _post('phonenumber'); $phonenumber = _post('phonenumber');
$service_type = _post('service_type');
run_hook('add_customer'); #HOOK run_hook('add_customer'); #HOOK
$msg = ''; $msg = '';
if (Validator::Length($username, 35, 2) == false) { if (Validator::Length($username, 35, 2) == false) {
@ -253,6 +255,7 @@ switch ($action) {
$d->fullname = $fullname; $d->fullname = $fullname;
$d->address = $address; $d->address = $address;
$d->phonenumber = Lang::phoneFormat($phonenumber); $d->phonenumber = Lang::phoneFormat($phonenumber);
$d->service_type = $service_type;
$d->save(); $d->save();
r2(U . 'customers/list', 's', $_L['account_created_successfully']); r2(U . 'customers/list', 's', $_L['account_created_successfully']);
} else { } else {
@ -268,6 +271,7 @@ switch ($action) {
$email = _post('email'); $email = _post('email');
$address = _post('address'); $address = _post('address');
$phonenumber = Lang::phoneFormat(_post('phonenumber')); $phonenumber = Lang::phoneFormat(_post('phonenumber'));
$service_type = _post('service_type');
run_hook('edit_customer'); #HOOK run_hook('edit_customer'); #HOOK
$msg = ''; $msg = '';
if (Validator::Length($username, 16, 2) == false) { if (Validator::Length($username, 16, 2) == false) {
@ -320,6 +324,7 @@ switch ($action) {
$d->email = $email; $d->email = $email;
$d->address = $address; $d->address = $address;
$d->phonenumber = $phonenumber; $d->phonenumber = $phonenumber;
$d->service_type = $service_type;
$d->save(); $d->save();
if ($userDiff || $pppoeDiff || $passDiff) { if ($userDiff || $pppoeDiff || $passDiff) {
$c = ORM::for_table('tbl_user_recharges')->where('username', ($userDiff) ? $oldusername : $username)->find_one(); $c = ORM::for_table('tbl_user_recharges')->where('username', ($userDiff) ? $oldusername : $username)->find_one();

View File

@ -35,5 +35,8 @@
], ],
"2023.10.24" : [ "2023.10.24" : [
"ALTER TABLE `nas` ADD `routers` VARCHAR(32) NOT NULL DEFAULT '' AFTER `description`;" "ALTER TABLE `nas` ADD `routers` VARCHAR(32) NOT NULL DEFAULT '' AFTER `description`;"
],
"2023.12.15": [
"ALTER TABLE `tbl_customers` ADD `service_type` ENUM('Hotspot','PPPoE','Others') DEFAULT 'Others' COMMENT 'For selecting user type' AFTER `balance`;"
] ]
} }

View File

@ -72,6 +72,16 @@
<textarea name="address" id="address" class="form-control"></textarea> <textarea name="address" id="address" class="form-control"></textarea>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Service Type')}</label>
<div class="col-md-6">
<select class="form-control" id="service_type" name="service_type">
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot'}selected{/if}>Hotspot</option>
<option value="PPPoE" {if $d['service_type'] eq 'PPPoE'}selected{/if}>PPPoE</option>
<option value="Others" {if $d['service_type'] eq 'Others'}selected{/if}>Others</option>
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-lg-offset-2 col-lg-10"> <div class="col-lg-offset-2 col-lg-10">

View File

@ -77,6 +77,16 @@
<textarea name="address" id="address" class="form-control">{$d['address']}</textarea> <textarea name="address" id="address" class="form-control">{$d['address']}</textarea>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Service Type')}</label>
<div class="col-md-6">
<select class="form-control" id="service_type" name="service_type">
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot'}selected{/if}>Hotspot</option>
<option value="PPPoE" {if $d['service_type'] eq 'PPPoE'}selected{/if}>PPPoE</option>
<option value="Others" {if $d['service_type'] eq 'Others'}selected{/if}>Others</option>
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-lg-offset-2 col-lg-10"> <div class="col-lg-offset-2 col-lg-10">

View File

@ -38,6 +38,9 @@
</li> </li>
{/if} {/if}
<li class="list-group-item"> <li class="list-group-item">
<b>{Lang::T('Service Type')}</b> <span class="pull-right">{Lang::T($d['service_type'])}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Balance')}</b> <span class="pull-right">{Lang::moneyFormat($d['balance'])}</span> <b>{Lang::T('Balance')}</b> <span class="pull-right">{Lang::moneyFormat($d['balance'])}</span>
</li> </li>
<li class="list-group-item"> <li class="list-group-item">

View File

@ -33,6 +33,7 @@
<th>{$_L['Phone_Number']}</th> <th>{$_L['Phone_Number']}</th>
<th>{$_L['Email']}</th> <th>{$_L['Email']}</th>
<th>{$_L['Package']}</th> <th>{$_L['Package']}</th>
<th>{Lang::T('Service Type')}</th>
<th>{$_L['Created_On']}</th> <th>{$_L['Created_On']}</th>
<th>{$_L['Manage']}</th> <th>{$_L['Manage']}</th>
</tr> </tr>
@ -48,6 +49,7 @@
<td align="center" api-get-text="{$_url}autoload/customer_is_active/{$ds['id']}"> <td align="center" api-get-text="{$_url}autoload/customer_is_active/{$ds['id']}">
<span class="label label-default">&bull;</span> <span class="label label-default">&bull;</span>
</td> </td>
<td>{$ds['service_type']}</td>
<td>{Lang::dateTimeFormat($ds['created_at'])}</td> <td>{Lang::dateTimeFormat($ds['created_at'])}</td>
<td align="center"> <td align="center">
<a href="{$_url}customers/view/{$ds['id']}" id="{$ds['id']}" style="margin: 0px;" <a href="{$_url}customers/view/{$ds['id']}" id="{$ds['id']}" style="margin: 0px;"

View File

@ -8,7 +8,7 @@
<div class="box-header"> <div class="box-header">
<h3 class="box-title">{Lang::T('Unpaid Order')}</h3> <h3 class="box-title">{Lang::T('Unpaid Order')}</h3>
</div> </div>
<table class="table table-condensed table-bordered table-striped table-hover"> <table class="table table-condensed table-bordered table-striped table-hover" style="margin-bottom: 0px;">
<tbody> <tbody>
<tr> <tr>
<td>{Lang::T('expired')}</td> <td>{Lang::T('expired')}</td>
@ -62,7 +62,8 @@
<div class="box-header"> <div class="box-header">
<h3 class="box-title">{$_L['Account_Information']}</h3> <h3 class="box-title">{$_L['Account_Information']}</h3>
</div> </div>
<table class="table table-bordered table-striped table-bordered table-hover"> <table class="table table-bordered table-striped table-bordered table-hover mb-0"
style="margin-bottom: 0px;">
<tr> <tr>
<td class="small text-success text-uppercase text-normal">{$_L['Username']}</td> <td class="small text-success text-uppercase text-normal">{$_L['Username']}</td>
<td class="small mb15">{$_user['username']}</td> <td class="small mb15">{$_user['username']}</td>
@ -73,6 +74,11 @@
style="width:100%; border: 0px;" onmouseleave="this.type = 'password'" style="width:100%; border: 0px;" onmouseleave="this.type = 'password'"
onmouseenter="this.type = 'text'" onclick="this.select()"></td> onmouseenter="this.type = 'text'" onclick="this.select()"></td>
</tr> </tr>
<tr>
<td class="small text-success text-uppercase text-normal">{Lang::T('Service Type')}</td>
<td class="small mb15">{$_user['service_type']}</td>
</tr>
{if $_c['enable_balance'] == 'yes'} {if $_c['enable_balance'] == 'yes'}
<tr> <tr>
<td class="small text-warning text-uppercase text-normal">{Lang::T('Balance')}</td> <td class="small text-warning text-uppercase text-normal">{Lang::T('Balance')}</td>
@ -88,19 +94,25 @@
</td> </td>
</tr> </tr>
{/if} {/if}
{if $_bill} </table>
{if $_bills}
{foreach $_bills as $_bill}
{if $_bill['routers'] != 'radius'} {if $_bill['routers'] != 'radius'}
<tr> <div class="box-header">
<td class="small text-primary text-uppercase text-normal">{strtoupper(Lang::T('Location'))}</td> <h3 class="box-title">{$_bill['routers']}</h3>
<td class="small mb15">{$_bill['routers']}</td> </div>
</tr> {else}
<div class="box-header">
<h3 class="box-title">{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</h3>
</div>
{/if} {/if}
<table class="table table-bordered table-striped table-bordered table-hover" style="margin-bottom: 0px;">
<tr> <tr>
<td class="small text-primary text-uppercase text-normal">{$_L['Plan_Name']}</td> <td class="small text-primary text-uppercase text-normal">{$_L['Plan_Name']}</td>
<td class="small mb15"> <td class="small mb15">
{$_bill['namebp']} {$_bill['namebp']}
{if $_bill['status'] == 'on'} {if $_bill['status'] == 'on'}
<a class="label label-danger pull-right" href="{$_url}home&deactivate=1" <a class="label label-danger pull-right" href="{$_url}home&deactivate={$_bill['id']}"
onclick="return confirm('{Lang::T('Deactivate')}?')">{Lang::T('Deactivate')}</a> onclick="return confirm('{Lang::T('Deactivate')}?')">{Lang::T('Deactivate')}</a>
{else} {else}
<a class="label label-warning pull-right" href="{$_url}order/package">{Lang::T('expired')}</a> <a class="label label-warning pull-right" href="{$_url}order/package">{Lang::T('expired')}</a>
@ -117,7 +129,7 @@
<td class="small text-danger text-uppercase text-normal">{$_L['Expires_On']}</td> <td class="small text-danger text-uppercase text-normal">{$_L['Expires_On']}</td>
<td class="small mb15 text-danger"> <td class="small mb15 text-danger">
{if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['expiration'],$_bill['time'])}{/if}&nbsp; {if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['expiration'],$_bill['time'])}{/if}&nbsp;
<a class="label label-primary pull-right" href="{$_url}home&recharge=1" <a class="label label-primary pull-right" href="{$_url}home&recharge={$_bill['id']}"
onclick="return confirm('{Lang::T('Recharge')}?')">{Lang::T('Recharge')}</a> onclick="return confirm('{Lang::T('Recharge')}?')">{Lang::T('Recharge')}</a>
</td> </td>
</tr> </tr>
@ -136,13 +148,15 @@
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius'} {if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius'}
<tr> <tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Login Status')}</td> <td class="small text-primary text-uppercase text-normal">{Lang::T('Login Status')}</td>
<td class="small mb15" id="login_status"> <td class="small mb15" id="login_status_{$_bill['id']}">
<img src="ui/ui/images/loading.gif"> <img src="ui/ui/images/loading.gif">
</td> </td>
</tr> </tr>
{/if} {/if}
{/if}
</table> </table>
{/foreach}
{/if}
</div>
{if $_c['disable_voucher'] == 'yes'} {if $_c['disable_voucher'] == 'yes'}
<div class="box-footer"> <div class="box-footer">
{if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' } {if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' }
@ -153,20 +167,23 @@
{/if} {/if}
</div> </div>
{/if} {/if}
</div> {if $_bills}
{foreach $_bills as $_bill}
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on'} {if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on'}
<script> <script>
setTimeout(() => { setTimeout(() => {
$.ajax({ $.ajax({
url: "index.php?_route=autoload_user/isLogin", url: "index.php?_route=autoload_user/isLogin/{$_bill['id']}",
cache: false, cache: false,
success: function(msg) { success: function(msg) {
$("#login_status").html(msg); $("#login_status_{$_bill['id']}").html(msg);
} }
}); });
}, 2000); }, 2000);
</script> </script>
{/if} {/if}
{/foreach}
{/if}
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes'} {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes'}
<div class="box box-primary box-solid mb30"> <div class="box box-primary box-solid mb30">
<div class="box-header"> <div class="box-header">

View File

@ -6,6 +6,52 @@
<div class="box-header">{Lang::T('Order Internet Package')}</div> <div class="box-header">{Lang::T('Order Internet Package')}</div>
</div> </div>
{if $_c['radius_enable']} {if $_c['radius_enable']}
{if $_user['service_type'] == 'PPPoE'}
{if Lang::arrayCount($radius_pppoe)>0}
<ol class="breadcrumb">
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
<li>{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</li>
</ol>
<div class="row">
{foreach $radius_pppoe as $plan}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/buy/radius/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')" class="btn btn-sm btn-block btn-warning text-black">Buy</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/radius/{$plan['id']}" onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')" class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/radius/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this for friend account?')}')" class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/foreach}
</div>
{/if}
{elseif $_user['service_type'] == 'Hotspot'}
{if Lang::arrayCount($radius_hotspot)>0} {if Lang::arrayCount($radius_hotspot)>0}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li> <li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
@ -36,19 +82,13 @@
</div> </div>
<div class="box-body"> <div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="..."> <div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/buy/radius/{$plan['id']}" <a href="{$_url}order/buy/radius/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')" class="btn btn-sm btn-block btn-warning text-black">Buy</a>
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">Buy</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/radius/{$plan['id']}" <a href="{$_url}order/pay/radius/{$plan['id']}" onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')" class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if} {/if}
</div> </div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']} {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/radius/{$plan['id']}" <a href="{$_url}order/send/radius/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this for friend account?')}')" class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if} {/if}
</div> </div>
</div> </div>
@ -56,15 +96,16 @@
{/foreach} {/foreach}
</div> </div>
{/if} {/if}
{if Lang::arrayCount($radius_pppoe)>0} {elseif $_user['service_type'] == 'Others' || $_user['service_type'] == '' && (Lang::arrayCount($radius_pppoe)>0 || Lang::arrayCount($radius_hotspot)>0)}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li> <li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
<li>{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</li> <li>{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</li>
</ol> </ol>
<div class="row"> <div class="row">
{if Lang::arrayCount($radius_pppoe)>0}
{foreach $radius_pppoe as $plan} {foreach $radius_pppoe as $plan}
<div class="col col-md-4"> <div class="col col-md-4">
<div class="box box- box-primary"> <div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div> <div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">
@ -86,24 +127,62 @@
</div> </div>
<div class="box-body"> <div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="..."> <div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/buy/radius/{$plan['id']}" <a href="{$_url}order/buy/pppoe/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this? your active package will be overwritten')}')" class="btn btn-sm btn-block btn-warning text-black">Buy</a>
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">Buy</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/radius/{$plan['id']}" <a href="{$_url}order/pay/pppoe/{$plan['id']}" onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwritten')}')" class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if} {/if}
</div> </div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']} {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/radius/{$plan['id']}" <a href="{$_url}order/send/pppoe/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this for friend account?')}')" class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if} {/if}
</div> </div>
</div> </div>
</div> </div>
{/foreach} {/foreach}
{/if}
{if Lang::arrayCount($radius_hotspot)>0}
<ol class="breadcrumb">
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
<li>{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}</li>
</ol>
{foreach $radius_hotspot as $plan}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/buy/hotspot/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this? your active package will be overwritten')}')" class="btn btn-sm btn-block btn-warning text-black">Buy</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/hotspot/{$plan['id']}" onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwritten')}')" class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/hotspot/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this for friend account?')}')" class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/foreach}
{/if}
</div> </div>
{/if} {/if}
{/if} {/if}
@ -116,7 +195,7 @@
{$router['description']} {$router['description']}
</div> </div>
{/if} {/if}
{if Validator::countRouterPlan($plans_hotspot, $router['name'])>0} {if $_user['service_type'] == 'Hotspot' && Validator::countRouterPlan($plans_hotspot, $router['name'])>0}
<div class="box-header text-white">{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}</div> <div class="box-header text-white">{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}</div>
<div class="box-body row"> <div class="box-body row">
{foreach $plans_hotspot as $plan} {foreach $plans_hotspot as $plan}
@ -144,19 +223,13 @@
</div> </div>
<div class="box-body"> <div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="..."> <div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/buy/{$router['id']}/{$plan['id']}" <a href="{$_url}order/buy/{$router['id']}/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')" class="btn btn-sm btn-block btn-warning text-black">Buy</a>
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">Buy</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}" <a href="{$_url}order/pay/{$router['id']}/{$plan['id']}" onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')" class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if} {/if}
</div> </div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']} {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}" <a href="{$_url}order/send/{$router['id']}/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this for friend account?')}')" class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if} {/if}
</div> </div>
</div> </div>
@ -165,7 +238,7 @@
{/foreach} {/foreach}
</div> </div>
{/if} {/if}
{if Validator::countRouterPlan($plans_pppoe,$router['name'])>0} {if $_user['service_type'] == 'PPPoE' && Validator::countRouterPlan($plans_pppoe,$router['name'])>0}
<div class="box-header text-white">{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</div> <div class="box-header text-white">{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</div>
<div class="box-body row"> <div class="box-body row">
{foreach $plans_pppoe as $plan} {foreach $plans_pppoe as $plan}
@ -193,19 +266,97 @@
</div> </div>
<div class="box-body"> <div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="..."> <div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/buy/{$router['id']}/{$plan['id']}" <a href="{$_url}order/buy/{$router['id']}/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')" class="btn btn-sm btn-block btn-warning text-black">Buy</a>
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">Buy</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}" <a href="{$_url}order/pay/{$router['id']}/{$plan['id']}" onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')" class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if} {/if}
</div> </div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']} {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}" <a href="{$_url}order/send/{$router['id']}/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this for friend account?')}')" class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
onclick="return confirm('{Lang::T('Buy this for friend account?')}')" {/if}
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a> </div>
</div>
</div>
{/if}
{/foreach}
</div>
{/if}
{if $_user['service_type'] == 'Others' || $_user['service_type'] == '' && (Validator::countRouterPlan($plans_hotspot, $router['name'])>0 || Validator::countRouterPlan($plans_pppoe, $router['name'])>0)}
<div class="box-header text-white">{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}</div>
<div class="box-body row">
{foreach $plans_hotspot as $plan}
{if $router['name'] eq $plan['routers']}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-center text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/buy/{$router['id']}/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')" class="btn btn-sm btn-block btn-warning text-black">Buy</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}" onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')" class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this for friend account?')}')" class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/if}
{/foreach}
</div>
<div class="box-header text-white">{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</div>
<div class="box-body row">
{foreach $plans_pppoe as $plan}
{if $router['name'] eq $plan['routers']}
<div class="col col-md-4">
<div class="box box- box-primary">
<div class="box-header text-bold text-center">{$plan['name_plan']}</div>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/buy/{$router['id']}/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')" class="btn btn-sm btn-block btn-warning text-black">Buy</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}" onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')" class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}" onclick="return confirm('{Lang::T('Buy this for friend account?')}')" class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if} {/if}
</div> </div>
</div> </div>
@ -219,5 +370,4 @@
{/foreach} {/foreach}
</div> </div>
</div> </div>
</div>
{include file="sections/user-footer.tpl"} {include file="sections/user-footer.tpl"}