mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-02-24 07:26:16 +08:00
Customer Dashboard change
This commit is contained in:
parent
4b596d91bd
commit
69ea0d0b7f
3 changed files with 90 additions and 78 deletions
|
@ -22,7 +22,7 @@ class User
|
|||
public static function _billing()
|
||||
{
|
||||
$id = $_SESSION['uid'];
|
||||
$d = ORM::for_table('tbl_user_recharges')->where('customer_id', $id)->find_one();
|
||||
$d = ORM::for_table('tbl_user_recharges')->where('customer_id', $id)->find_many();
|
||||
return $d;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,10 +89,10 @@ if (_post('send') == 'balance') {
|
|||
}
|
||||
|
||||
//Client Page
|
||||
$bill = User::_billing();
|
||||
$ui->assign('_bill', $bill);
|
||||
$bills = User::_billing();
|
||||
$ui->assign('_bills', $bills);
|
||||
|
||||
if(isset($_GET['recharge']) && $_GET['recharge'] == 1){
|
||||
if(isset($_GET['recharge']) && !empty($_GET['recharge'])){
|
||||
$router = ORM::for_table('tbl_routers')->where('name', $bill['routers'])->find_one();
|
||||
if ($config['enable_balance'] == 'yes') {
|
||||
$plan = ORM::for_table('tbl_plans')->find_one($bill['plan_id']);
|
||||
|
@ -104,7 +104,7 @@ if(isset($_GET['recharge']) && $_GET['recharge'] == 1){
|
|||
}else{
|
||||
r2(U . "order/buy/$router[id]/$bill[plan_id]", 'e', 'Order Plan');
|
||||
}
|
||||
}else if(isset($_GET['deactivate']) && $_GET['deactivate'] == 1){
|
||||
}else if(isset($_GET['deactivate']) && !empty($_GET['deactivate'])){
|
||||
if ($bill) {
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $bill['plan_id'])->find_one();
|
||||
if($p['is_radius']){
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<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">
|
||||
<table class="table table-condensed table-bordered table-striped table-hover" style="margin-bottom: 0px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{Lang::T('expired')}</td>
|
||||
|
@ -62,7 +62,8 @@
|
|||
<div class="box-header">
|
||||
<h3 class="box-title">{$_L['Account_Information']}</h3>
|
||||
</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>
|
||||
<td class="small text-success text-uppercase text-normal">{$_L['Username']}</td>
|
||||
<td class="small mb15">{$_user['username']}</td>
|
||||
|
@ -88,84 +89,95 @@
|
|||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $_bill}
|
||||
</table>
|
||||
{if $_bills}
|
||||
{foreach $_bills as $_bill}
|
||||
{if $_bill['routers'] != 'radius'}
|
||||
<tr>
|
||||
<td class="small text-primary text-uppercase text-normal">{strtoupper(Lang::T('Location'))}</td>
|
||||
<td class="small mb15">{$_bill['routers']}</td>
|
||||
</tr>
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{$_bill['routers']}</h3>
|
||||
</div>
|
||||
{else}
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</h3>
|
||||
</div>
|
||||
{/if}
|
||||
<tr>
|
||||
<td class="small text-primary text-uppercase text-normal">{$_L['Plan_Name']}</td>
|
||||
<td class="small mb15">
|
||||
{$_bill['namebp']}
|
||||
{if $_bill['status'] == 'on'}
|
||||
<a class="label label-danger pull-right" href="{$_url}home&deactivate=1"
|
||||
onclick="return confirm('{Lang::T('Deactivate')}?')">{Lang::T('Deactivate')}</a>
|
||||
{else}
|
||||
<a class="label label-warning pull-right" href="{$_url}order/package">{Lang::T('expired')}</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small text-info text-uppercase text-normal">{$_L['Created_On']}</td>
|
||||
<td class="small mb15">
|
||||
{if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['recharged_on'],$_bill['recharged_time'])}
|
||||
{/if} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small text-danger text-uppercase text-normal">{$_L['Expires_On']}</td>
|
||||
<td class="small mb15 text-danger">
|
||||
{if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['expiration'],$_bill['time'])}{/if}
|
||||
<a class="label label-primary pull-right" href="{$_url}home&recharge=1"
|
||||
onclick="return confirm('{Lang::T('Recharge')}?')">{Lang::T('Recharge')}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{if $nux_ip}
|
||||
<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('Current IP')}</td>
|
||||
<td class="small mb15">{$nux_ip}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $nux_mac}
|
||||
<tr>
|
||||
<td class="small text-primary text-uppercase text-normal">{Lang::T('Current MAC')}</td>
|
||||
<td class="small mb15">{$nux_mac}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius'}
|
||||
<tr>
|
||||
<td class="small text-primary text-uppercase text-normal">{Lang::T('Login Status')}</td>
|
||||
<td class="small mb15" id="login_status">
|
||||
<img src="ui/ui/images/loading.gif">
|
||||
<td class="small text-primary text-uppercase text-normal">{$_L['Plan_Name']}</td>
|
||||
<td class="small mb15">
|
||||
{$_bill['namebp']}
|
||||
{if $_bill['status'] == 'on'}
|
||||
<a class="label label-danger pull-right" href="{$_url}home&deactivate={$_bill['id']}"
|
||||
onclick="return confirm('{Lang::T('Deactivate')}?')">{Lang::T('Deactivate')}</a>
|
||||
{else}
|
||||
<a class="label label-warning pull-right" href="{$_url}order/package">{Lang::T('expired')}</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
</table>
|
||||
{if $_c['disable_voucher'] == 'yes'}
|
||||
<div class="box-footer">
|
||||
{if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' }
|
||||
<a href="{$_url}order/package" class="btn btn-primary btn-block">
|
||||
<i class="ion ion-ios-cart"></i>
|
||||
{Lang::T('Order Package')}
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
<tr>
|
||||
<td class="small text-info text-uppercase text-normal">{$_L['Created_On']}</td>
|
||||
<td class="small mb15">
|
||||
{if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['recharged_on'],$_bill['recharged_time'])}
|
||||
{/if} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="small text-danger text-uppercase text-normal">{$_L['Expires_On']}</td>
|
||||
<td class="small mb15 text-danger">
|
||||
{if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['expiration'],$_bill['time'])}{/if}
|
||||
<a class="label label-primary pull-right" href="{$_url}home&recharge={$_bill['id']}"
|
||||
onclick="return confirm('{Lang::T('Recharge')}?')">{Lang::T('Recharge')}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{if $nux_ip}
|
||||
<tr>
|
||||
<td class="small text-primary text-uppercase text-normal">{Lang::T('Current IP')}</td>
|
||||
<td class="small mb15">{$nux_ip}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $nux_mac}
|
||||
<tr>
|
||||
<td class="small text-primary text-uppercase text-normal">{Lang::T('Current MAC')}</td>
|
||||
<td class="small mb15">{$nux_mac}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius'}
|
||||
<tr>
|
||||
<td class="small text-primary text-uppercase text-normal">{Lang::T('Login Status')}</td>
|
||||
<td class="small mb15" id="login_status_{$_bill['id']}">
|
||||
<img src="ui/ui/images/loading.gif">
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</table>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on'}
|
||||
<script>
|
||||
setTimeout(() => {
|
||||
$.ajax({
|
||||
url: "index.php?_route=autoload_user/isLogin",
|
||||
cache: false,
|
||||
success: function(msg) {
|
||||
$("#login_status").html(msg);
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
</script>
|
||||
{if $_c['disable_voucher'] == 'yes'}
|
||||
<div class="box-footer">
|
||||
{if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' }
|
||||
<a href="{$_url}order/package" class="btn btn-primary btn-block">
|
||||
<i class="ion ion-ios-cart"></i>
|
||||
{Lang::T('Order Package')}
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{if $_bills}
|
||||
{foreach $_bills as $_bill}
|
||||
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on'}
|
||||
<script>
|
||||
setTimeout(() => {
|
||||
$.ajax({
|
||||
url: "index.php?_route=autoload_user/isLogin/{$_bill['id']}",
|
||||
cache: false,
|
||||
success: function(msg) {
|
||||
$("#login_status_{$_bill['id']}").html(msg);
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
</script>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/if}
|
||||
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes'}
|
||||
<div class="box box-primary box-solid mb30">
|
||||
|
|
Loading…
Reference in a new issue