Merge pull request #290 from Focuslinkstech/Development

This commit is contained in:
iBNu Maksum 2024-09-06 17:56:17 +07:00 committed by GitHub
commit f8351e46f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 785 additions and 734 deletions

View File

@ -210,14 +210,15 @@ class User
->select('tbl_user_recharges.id', 'id')
->selects([
'customer_id', 'username', 'plan_id', 'namebp', 'recharged_on', 'recharged_time', 'expiration', 'time',
'status', 'method', 'plan_type', 'name_bw',
'status', 'method', 'plan_type',
['tbl_user_recharges.routers', 'routers'],
['tbl_user_recharges.type', 'type'],
'admin_id', 'prepaid'
])
->left_outer_join('tbl_plans', ['tbl_plans.id', '=', 'tbl_user_recharges.plan_id'])
->left_outer_join('tbl_bandwidth', ['tbl_bandwidth.id', '=', 'tbl_plans.id_bw'])
->select('tbl_bandwidth.*')
->where('customer_id', $id)
->left_outer_join('tbl_plans', array('tbl_plans.id', '=', 'tbl_user_recharges.plan_id'))
->left_outer_join('tbl_bandwidth', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))
->find_many();
return $d;
}

View File

@ -82,6 +82,7 @@
</span>
<div class="box box-primary box-solid">
<div class="table-responsive">&nbsp;&nbsp;
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-condensed">
<thead>
<tr>
@ -126,6 +127,7 @@
</tbody>
</table>
</div>
</div>
<div class="box-footer">
<p class="text-center small text-info">{Lang::T('All Transactions at Date')}:
{Lang::dateAndTimeFormat($sd, $ts)} - {Lang::dateAndTimeFormat($ed, $te)}</p>

View File

