change service, billing, and payment info in selfservice
[freeside.git] / fs_selfservice / FS-SelfService / cgi / change_ship.html
1 <HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
2 <BODY BGCOLOR="#eeeeee">
3 <FONT SIZE=5>MyAccount</FONT><BR><BR>
4 <%= $url = "$selfurl?session=$session_id;action="; ''; %>
5 <%= include('myaccount_menu') %>
6 <TD VALIGN="top">
7 <FONT SIZE=4>Edit service address</FONT><BR><BR>
8 <%= if ( $error ) { 
9   $OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT><BR><BR>!;
10 }  ''; %>
11
12 <FORM NAME="OneTrueForm" ACTION="<%= $selfurl %>" METHOD=POST onSubmit="document.bottomform.submit.disabled=true;">
13 <INPUT TYPE="hidden" NAME="session" VALUE="<%= $session_id %>">
14 <INPUT TYPE="hidden" NAME="action" VALUE="process_change_ship">
15 <TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
16
17 <%=
18   foreach (
19     qw( last first company address1 address2 city county state zip country
20         daytime night fax )
21   ) {
22     $OUT .= qq!<INPUT TYPE="hidden" NAME="$_" VALUE="${$_}">!;
23   };
24   '';
25 %>
26 <SCRIPT>
27 function bill_changed(what) {
28   if ( what.form.same.checked ) {
29 <%=
30   for (qw( last first company address1 address2 city zip daytime night fax )) { 
31     $OUT .= "what.form.ship_$_.value = what.form.$_.value;";
32   } 
33   '';
34 %>
35     what.form.ship_country.selectedIndex = what.form.country.selectedIndex;
36
37     function fix_ship_county() {
38       what.form.ship_county.selectedIndex = what.form.county.selectedIndex;
39     }
40
41     function fix_ship_state() {
42       what.form.ship_state.selectedIndex = what.form.state.selectedIndex;
43       ship_state_changed(what.form.ship_state, fix_ship_county );
44     }
45
46     ship_country_changed(what.form.ship_country, fix_ship_state );
47
48   }
49 }
50 function samechanged(what) {
51   if ( what.checked ) {
52     bill_changed(what);
53
54 <%=
55   for (qw( last first company address1 address2 city county state zip country daytime night fax )) { 
56     $OUT .= "what.form.ship_$_.disabled = true;";
57     $OUT .= "what.form.ship_$_.style.backgroundColor = '#dddddd';";
58   } 
59   if ( $require_address2 ) {
60     $OUT .= "document.getElementById('ship_address2_required').style.visibility = 'hidden';";
61     $OUT .= "document.getElementById('ship_address2_label').style.visibility = 'hidden';";
62   }
63 %> 
64
65   } else {
66
67 <%=
68   for (qw( last first company address1 address2 city county state zip country daytime night fax )) { 
69     $OUT .= "what.form.ship_$_.disabled = false;";
70     $OUT .= "what.form.ship_$_.style.backgroundColor = '#ffffff';";
71   } 
72   if ( $require_address2 ) {
73     $OUT .= "document.getElementById('ship_address2_required').style.visibility = '';";
74     $OUT .= "document.getElementById('ship_address2_label').style.visibility = '';";
75   }
76 %>
77   }
78 }
79 </SCRIPT>
80 (<INPUT TYPE="checkbox" NAME="same" VALUE="Y" onClick="samechanged(this)"
81   <%= (!$ship_last || $cgi->param('same') eq 'Y') ? 'CHECKED' : '' %>
82  >same as billing address)
83 <%= $r=qq!<font color="#ff0000">*</font>&nbsp;!;
84     if (!$ship_last || $cgi->param('same') eq 'Y') {
85       $disabled = 'DISABLED STYLE="background-color: #dddddd"';
86       foreach ( qw( last first company address1 address2 city county state
87                     zip country daytime night fax )
88       ) {
89         ${"ship_$_"} = ${$_};
90       }
91     }else{
92       $disabled = '';
93     }
94     $pre = 'ship_';
95     include('contact');
96 %>
97
98 <INPUT TYPE="submit" NAME="submit" VALUE="<%= $custnum ?  "Apply Changes" : "Add Customer" %>">
99 <BR>
100 </FORM>
101 </TD></TR></TABLE>
102 <HR>
103 <FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
104 </BODY></HTML>