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