summaryrefslogtreecommitdiff
path: root/fs_selfservice/FS-SelfService/cgi/view_usage.html
blob: b492102ce02b96c2b05eea80fb96d93640d4ca92 (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
<%= $url = "$selfurl?session=$session_id;action=";
    @svc_acct  = grep { $_->{svcdb} eq 'svc_acct'  } @svcs;
    @svc_phone = grep { $_->{svcdb} eq 'svc_phone' } @svcs;
    '';
%>
<%= include('header') %>

<%= if ( $error ) {
  $OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">$error</FONT><BR><BR>!;
} ''; %>

<%= if ( @svc_acct ) {
      $OUT.= '<FONT SIZE="4">Account usage</FONT><BR><BR>
              <TABLE BGCOLOR="#cccccc">
                <TR>
                  <TH ALIGN="left">Account</TH>
                  <TH ALIGN="right">Time remaining</TH>
                  <TH ALIGN="right">Upload remaining</TH>
                  <TH ALIGN="right">Download remaining</TH>
                  <TH ALIGN="right">Total remaining</TH>
                </TR>';
    } else {
      $OUT .= '';
    }
%>

<%= foreach my $svc ( @svc_acct ) {
      my $link = "${url}view_usage_details;".
        "svcnum=$svc->{'svcnum'};beginning=0;ending=0";
  $OUT .= '<TR><TD>';
    $OUT .= qq!<A HREF="$link">!. $svc->{'label'}. ': '. $svc->{'value'}.'</A>';
    $OUT .= '</TD><TD ALIGN="right">';
    $OUT .= $svc->{'seconds'};
    $OUT .= '</TD><TD ALIGN="right">';
    $OUT .=  $svc->{'upbytes'};
    $OUT .= '</TD><TD ALIGN="right">';
    $OUT .= $svc->{'downbytes'};
    $OUT .= '</TD><TD ALIGN="right">';
    $OUT .= $svc->{'totalbytes'};
  $OUT .= '</TD></TR>';
    if ( $svc->{'recharge_amount'} ) {
      my $link = "${url}process_order_recharge;".
                 "svcnum=$svc->{'svcnum'}";
    $OUT .= '<TR><TD ALIGN="right">';
      $OUT .= qq!<A HREF="$link">!.'Recharge for $';
      $OUT .= $svc->{'recharge_amount'} . '</A> with';
      $OUT .= '</TD><TD ALIGN="right">';
      $OUT .= $svc->{'recharge_seconds'} if $svc->{'recharge_seconds'};
      $OUT .= '</TD><TD ALIGN="right">';
      $OUT .=  $svc->{'recharge_upbytes'} if $svc->{'recharge_upbytes'};
      $OUT .= '</TD><TD ALIGN="right">';
      $OUT .= $svc->{'recharge_downbytes'} if $svc->{'recharge_downbytes'};
      $OUT .= '</TD><TD ALIGN="right">';
      $OUT .= $svc->{'recharge_totalbytes'} if $svc->{'recharge_totalbytes'};
    $OUT .= '</TD></TR>';
    }
  }
%>

<%= scalar(@svc_acct) ? '</TABLE><BR><BR>' : '' %>

<%= if ( @svc_phone ) {
      $OUT.= '<FONT SIZE="4">Call usage</FONT><BR><BR>
              <TABLE BGCOLOR="#cccccc">
                <TR>
                  <TH ALIGN="left">Number</TH>'; #"Account" ?
                                                 #what else?
      $OUT .= '</TR>';
    } else {
      $OUT .= '';
    }
%>

<%= foreach my $svc_phone ( @svc_phone ) {
      my $link = "${url}view_cdr_details;".
        "svcnum=$svc_phone->{'svcnum'};beginning=0;ending=0";
  $OUT .= '<TR><TD>';
    $OUT .= qq!<A HREF="$link">!. $svc_phone->{'label'}. ': '. $svc_phone->{'value'}.'</A>';
  $OUT .= '</TD></TR>';
  }
%>

<%= scalar(@svc_phone) ? '</TABLE><BR><BR>' : '' %>

</TD></TR></TABLE>
<%= include('footer') %>