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