1 <%= $url = "$selfurl?;action="; ''; %>
2 <%= include('header', 'Service usage details for '.
3 Date::Format::time2str('%b %o %Y', $beginning).
5 Date::Format::time2str('%b %o %Y', $ending)
10 $OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">$error</FONT><BR><BR>!;
16 <%= if ($previous < $beginning) {
17 $OUT .= qq!<A HREF="${url}view_usage_details;svcnum=$svcnum;beginning=!;
18 $OUT .= qq!$previous;ending=$beginning">Previous period</A>!;
23 <TD WIDTH="50%" ALIGN="right">
24 <%= if ($next > $ending) {
25 $OUT .= qq!<A HREF="${url}view_usage_details;svcnum=$svcnum;beginning=!;
26 $OUT .= qq!$ending;ending=$next">Next period</A>!;
33 <TABLE BGCOLOR="#cccccc">
35 <TH ALIGN="left">Account</TH>
36 <TH ALIGN="right">Start Time</TH>
37 <TH ALIGN="right">Duration</TH>
38 <TH ALIGN="right">Upload</TH>
39 <TH ALIGN="right">Download</TH>
44 foreach my $usage ( @usage ) {
46 $OUT .= $usage->{'username'};
47 $OUT .= '</TD><TD ALIGN="right">';
48 $OUT .= Date::Format::time2str('%T%P %a %b %o %Y', $usage->{'acctstarttime'});
49 $OUT .= '</TD><TD ALIGN="right">';
50 my $duration = ( $usage->{'acctstoptime'} && $usage->{'acctstarttime'} )
51 ? ( $usage->{'acctstoptime'} - $usage->{'acctstarttime'} )
54 my $h = int($duration/3600);
55 my $m = sprintf("%02d", int(($duration % 3600) / 60));
56 my $s = sprintf("%02d", $duration % 60);
58 $OUT .= '</TD><TD ALIGN="right">';
59 $OUT .= Number::Format::format_bytes($usage->{'acctinputoctets'}, precision => 2);
60 $utotal += $usage->{'acctinputoctets'};
61 $OUT .= '</TD><TD ALIGN="right">';
62 $OUT .= Number::Format::format_bytes($usage->{'acctoutputoctets'}, precision => 2);
63 $dtotal += $usage->{'acctoutputoctets'};
66 my $h = int($total/3600);
67 my $m = sprintf("%02d", int(($total % 3600) / 60));
68 my $s = sprintf("%02d", $total % 60);
69 $OUT .= qq!<TR><TD></TD><TD></TD>!;
70 $OUT .= qq!<TD ALIGN="right"><HR></TD>! x 3;
72 $OUT .= qq!<TR><TD></TD><TD></TD><TD ALIGN="right">$h:$m:$s</TD>!;
73 $OUT .= qq!<TD ALIGN="right">!;
74 $OUT .= Number::Format::format_bytes($utotal, precision => 2). qq!</TD>!;
75 $OUT .= qq!<TD ALIGN="right">!;
76 $OUT .= Number::Format::format_bytes($dtotal, precision => 2). qq!</TD>!;
82 <%= include('footer') %>