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