RT#24739: Announcment page for customers logged into portal
[freeside.git] / fs_selfservice / FS-SelfService / cgi / myaccount.html
1 <%= $url = "$selfurl?action="; ''; %>
2 <%= include('header', 'My Account') %>
3
4 Hello <%= $name %>!<BR><BR>
5
6 <%= include('small_custview') %>
7
8 <BR>
9
10 <%=
11   $OUT .= qq! <B><A HREF="${url}invoices">View All Invoices</A></B> &nbsp; &nbsp; !;
12 %>
13
14 <%= if ( $balance > 0 ) {
15   if (scalar(grep $_, @hide_payment_fields)) { # this sucks
16     $OUT .= qq! <B><A HREF="${url}make_thirdparty_payment&payby_method=CC">Make a payment</A></B><BR><BR>!;
17   } else {
18     $OUT .= qq! <B><A HREF="${url}make_payment">Make a payment</A></B><BR>!;
19     foreach my $term ( sort { $b <=> $a } keys %discount_terms_hash ) {
20       my $saved = $discount_terms_hash{$term}->[1];
21       my $amount = $discount_terms_hash{$term}->[2];
22       my $savings = ( $amount + $saved > 0 )
23                     ? sprintf('%d', $saved / ( $amount + $saved ) * 100 ) : '0';
24       $OUT .= qq! <B><A HREF="${url}make_term_payment;discount_term=$term;amount=$amount">Save $savings\% by paying for $term months: $amount</A></B><BR>!;
25     }
26     $OUT .= qq! <BR>!;
27   }
28 } %>
29 <%=
30   if ( @open_invoices ) {
31     my $th  = q!<TH STYLE="background: #ff9999; text-align: left; padding: .1em .5em;">!;
32     my $thr = q!<TH STYLE="background: #ff9999; text-align: right; padding: .1em .5em;">!;
33     $OUT .= '<TABLE STYLE="border: 0;" CELLSPACING="0">'.
34             '<TR><TH BGCOLOR="#ff6666" COLSPAN="4">Open Invoices</TH></TR>'.
35             '<TR>'.$th.'Invoice #</TH>'.$th.'Date</TH>'.$thr.'Charges</TH>'
36             .$thr.'Owed</TH></TR>';
37     my $col1 = "#ffffff";
38     my $col2 = "#dddddd";
39     my $col = $col1;
40
41     foreach my $invoice ( @open_invoices ) {
42       my $td  = qq!<TD STYLE="background: $col; padding: .1em .5em;">!;
43       my $tdr = qq!<TD STYLE="background: $col; padding: .1em .5em; text-align: right;">!;
44       my $a=qq!<A HREF="${url}view_invoice;invnum=!. $invoice->{'invnum'}. '">';
45       $OUT .=
46         "<TR>".
47         $td . $a . $invoice->{'invnum'}. "</A></TD>" .
48         $td . $a . $invoice->{'date'} . "</A></TD>" .
49         $tdr . $a . $money_char . $invoice->{'charged'} . "</A></TD>" .
50         $tdr . $a . $money_char . $invoice->{'owed'} . "</A></TD>" .
51         '</TR>';
52       $col = $col eq $col1 ? $col2 : $col1;
53     }
54     $OUT .= '</TABLE><BR>';
55   } else {
56     $OUT .= '<P>You have no outstanding invoices.</P>';
57   }
58 %>
59
60 <%= $announcement || '' %>
61
62 <%=
63   if ( @support_services ) {
64     $OUT .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#eeeeee">'.
65             '<TR><TH BGCOLOR="#ff6666" COLSPAN="3">Support Time Remaining</TH>'.
66             '</TR><TR><TH>Package</TH><TH></TH>'.
67             '<TH>Time Remaining</TH></TR>';
68     my $col1 = $stripe1_bgcolor || '#ffffff';
69     my $col2 = $stripe2_bgcolor || '#dddddd';
70     my $col = $col1;
71
72     foreach my $support ( @support_services ) {
73       my $td = qq!<TD BGCOLOR="$col">!;
74       my $a = qq!<A HREF="${url}view_support_details;svcnum=!.
75               $support->{'svcnum'}. '">';
76       $OUT .=
77         "<TR>".
78           $td.$a. $support->{'pkg'}. "</A></TD>".
79           $td.'&nbsp;</TD>'.
80           $td.$a. $support->{'time'}. "</A></TD>".
81         '</TR>';
82       $col = $col eq $col1 ? $col2 : $col1;
83     }
84     $OUT .= '</TABLE><BR>';
85   } else {
86     $OUT .= '';
87   }
88 %>
89
90 <%= if (@tickets) {
91       $OUT .= include('ticket_summary');
92     } else {
93       $OUT .= '';
94     }
95 %>
96
97 <%= include('footer') %>