X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=fs_selfservice%2FFS-SelfService%2Fcgi%2Fview_usage_details.html;h=27afe12a701fe7f3716b85cbce2fe65eed3f2da3;hp=9067755b08440e35144acf6fd9a73c2839c7435d;hb=0592d8e1ad7c8cab286b43743765fd1435cfac84;hpb=66bf9d2b3998894588d73a10a459aa1453283ef1 diff --git a/fs_selfservice/FS-SelfService/cgi/view_usage_details.html b/fs_selfservice/FS-SelfService/cgi/view_usage_details.html index 9067755b0..27afe12a7 100644 --- a/fs_selfservice/FS-SelfService/cgi/view_usage_details.html +++ b/fs_selfservice/FS-SelfService/cgi/view_usage_details.html @@ -1,10 +1,10 @@ -MyAccount -MyAccount

-<%= $url = "$selfurl?session=$session_id;action="; ''; %> -<%= include('myaccount_menu') %> - - -Service usage details

+<%= $url = "$selfurl?;action="; ''; %> +<%= include('header', 'Service usage details for '. + Date::Format::time2str('%b %o %Y', $beginning). + ' - '. + Date::Format::time2str('%b %o %Y', $ending) + ) +%> <%= if ( $error ) { $OUT .= qq!$error

!; @@ -35,32 +35,48 @@ Account Start Time Duration + Upload + Download <%= my $total = 0; + my $utotal = 0; + my $dtotal = 0; foreach my $usage ( @usage ) { $OUT .= ''; $OUT .= $usage->{'username'}; $OUT .= ''; $OUT .= Date::Format::time2str('%T%P %a %b %o %Y', $usage->{'acctstarttime'}); $OUT .= ''; - my $duration = $usage->{'acctstoptime'} - $usage->{'acctstarttime'}; + my $duration = ( $usage->{'acctstoptime'} && $usage->{'acctstarttime'} ) + ? ( $usage->{'acctstoptime'} - $usage->{'acctstarttime'} ) + : 0; $total += $duration; my $h = int($duration/3600); my $m = sprintf("%02d", int(($duration % 3600) / 60)); my $s = sprintf("%02d", $duration % 60); $OUT .= "$h:$m:$s"; + $OUT .= ''; + $OUT .= Number::Format::format_bytes($usage->{'acctinputoctets'}, precision => 2); + $utotal += $usage->{'acctinputoctets'}; + $OUT .= ''; + $OUT .= Number::Format::format_bytes($usage->{'acctoutputoctets'}, precision => 2); + $dtotal += $usage->{'acctoutputoctets'}; $OUT .= ''; } my $h = int($total/3600); my $m = sprintf("%02d", int(($total % 3600) / 60)); my $s = sprintf("%02d", $total % 60); - $OUT .= qq!========!; - $OUT .= qq!$h:$m:$s!; %> + $OUT .= qq!!; + $OUT .= qq!
! x 3; + $OUT .= qq!!; + $OUT .= qq!$h:$m:$s!; + $OUT .= qq!!; + $OUT .= Number::Format::format_bytes($utotal, precision => 2). qq!!; + $OUT .= qq!!; + $OUT .= Number::Format::format_bytes($dtotal, precision => 2). qq!!; + $OUT .= qq!!; %>
- -
-powered by freeside - +<%= include('footer') %>