From 49b22e4f5dd55ce3c2d047539ba4744c9bc45bbb Mon Sep 17 00:00:00 2001 From: Joshua Ocero Date: Tue, 24 Mar 2015 12:21:30 +0300 Subject: [PATCH] Changed Online Users Packet Data usage to MBs to make it more readable --- htdocs/system/application/models/onlineusermodel.php | 3 +-- htdocs/system/application/views/onlineusers_view.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/system/application/models/onlineusermodel.php b/htdocs/system/application/models/onlineusermodel.php index c1776e5..ef70898 100755 --- a/htdocs/system/application/models/onlineusermodel.php +++ b/htdocs/system/application/models/onlineusermodel.php @@ -11,8 +11,7 @@ function onlineusermodel(){ function get_onlineusers() { // this works no matter what ...I think !!! - // return $this->db->query('select username, MAX(acctstarttime) as start, MAX(acctstoptime) as stop, sum(acctsessiontime) as time,sum(acctoutputoctets)+sum(acctinputoctets) as packet from radacct group by username having (start > stop) or (stop IS NULL)'); - return $this->db->query('select username, MAX(acctstarttime) as start, (acctstoptime) as stop, sum(acctsessiontime) as time,sum(acctoutputoctets)+sum(acctinputoctets) as packet from radacct where (acctstoptime IS NULL) group by username'); + return $this->db->query('select username, MAX(acctstarttime) as start, (acctstoptime) as stop, sum(acctsessiontime) as time,(sum(acctoutputoctets)+sum(acctinputoctets))/1048576 as packet from radacct where (acctstoptime IS NULL) group by username'); } } diff --git a/htdocs/system/application/views/onlineusers_view.php b/htdocs/system/application/views/onlineusers_view.php index 483b026..8923498 100755 --- a/htdocs/system/application/views/onlineusers_view.php +++ b/htdocs/system/application/views/onlineusers_view.php @@ -21,7 +21,7 @@ username;?> start;?> time;?> - packet;?> + packet;?> MB username,'disconnect','class="disconnect" ')?>