@ -8,7 +8,9 @@
<div class="box-header">
<h3 class="box-title">{Lang::T('Unpaid Order')}</h3>
</div>
<table class="table table-condensed table-bordered table-striped table-hover" style="margin-bottom: 0px;">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-condensed table-bordered table-striped table-hover"
style="margin-bottom: 0px;">
<tbody>
<tr>
<td>{Lang::T('expired')}</td>
@ -28,6 +30,7 @@
</tr>
</tbody>
</table>
</div>
<div class="box-footer p-2">
<div class="btn-group btn-group-justified mb15">
<div class="btn-group">
@ -65,6 +68,7 @@
<div class="box-header">
<h3 class="box-title">{Lang::T('Your Account Information')}</h3>
</div>
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped table-bordered table-hover mb-0"
style="margin-bottom: 0px;">
<tr>
@ -97,19 +101,24 @@
{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>
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>
onclick="return confirm('{Lang::T('Enable auto renewal?')}')">{Lang::T('Auto Renewal
Off')}</a>
{/if}
</td>
</tr>
{/if}
</table>
</div>
{if $abills && count($abills)>0}
<div class="box-header">
<h3 class="box-title">{Lang::T('Additional Billing')}</h3>
</div>
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped table-bordered table-hover mb-0"
style="margin-bottom: 0px;">
{assign var="total" value=0}
@ -124,8 +133,8 @@
{else}
{assign var="exp" value=explode(':',$v)}
{Lang::moneyFormat($exp[0])}
<sup
title="{$exp[1]} more times">{if $exp[1]==0}{Lang::T('paid off')}{else}{$exp[1]}x{/if}</sup>
<sup title="{$exp[1]} more times">{if $exp[1]==0}{Lang::T('paid
off')}{else}{$exp[1]}x{/if}</sup>
{if $exp[1]>0}
{assign var="total" value=$exp[0]+$total}
{/if}
@ -144,6 +153,7 @@
</b></td>
</tr>
</table>
</div> &nbsp;&nbsp;
{/if}
</div>
{if $_bills}
@ -165,13 +175,16 @@
<h3 class="box-title">{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</h3>
</div>
{/if}
<table class="table table-bordered table-striped table-bordered table-hover" style="margin-bottom: 0px;">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped table-bordered table-hover"
style="margin-bottom: 0px;">
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Plan Name')}</td>
<td class="small mb15">
{$_bill['namebp']}
{if $_bill['status'] != 'on'}
<a class="label label-danger pull-right" href="{$_url}order/package">{Lang::T('expired')}</a>
<a class="label label-danger pull-right"
href="{$_url}order/package">{Lang::T('expired')}</a>
{/if}
</td>
</tr>
@ -184,13 +197,15 @@
<tr>
<td class="small text-info text-uppercase text-normal">{Lang::T('Created On')}</td>
<td class="small mb15">
{if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['recharged_on'],$_bill['recharged_time'])}
{if $_bill['time'] ne
''}{Lang::dateAndTimeFormat($_bill['recharged_on'],$_bill['recharged_time'])}
{/if}&nbsp;</td>
</tr>
<tr>
<td class="small text-danger text-uppercase text-normal">{Lang::T('Expires On')}</td>
<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;
</td>
</tr>
<tr>
@ -212,7 +227,8 @@
<td class="small mb15">{$nux_mac}</td>
</tr>
{/if}
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius' && $_c['hs_auth_method'] != 'hchap'}
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius' &&
$_c['hs_auth_method'] != 'hchap'}
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Login Status')}</td>
<td class="small mb15" id="login_status_{$_bill['id']}">
@ -225,8 +241,9 @@
<td class="small text-primary text-uppercase text-normal">{Lang::T('Login Status')}</td>
<td class="small mb15">
{if $logged == '1'}
<a href="http://{$hostname}/status"
class="btn btn-success btn-xs btn-block">{Lang::T('You are Online, Check Status')}</a>
<a href="http://{$hostname}/status" class="btn btn-success btn-xs btn-block">{Lang::T('You
are
Online, Check Status')}</a>
{else}
<a href="{$_url}home&mikrotik=login"
onclick="return confirm('{Lang::T('Connect to Internet')}')"
@ -255,11 +272,14 @@
<a class="btn btn-warning text-black pull-right btn-sm"
href="{$_url}home&sync={$_bill['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Sync account if you failed login to internet')}?')"
data-toggle="tooltip" data-placement="top" title="{Lang::T('Sync account if you failed login to internet')}"><span
data-toggle="tooltip" data-placement="top"
title="{Lang::T('Sync account if you failed login to internet')}"><span
class="glyphicon glyphicon-refresh" aria-hidden="true"></span> {Lang::T('Sync')}</a>
</td>
</tr>
</table>
</div>
&nbsp;&nbsp;
{/foreach}
</div>
{/if}
@ -281,7 +301,7 @@
$.ajax({
url: "index.php?_route=autoload_user/isLogin/{$_bill['id']}",
cache: false,
success: function(msg) {
success: function (msg) {
$("#login_status_{$_bill['id']}").html(msg);
}
});
@ -308,14 +328,14 @@
</div>
<div class="form-group col-sm-2" align="center">
<button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send"
onclick="return confirm('{Lang::T("Are You Sure?")}')" value="balance"><i
onclick="return confirm('{Lang::T(" Are You Sure?")}')" value="balance"><i
class="glyphicon glyphicon-send"></i></button>
</div>
</div>
</form>
<script>
function askConfirm() {
if(confirm('{Lang::T('Send your balance?')}')){
if (confirm('{Lang::T('Send your balance ? ')}')) {
setTimeout(() => {
document.getElementById('sendBtn').setAttribute('disabled', '');
}, 1000);
@ -337,7 +357,7 @@
</div>
<div class="form-group col-sm-2" align="center">
<button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send"
onclick="return confirm('{Lang::T("Are You Sure?")}')" value="plan"><i
onclick="return confirm('{Lang::T(" Are You Sure?")}')" value="plan"><i
class="glyphicon glyphicon-send"></i></button>
</div>
</div>
@ -355,9 +375,8 @@
<form method="post" role="form" class="form-horizontal" action="{$_url}voucher/activation-post">
<div class="input-group">
<span class="input-group-btn">
<a class="btn btn-default"
href="{APP_URL}/scan/?back={urlencode($_url)}{urlencode("home&code=")}"><i
class="glyphicon glyphicon-qrcode"></i></a>
<a class="btn btn-default" href="{APP_URL}/scan/?back={urlencode($_url)}{urlencode("
home&code=")}"><i class="glyphicon glyphicon-qrcode"></i></a>
</span>
<input type="text" id="code" name="code" class="form-control"
placeholder="{Lang::T('Enter voucher code here')}" value="{$code}">
@ -386,8 +405,8 @@
</div>
</div>
{if isset($hostname) && $hchap == 'true' && $_c['hs_auth_method'] == 'hchap'}
<script type="text/javascript" src="/ui/ui/scripts/md5.js"></script>
<script type="text/javascript">
<script type="text/javascript" src="/ui/ui/scripts/md5.js"></script>
<script type="text/javascript">
var hostname = "http://{$hostname}/login";
var user = "{$_user['username']}";
var pass = "{$_user['password']}";
@ -396,6 +415,6 @@
var key = hexMD5('{$key1}' + pass + '{$key2}');
var auth = hostname + '?username=' + user + '&dst=' + dst + '&password=' + key;
document.write('<meta http-equiv="refresh" target="_blank" content="' + authdly + '; url=' + auth + '">');
</script>
</script>
{/if}
{include file="user-ui/footer.tpl"}

View File

@ -11,6 +11,7 @@
<div class="box box-solid box-default">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
@ -20,6 +21,7 @@
</tbody>
</table>
</div>
</div>
<div class="box-body">
<a href="{$_url}order/gateway/0/{$plan['id']}"
onclick="return confirm('{Lang::T('Buy Balance')}?')"
@ -33,5 +35,4 @@
{/if}
</div>
</div>
</div>
{include file="user-ui/footer.tpl"}

View File

@ -18,6 +18,7 @@
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
@ -35,6 +36,7 @@
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/radius/{$plan['id']}&stoken={App::getToken()}"
@ -46,7 +48,8 @@
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']}
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
@ -69,6 +72,7 @@
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
@ -86,6 +90,7 @@
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/radius/{$plan['id']}&stoken={App::getToken()}"
@ -97,7 +102,8 @@
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']}
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
@ -108,7 +114,8 @@
{/foreach}
</div>
{/if}
{elseif $_user['service_type'] == 'Others' || $_user['service_type'] == '' && (Lang::arrayCount($radius_pppoe)>0 || Lang::arrayCount($radius_hotspot)>0)}
{elseif $_user['service_type'] == 'Others' || $_user['service_type'] == '' && (Lang::arrayCount($radius_pppoe)>0
|| Lang::arrayCount($radius_hotspot)>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>
@ -120,6 +127,7 @@
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
@ -137,6 +145,7 @@
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/pppoe/{$plan['id']}&stoken={App::getToken()}"
@ -148,7 +157,8 @@
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']}
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/pppoe/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
@ -170,6 +180,7 @@
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
@ -187,6 +198,7 @@
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/hotspot/{$plan['id']}&stoken={App::getToken()}"
@ -198,7 +210,8 @@
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']}
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/hotspot/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
@ -212,7 +225,8 @@
{/if}
{/if}
{foreach $routers as $router}
{if Validator::isRouterHasPlan($plans_hotspot, $router['name']) || Validator::isRouterHasPlan($plans_pppoe, $router['name'])}
{if Validator::isRouterHasPlan($plans_hotspot, $router['name']) || Validator::isRouterHasPlan($plans_pppoe,
$router['name'])}
<div class="box box-solid box-primary bg-gray">
<div class="box-header text-white text-bold">{$router['name']}</div>
{if $router['description'] != ''}
@ -230,6 +244,7 @@
<div class="box box-primary">
<div class="box-header text-center text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
@ -247,6 +262,7 @@
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
@ -258,7 +274,8 @@
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']}
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
@ -279,6 +296,7 @@
<div class="box box- box-primary">
<div class="box-header text-bold text-center">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
@ -296,6 +314,7 @@
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
@ -307,7 +326,8 @@
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']}
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
@ -319,7 +339,9 @@
{/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)}
{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">
@ -329,6 +351,7 @@
<div class="box box-primary">
<div class="box-header text-center text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
@ -346,6 +369,7 @@
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
@ -357,7 +381,8 @@
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']}
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
@ -376,6 +401,7 @@
<div class="box box- box-primary">
<div class="box-header text-bold text-center">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
@ -393,6 +419,7 @@
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
@ -404,7 +431,8 @@
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']}
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>