summaryrefslogtreecommitdiff
path: root/httemplate/view
diff options
context:
space:
mode:
authorivan <ivan>2002-11-05 23:29:38 +0000
committerivan <ivan>2002-11-05 23:29:38 +0000
commit548a47b0ec1040320e56f17cfac71f716785cb95 (patch)
treea17d59c3aed4149285c47bcfddf6b041950cf6ca /httemplate/view
parentfc3b6024fcf0bf0394e6239639cbe31786b0cad8 (diff)
bandwidth charges from sqlradius
Diffstat (limited to 'httemplate/view')
-rwxr-xr-xhttemplate/view/svc_acct.cgi18
1 files changed, 15 insertions, 3 deletions
diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi
index e86d43f30..7295f577d 100755
--- a/httemplate/view/svc_acct.cgi
+++ b/httemplate/view/svc_acct.cgi
@@ -78,6 +78,13 @@ if ( $part_svc->part_export('sqlradius') ) {
my $m = int( ($seconds%3600) / 60 );
my $s = $seconds%60;
+ my $input = $svc_acct->attribute_since_sqlradacct(
+ $last_bill, time, 'Acct-Input-Octets'
+ ) / 1048576;
+ my $output = $svc_acct->attribute_since_sqlradacct(
+ $last_bill, time, 'Acct-Output-Octets'
+ ) / 1048576;
+
if ( $seconds ) {
print "Online <B>$h</B>h <B>$m</B>m <B>$s</B>s";
} else {
@@ -86,11 +93,16 @@ if ( $part_svc->part_export('sqlradius') ) {
if ( $cust_pkg ) {
print ' this billing cycle (since '. time2str("%C", $last_bill). ') - '.
- $plandata{recur_included_hours}. ' total hours in plan<BR><BR>';
+ $plandata{recur_included_hours}. ' total hours in plan<BR>';
} else {
- print ' (no billing cycle available for unaudited account)<BR><BR>';
+ print ' (no billing cycle available for unaudited account)<BR>';
}
+ print 'Input: <B>'. sprintf("%.3f", $input). ' megabytes<BR>';
+ print 'Output: <B>'. sprintf("%.3f", $output). ' megabytes<BR>';
+
+ print '<BR>';
+
}
#print qq!<BR><A HREF="../misc/sendconfig.cgi?$svcnum">Send account information</A>!;
@@ -183,7 +195,7 @@ print '<TR><TD ALIGN="right">RADIUS groups</TD><TD BGCOLOR="#ffffff">'.
print '</TABLE></TD></TR></TABLE><BR><BR>';
-print join("\n", $conf->config('svc_acct-notes') ). '<BR><BR>'.
+print join("\n", $conf->config('svc_acct-notes') ). '<BR><BR>'.
joblisting({'svcnum'=>$svcnum}, 1). '</BODY></HTML>';
%>