more self-servicey stuff (change package, detailed usage)
[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</FONT><BR><BR>
8
9 <%= if ( $error ) {
10   $OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">$error</FONT><BR><BR>!;
11 } ''; %>
12  
13 <TABLE WIDTH="100%">
14   <TR>
15     <TD WIDTH="50%">
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>!;
19     }else{
20       '';
21     } %>
22     </TD>
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>!;
27     }else{
28       '';
29     }%>
30     </TD>
31   </TR>
32 </TABLE>
33 <TABLE BGCOLOR="#cccccc">
34   <TR>
35     <TH ALIGN="left">Account</TH>
36     <TH ALIGN="right">Start Time</TH>
37     <TH ALIGN="right">Duration</TH>
38   </TR>
39 <%= my $total = 0;
40     foreach my $usage ( @usage ) {
41   $OUT .= '<TR><TD>';
42     $OUT .= $usage->{'username'};
43     $OUT .= '</TD><TD ALIGN="right">';
44     $OUT .= Date::Format::time2str('%T%P %a&nbsp;%b&nbsp;%o&nbsp;%Y', $usage->{'acctstarttime'});
45     $OUT .= '</TD><TD ALIGN="right">';
46     my $duration =  $usage->{'acctstoptime'} - $usage->{'acctstarttime'};
47     $total += $duration;
48     my $h = int($duration/3600);
49     my $m = sprintf("%02d", int(($duration % 3600) / 60));
50     my $s = sprintf("%02d", $duration % 60);
51     $OUT .=  "$h:$m:$s";
52   $OUT .= '</TD></TR>';
53   }
54   my $h = int($total/3600);
55   my $m = sprintf("%02d", int(($total % 3600) / 60));
56   my $s = sprintf("%02d", $total % 60);
57   $OUT .=  qq!<TR><TD></TD><TD></TD><TD ALIGN="right">========</TD></TR>!;
58   $OUT .=  qq!<TR><TD></TD><TD></TD><TD ALIGN="right">$h:$m:$s</TD></TR>!; %>
59
60 </TABLE>
61 <BR>
62
63 </TD></TR></TABLE>
64 <HR>
65 <FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
66 </BODY></HTML>