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'};
52 my $h = int($duration/3600);
53 my $m = sprintf("%02d", int(($duration % 3600) / 60));
54 my $s = sprintf("%02d", $duration % 60);
56 $OUT .= '</TD><TD ALIGN="right">';
57 $OUT .= Number::Format::format_bytes($usage->{'acctinputoctets'}, precision => 2);
58 $utotal += $usage->{'acctinputoctets'};
59 $OUT .= '</TD><TD ALIGN="right">';
60 $OUT .= Number::Format::format_bytes($usage->{'acctoutputoctets'}, precision => 2);
61 $dtotal += $usage->{'acctoutputoctets'};
64 my $h = int($total/3600);
65 my $m = sprintf("%02d", int(($total % 3600) / 60));
66 my $s = sprintf("%02d", $total % 60);
67 $OUT .= qq!<TR><TD></TD><TD></TD>!;
68 $OUT .= qq!<TD ALIGN="right"><HR></TD>! x 3;
70 $OUT .= qq!<TR><TD></TD><TD></TD><TD ALIGN="right">$h:$m:$s</TD>!;
71 $OUT .= qq!<TD ALIGN="right">!;
72 $OUT .= Number::Format::format_bytes($utotal, precision => 2). qq!</TD>!;
73 $OUT .= qq!<TD ALIGN="right">!;
74 $OUT .= Number::Format::format_bytes($dtotal, precision => 2). qq!</TD>!;
80 <%= include('footer') %>