[freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi selfservice.cgi, 1.22, 1.23 view_usage_details.html, 1.1, 1.2
Jeff Finucane,420,,
jeff at wavetail.420.am
Fri Jun 22 14:25:40 PDT 2007
Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi
In directory wavetail:/tmp/cvs-serv28712
Modified Files:
selfservice.cgi view_usage_details.html
Log Message:
self-service usage report enhancements (1495)
Index: selfservice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/selfservice.cgi,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- selfservice.cgi 29 Apr 2007 22:55:14 -0000 1.22
+++ selfservice.cgi 22 Jun 2007 21:25:38 -0000 1.23
@@ -8,6 +8,7 @@
use Text::Template;
use HTML::Entities;
use Date::Format;
+use Number::Format;
use FS::SelfService qw( login customer_info invoice
payment_info process_payment
process_prepay
Index: view_usage_details.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/view_usage_details.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- view_usage_details.html 5 Jan 2007 05:19:35 -0000 1.1
+++ view_usage_details.html 22 Jun 2007 21:25:38 -0000 1.2
@@ -35,8 +35,12 @@
<TH ALIGN="left">Account</TH>
<TH ALIGN="right">Start Time</TH>
<TH ALIGN="right">Duration</TH>
+ <TH ALIGN="right">Upload</TH>
+ <TH ALIGN="right">Download</TH>
</TR>
<%= my $total = 0;
+ my $utotal = 0;
+ my $dtotal = 0;
foreach my $usage ( @usage ) {
$OUT .= '<TR><TD>';
$OUT .= $usage->{'username'};
@@ -49,13 +53,26 @@
my $m = sprintf("%02d", int(($duration % 3600) / 60));
my $s = sprintf("%02d", $duration % 60);
$OUT .= "$h:$m:$s";
+ $OUT .= '</TD><TD ALIGN="right">';
+ $OUT .= Number::Format::format_bytes($usage->{'acctinputoctets'}, precision => 2);
+ $utotal += $usage->{'acctinputoctets'};
+ $OUT .= '</TD><TD ALIGN="right">';
+ $OUT .= Number::Format::format_bytes($usage->{'acctoutputoctets'}, precision => 2);
+ $dtotal += $usage->{'acctoutputoctets'};
$OUT .= '</TD></TR>';
}
my $h = int($total/3600);
my $m = sprintf("%02d", int(($total % 3600) / 60));
my $s = sprintf("%02d", $total % 60);
- $OUT .= qq!<TR><TD></TD><TD></TD><TD ALIGN="right">========</TD></TR>!;
- $OUT .= qq!<TR><TD></TD><TD></TD><TD ALIGN="right">$h:$m:$s</TD></TR>!; %>
+ $OUT .= qq!<TR><TD></TD><TD></TD>!;
+ $OUT .= qq!<TD ALIGN="right">========</TD>! x 3;
+ $OUT .= qq!</TR>!;
+ $OUT .= qq!<TR><TD></TD><TD></TD><TD ALIGN="right">$h:$m:$s</TD>!;
+ $OUT .= qq!<TD ALIGN="right">!;
+ $OUT .= Number::Format::format_bytes($utotal, precision => 2). qq!</TD>!;
+ $OUT .= qq!<TD ALIGN="right">!;
+ $OUT .= Number::Format::format_bytes($dtotal, precision => 2). qq!</TD>!;
+ $OUT .= qq!</TR>!; %>
</TABLE>
<BR>
More information about the freeside-commits
mailing list