diff --git a/system/autoload/User.php b/system/autoload/User.php
index 1520eb9f..85d9a73d 100644
--- a/system/autoload/User.php
+++ b/system/autoload/User.php
@@ -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;
}
}
diff --git a/system/controllers/home.php b/system/controllers/home.php
index cbe92eb6..434e797e 100644
--- a/system/controllers/home.php
+++ b/system/controllers/home.php
@@ -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']){
diff --git a/ui/ui/user-dashboard.tpl b/ui/ui/user-dashboard.tpl
index dc8b6fe1..8fceff5d 100644
--- a/ui/ui/user-dashboard.tpl
+++ b/ui/ui/user-dashboard.tpl
@@ -8,7 +8,7 @@
-
+
{Lang::T('expired')} |
@@ -62,7 +62,8 @@
-
+
{$_L['Username']} |
{$_user['username']} |
@@ -88,84 +89,95 @@
{/if}
- {if $_bill}
+
+ {if $_bills}
+ {foreach $_bills as $_bill}
{if $_bill['routers'] != 'radius'}
-
- {strtoupper(Lang::T('Location'))} |
- {$_bill['routers']} |
-
+
+ {else}
+
{/if}
-
- {$_L['Plan_Name']} |
-
- {$_bill['namebp']}
- {if $_bill['status'] == 'on'}
- {Lang::T('Deactivate')}
- {else}
- {Lang::T('expired')}
- {/if}
- |
-
-
- {$_L['Created_On']} |
-
- {if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['recharged_on'],$_bill['recharged_time'])}
- {/if} |
-
-
- {$_L['Expires_On']} |
-
- {if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['expiration'],$_bill['time'])}{/if}
- {Lang::T('Recharge')}
- |
-
- {if $nux_ip}
+
- {Lang::T('Current IP')} |
- {$nux_ip} |
-
- {/if}
- {if $nux_mac}
-
- {Lang::T('Current MAC')} |
- {$nux_mac} |
-
- {/if}
- {if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius'}
-
- {Lang::T('Login Status')} |
-
-
+ | {$_L['Plan_Name']} |
+
+ {$_bill['namebp']}
+ {if $_bill['status'] == 'on'}
+ {Lang::T('Deactivate')}
+ {else}
+ {Lang::T('expired')}
+ {/if}
|
- {/if}
- {/if}
-
- {if $_c['disable_voucher'] == 'yes'}
-
+
+ {$_L['Created_On']} |
+
+ {if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['recharged_on'],$_bill['recharged_time'])}
+ {/if} |
+
+
+ {$_L['Expires_On']} |
+
+ {if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['expiration'],$_bill['time'])}{/if}
+ {Lang::T('Recharge')}
+ |
+
+ {if $nux_ip}
+
+ {Lang::T('Current IP')} |
+ {$nux_ip} |
+
+ {/if}
+ {if $nux_mac}
+
+ {Lang::T('Current MAC')} |
+ {$nux_mac} |
+
+ {/if}
+ {if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius'}
+
+ {Lang::T('Login Status')} |
+
+
+ |
+
+ {/if}
+
+ {/foreach}
{/if}
- {if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on'}
-
+ {if $_c['disable_voucher'] == 'yes'}
+
+ {/if}
+ {if $_bills}
+ {foreach $_bills as $_bill}
+ {if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on'}
+
+ {/if}
+ {/foreach}
{/if}
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes'}