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