show Additional Billing in the customer
This commit is contained in:
parent
694428f804
commit
c32e921cab
@ -56,6 +56,22 @@ class User
|
|||||||
return [$bills, $addcost];
|
return [$bills, $addcost];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getBillNames($id = 0)
|
||||||
|
{
|
||||||
|
if (!$id) {
|
||||||
|
$id = User::getID();
|
||||||
|
if (!$id) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$bills = [];
|
||||||
|
$attrs = User::getAttributes('Bill', $id);
|
||||||
|
foreach ($attrs as $k => $v) {
|
||||||
|
$bills[] = str_replace(' Bill', '', $k);
|
||||||
|
}
|
||||||
|
return $bills;
|
||||||
|
}
|
||||||
|
|
||||||
public static function billsPaid($bills, $id = 0)
|
public static function billsPaid($bills, $id = 0)
|
||||||
{
|
{
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
|
@ -29,7 +29,7 @@ switch ($action) {
|
|||||||
if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) {
|
if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) {
|
||||||
die('<a href="' . U . 'home&mikrotik=login&id=' . $bill['id'] . '" onclick="return confirm(\'' . Lang::T('Connect to Internet?') . '\')" class="btn btn-danger btn-xs btn-block">' . Lang::T('Not Online, Login now?') . '</a>');
|
die('<a href="' . U . 'home&mikrotik=login&id=' . $bill['id'] . '" onclick="return confirm(\'' . Lang::T('Connect to Internet?') . '\')" class="btn btn-danger btn-xs btn-block">' . Lang::T('Not Online, Login now?') . '</a>');
|
||||||
} else {
|
} else {
|
||||||
die(Lang::T('Your account not connected to internet'));
|
die(Lang::T('-'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -291,5 +291,9 @@ $ui->assign('unpaid', ORM::for_table('tbl_payment_gateway')
|
|||||||
->where('status', 1)
|
->where('status', 1)
|
||||||
->find_one());
|
->find_one());
|
||||||
$ui->assign('code', alphanumeric(_get('code'), "-"));
|
$ui->assign('code', alphanumeric(_get('code'), "-"));
|
||||||
|
|
||||||
|
$abills = User::getAttributes("Bill");
|
||||||
|
$ui->assign('abills', $abills);
|
||||||
|
|
||||||
run_hook('view_customer_dashboard'); #HOOK
|
run_hook('view_customer_dashboard'); #HOOK
|
||||||
$ui->display('user-dashboard.tpl');
|
$ui->display('user-dashboard.tpl');
|
||||||
|
@ -658,6 +658,8 @@
|
|||||||
"Activate_Voucher": "Activate Voucher",
|
"Activate_Voucher": "Activate Voucher",
|
||||||
"Voucher_invalid": "Voucher invalid",
|
"Voucher_invalid": "Voucher invalid",
|
||||||
"Account_Not_Found": "Account Not Found",
|
"Account_Not_Found": "Account Not Found",
|
||||||
"Voucher_activation_success__now_you_can_login": "Voucher activation success, now you can login",
|
"Internet_Voucher_Expired": "Internet Voucher Expired",
|
||||||
"Internet_Voucher_Expired": "Internet Voucher Expired"
|
"": "",
|
||||||
|
"Additional_Billing": "Additional Billing",
|
||||||
|
"_": "-"
|
||||||
}
|
}
|
@ -106,6 +106,36 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
</table>
|
</table>
|
||||||
|
{if $abills && count($abills)>0}
|
||||||
|
<div class="box-header">
|
||||||
|
<h3 class="box-title">{Lang::T('Additional Billing')}</h3>
|
||||||
|
</div>
|
||||||
|
<table class="table table-bordered table-striped table-bordered table-hover mb-0"
|
||||||
|
style="margin-bottom: 0px;">
|
||||||
|
{assign var="total" value=0}
|
||||||
|
{foreach $abills as $k => $v}
|
||||||
|
<tr>
|
||||||
|
<td class="small text-success text-uppercase text-normal">{str_replace(' Bill', '', $k)}</td>
|
||||||
|
<td class="small mb15">
|
||||||
|
{if strpos($v, ':') === false}
|
||||||
|
{Lang::moneyFormat($v)}
|
||||||
|
<sup title="recurring">∞</sup>
|
||||||
|
{assign var="total" value=$v+$total}
|
||||||
|
{else}
|
||||||
|
{assign var="exp" value=explode(':',$v)}
|
||||||
|
{Lang::moneyFormat($exp[0])}
|
||||||
|
<sup title="{$exp[1]} more times">{$exp[1]}x</sup>
|
||||||
|
{assign var="total" value=$exp[0]+$total}
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
<tr>
|
||||||
|
<td class="small text-success text-uppercase text-normal"><b>{Lang::T('Total')}</b></td>
|
||||||
|
<td class="small mb15"><b>{Lang::moneyFormat($total)}</b></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{if $_bills}
|
{if $_bills}
|
||||||
<div class="box box-primary box-solid">
|
<div class="box box-primary box-solid">
|
||||||
@ -179,13 +209,15 @@
|
|||||||
<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">
|
<td class="small mb15">
|
||||||
{if $logged == '1'}
|
{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"
|
||||||
{else}
|
class="btn btn-success btn-xs btn-block">{Lang::T('You are Online, Check Status')}</a>
|
||||||
<a href="{$_url}home&mikrotik=login"
|
{else}
|
||||||
onclick="return confirm('{Lang::T('Connect to Internet')}')" class="btn btn-danger btn-xs btn-block">{Lang::T('Not Online, Login now?')}</a>
|
<a href="{$_url}home&mikrotik=login"
|
||||||
{/if}
|
onclick="return confirm('{Lang::T('Connect to Internet')}')"
|
||||||
</td>
|
class="btn btn-danger btn-xs btn-block">{Lang::T('Not Online, Login now?')}</a>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
<tr>
|
<tr>
|
||||||
@ -334,16 +366,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{if isset($hostname) && $hchap == 'true' && $_c['hs_auth_method'] == 'hchap'}
|
{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" src="/ui/ui/scripts/md5.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var hostname = "http://{$hostname}/login";
|
var hostname = "http://{$hostname}/login";
|
||||||
var user = "{$_user['username']}";
|
var user = "{$_user['username']}";
|
||||||
var pass = "{$_user['password']}";
|
var pass = "{$_user['password']}";
|
||||||
var dst = "{$apkurl}";
|
var dst = "{$apkurl}";
|
||||||
var authdly = "2";
|
var authdly = "2";
|
||||||
var key = hexMD5('{$key1}' + pass + '{$key2}');
|
var key = hexMD5('{$key1}' + pass + '{$key2}');
|
||||||
var auth = hostname + '?username=' + user + '&dst=' + dst + '&password=' + key;
|
var auth = hostname + '?username=' + user + '&dst=' + dst + '&password=' + key;
|
||||||
document.write('<meta http-equiv="refresh" target="_blank" content="'+authdly+'; url='+auth+'">');
|
document.write('<meta http-equiv="refresh" target="_blank" content="' + authdly + '; url=' + auth + '">');
|
||||||
</script>
|
</script>
|
||||||
{/if}
|
{/if}
|
||||||
{include file="sections/user-footer.tpl"}
|
{include file="sections/user-footer.tpl"}
|
Loading…
x
Reference in New Issue
Block a user