1 % if ( $part_svc->part_export_usage ) {
6 % #false laziness w/httemplate/edit/part_pkg... this stuff doesn't really
8 % %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); }
9 % split("\n", $cust_pkg->part_pkg->plandata );
11 % $last_bill = $cust_pkg->last_bill;
17 % my $seconds = $svc_acct->seconds_since_sqlradacct( $last_bill, time );
18 % my $hour = int($seconds/3600);
19 % my $min = int( ($seconds%3600) / 60 );
20 % my $sec = $seconds%60;
22 % my $input = $svc_acct->attribute_since_sqlradacct(
23 % $last_bill, time, 'AcctInputOctets'
25 % my $output = $svc_acct->attribute_since_sqlradacct(
26 % $last_bill, time, 'AcctOutputOctets'
32 RADIUS session information<BR>
33 <% ntable('#cccccc',2) %>
34 <TR><TD BGCOLOR="#ffffff">
37 Online <B><% $hour %></B>h <B><% $min %></B>m <B><% $sec %></B>s
44 since last bill (<% time2str('%a %b %o %Y', $last_bill) %>)
45 % if ( length($plandata{recur_included_hours}) ) {
47 - <% $plandata{recur_included_hours} %> total hours in plan
53 (no billing cycle available for unaudited account)<BR>
57 Upload: <B><% sprintf("%.3f", $input) %></B> megabytes<BR>
58 Download: <B><% sprintf("%.3f", $output) %></B> megabytes<BR>
59 Last Login: <B><% $svc_acct->last_login_text %></B><BR>
60 % my $href = qq!<A HREF="${p}search/sqlradius.cgi?svcnum=!. $svc_acct->svcnum;
63 <% $href %>;begin=<% $last_bill %>">this billing cycle</A>
64 | <% $href %>;begin=<% time-15552000 %>">past six months</A>
65 | <% $href %>">all sessions</A>
67 </TD></TR></TABLE><BR>
73 my $svc_acct = $opt{'svc_acct'};
74 my $part_svc = $opt{'part_svc'};
75 my $cust_pkg = $opt{'cust_pkg'};