This commit was generated by cvs2svn to compensate for changes in r6255,
[freeside.git] / fs_selfservice / FS-SelfService / cgi / view_usage_details.html
1 <HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
2 <BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
3 <%= $url = "$selfurl?session=$session_id;action="; ''; %>
4 <%= include('myaccount_menu') %>
5 <TD VALIGN="top">
6
7 <FONT SIZE=4>Service usage details for
8 <%= Date::Format::time2str('%b&nbsp;%o&nbsp;%Y', $beginning) %> -
9 <%= Date::Format::time2str('%b&nbsp;%o&nbsp;%Y', $ending) %>
10 </FONT><BR><BR>
11
12 <%= if ( $error ) {
13   $OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">$error</FONT><BR><BR>!;
14 } ''; %>
15  
16 <TABLE WIDTH="100%">
17   <TR>
18     <TD WIDTH="50%">
19 <%= if ($previous < $beginning) {
20     $OUT .= qq!<A HREF="${url}view_usage_details;svcnum=$svcnum;beginning=!;
21     $OUT .= qq!$previous;ending=$beginning">Previous period</A>!;
22     }else{
23       '';
24     } %>
25     </TD>
26     <TD  WIDTH="50%" ALIGN="right">
27 <%= if ($next > $ending) {
28     $OUT .= qq!<A HREF="${url}view_usage_details;svcnum=$svcnum;beginning=!;
29     $OUT .= qq!$ending;ending=$next">Next period</A>!;
30     }else{
31       '';
32     }%>
33     </TD>
34   </TR>
35 </TABLE>
36 <TABLE BGCOLOR="#cccccc">
37   <TR>
38     <TH ALIGN="left">Account</TH>
39     <TH ALIGN="right">Start Time</TH>
40     <TH ALIGN="right">Duration</TH>
41     <TH ALIGN="right">Upload</TH>
42     <TH ALIGN="right">Download</TH>
43   </TR>
44 <%= my $total = 0;
45     my $utotal = 0;
46     my $dtotal = 0;
47     foreach my $usage ( @usage ) {
48   $OUT .= '<TR><TD>';
49     $OUT .= $usage->{'username'};
50     $OUT .= '</TD><TD ALIGN="right">';
51     $OUT .= Date::Format::time2str('%T%P %a&nbsp;%b&nbsp;%o&nbsp;%Y', $usage->{'acctstarttime'});
52     $OUT .= '</TD><TD ALIGN="right">';
53     my $duration =  $usage->{'acctstoptime'} - $usage->{'acctstarttime'};
54     $total += $duration;
55     my $h = int($duration/3600);
56     my $m = sprintf("%02d", int(($duration % 3600) / 60));
57     my $s = sprintf("%02d", $duration % 60);
58     $OUT .=  "$h:$m:$s";
59     $OUT .= '</TD><TD ALIGN="right">';
60     $OUT .= Number::Format::format_bytes($usage->{'acctinputoctets'}, precision => 2);
61     $utotal += $usage->{'acctinputoctets'};
62     $OUT .= '</TD><TD ALIGN="right">';
63     $OUT .= Number::Format::format_bytes($usage->{'acctoutputoctets'}, precision => 2);
64     $dtotal += $usage->{'acctoutputoctets'};
65   $OUT .= '</TD></TR>';
66   }
67   my $h = int($total/3600);
68   my $m = sprintf("%02d", int(($total % 3600) / 60));
69   my $s = sprintf("%02d", $total % 60);
70   $OUT .=  qq!<TR><TD></TD><TD></TD>!;
71   $OUT .=  qq!<TD ALIGN="right"><HR></TD>! x 3;
72   $OUT .=  qq!</TR>!;
73   $OUT .=  qq!<TR><TD></TD><TD></TD><TD ALIGN="right">$h:$m:$s</TD>!;
74   $OUT .=  qq!<TD ALIGN="right">!;
75   $OUT .=  Number::Format::format_bytes($utotal, precision => 2). qq!</TD>!;
76   $OUT .=  qq!<TD ALIGN="right">!;
77   $OUT .=  Number::Format::format_bytes($dtotal, precision => 2). qq!</TD>!;
78   $OUT .=  qq!</TR>!; %>
79
80 </TABLE>
81 <BR>
82
83 </TD></TR></TABLE>
84 <HR>
85 <FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
86 </BODY></HTML>