<%= $url = "$selfurl?session=$session_id;action="; @svc_acct = grep { $_->{svcdb} eq 'svc_acct' } @svcs; @svc_phone = grep { $_->{svcdb} eq 'svc_phone' } @svcs; @svc_port = grep { $_->{svcdb} eq 'svc_port' } @svcs; ''; %> <%= include('header', 'Account usage') %> <%= if ( $error ) { $OUT .= qq!$error

!; } ''; %> <%= if ( @svc_acct ) { $OUT.= ''; } else { $OUT .= ''; } %> <%= foreach my $svc ( @svc_acct ) { my $link = "${url}view_usage_details;". "svcnum=$svc->{'svcnum'};beginning=0;ending=0"; my $username = $svc->{'value'}; $username =~ s/@.*?$//g if $view_usage_nodomain; $OUT .= ''; if ( $svc->{'recharge_amount'} ) { my $link = "${url}process_order_recharge;". "svcnum=$svc->{'svcnum'}"; $OUT .= ''; } } %> <%= scalar(@svc_acct) ? '
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 .= '


' : '' %> <%= if ( @svc_phone ) { $OUT.= 'Call usage

'; #"Account" ? #what else? $OUT .= ''; } else { $OUT .= ''; } %> <%= foreach my $svc_phone ( @svc_phone ) { my $link = "${url}view_cdr_details;". "svcnum=$svc_phone->{'svcnum'};beginning=0;ending=0"; $OUT .= ''; } %> <%= scalar(@svc_phone) ? '
Number
'; $OUT .= qq!!. $svc_phone->{'label'}. ': '. $svc_phone->{'value'}.''; $OUT .= '


' : '' %> <%= if ( @svc_port ) { $OUT.= 'Bandwidth Graphs

'; } $OUT .= ''; %> <%= sub preset_range { my($start,$end,$label,$date_format,$prefix) = (shift,shift,shift,shift,shift); $start = Date::Format::time2str($date_format,$start); $end = Date::Format::time2str($date_format,$end); return ''.$label.''; } foreach my $svc_port ( @svc_port ) { $svcnum = $svc_port->{'svcnum'}; $default_end = time; $default_start = $default_end-86400; $OUT .= ''; $OUT .= qq! '; } %> <%= scalar(@svc_port) ? '
Service
'. $svc_port->{'label'}. ': '. $svc_port->{'value'}.'
!; $OUT .= preset_range($default_start,$default_end,'Last Day',$date_format,$svcnum) .' | '.preset_range($default_end-86400*7,$default_end,'Last Week',$date_format,$svcnum) .' | '.preset_range($default_end-86400*30,$default_end,'Last Month',$date_format,$svcnum) .' | '.preset_range($default_end-86400*365,$default_end,'Last Year',$date_format,$svcnum); $OUT .= qq!
Start Date End Date
!; $OUT .= '


' : '' %> <%= include('footer') %>