%= $url = "$selfurl?action=";
%by_pkg_label = (); # not used yet, but I'm sure it will be...
@svc_acct = ();
@svc_phone = ();
@svc_port = ();
@svc_pbx = ();
foreach (@svcs) {
$by_pkg_label{ $_->{pkg_label} } ||= [];
push @{ $by_pkg_label{ $_->{pkg_label} } }, $_;
if ( $_->{svcdb} eq 'svc_acct' ) {
push @svc_acct, $_;
} elsif ( $_->{svcdb} eq 'svc_phone' ) {
push @svc_phone, $_;
} elsif ( $_->{svcdb} eq 'svc_port' ) {
push @svc_port, $_;
} elsif ( $_->{svcdb} eq 'svc_pbx' ) {
push @svc_pbx, $_;
}
}
'';
%>
<%= include('header', 'Account usage') %>
<%= if ( $error ) {
$OUT .= qq!$error
!;
} ''; %>
<%= if ( @svc_acct ) {
$OUT.= '
Account | Time remaining | Upload remaining | Download remaining | Total remaining |
---|---|---|---|---|
'; $OUT .= qq!!. $svc->{'label'}. ': '. $username .''; $OUT .= ' | '; $OUT .= $svc->{'seconds'}; $OUT .= ' | '; $OUT .= $svc->{'upbytes'}; $OUT .= ' | '; $OUT .= $svc->{'downbytes'}; $OUT .= ' | '; $OUT .= $svc->{'totalbytes'}; $OUT .= ' |
'; $OUT .= qq!!.'Recharge for $'; $OUT .= $svc->{'recharge_amount'} . ' with'; $OUT .= ' | '; $OUT .= $svc->{'recharge_seconds'} if $svc->{'recharge_seconds'}; $OUT .= ' | '; $OUT .= $svc->{'recharge_upbytes'} if $svc->{'recharge_upbytes'}; $OUT .= ' | '; $OUT .= $svc->{'recharge_downbytes'} if $svc->{'recharge_downbytes'}; $OUT .= ' | '; $OUT .= $svc->{'recharge_totalbytes'} if $svc->{'recharge_totalbytes'}; $OUT .= ' |
Number | '; if ( $any{outbound} ) { $OUT .= 'Dialed | '; } if ( $any{inbound} ) { $OUT .= 'Received | '; } $OUT .= '
---|---|---|
'. $svc_x->{'label'}. ': '. $svc_x->{'value'}; $OUT .= ' | '; # usage summary w/ links for my $dir (qw(outbound inbound)) { if ( $dir eq 'inbound' ) { $link .= ';inbound=1'; } if ( $svc_x->{$dir} ) { $OUT .= ''.qq!! . sprintf('%d calls (%.0f minutes)', $svc_x->{$dir}->{'count'}, $svc_x->{$dir}->{'duration'} / 60 ) . ' | '; } elsif ( $any{$dir} ) { $OUT .= ''; } } $OUT .= ' |
Remaining minutes | |||
---|---|---|---|
$description | $remain | / | $total |
* shared among all your phone plans |
Service | |
---|---|
'. $svc_port->{'label'}. ': '. $svc_port->{'value'}.' | '; $OUT .= qq!