{popnum};
- my $poptext = $pop->{city}. ', '. $pop->{state}.
- ' ('. $pop->{ac}. ')/'. $pop->{exch};
+ foreach my $pop ( @{$pop{$state}->{$popac}}) {
+ my $o_popnum = $pop->{popnum};
+ my $poptext = $pop->{city}. ', '. $pop->{state}.
+ ' ('. $pop->{ac}. ')/'. $pop->{exch}. '-'. $pop->{loc};
- $text .= "opt(what.form.popnum, \"$o_popnum\", \"$poptext\");\n"
+ $text .= "opt(what.form.popnum, \"$o_popnum\", \"$poptext\");\n";
+ if ($popnum == $o_popnum) {
+ $text .= "what.form.popnum.options[what.form.popnum.length-1].selected = true;\n";
+ }
+ }
+ $text .= "}\n";
}
- $text .= "}\n";
}
+
$text .= "}\n\n";
$text .=
- qq!!.
- qq! !;
- $text .= " $_" foreach sort { $a cmp $b } keys %pop;
- $text .= ' '; #callback? return 3 html pieces? #'';
+ qq!State!;
+ $text .= " param('acstate') ? " SELECTED" : "") .
+ ">$_" foreach sort { $a cmp $b } @states;
+ $text .= ' '; #callback? return 3 html pieces? #' ';
+
+ $text .=
+ qq!!.
+ qq!Area code !;
+
+ $text .= qq! City!;
+
- $text .= qq! !;
- foreach my $pop ( @$pops ) {
+ #comment this block to disable initial list polulation
+ my @initial_select = ();
+ if ( scalar( @$pops ) > 100 ) {
+ push @initial_select, $popnum2pop{$popnum} if $popnum2pop{$popnum};
+ } else {
+ @initial_select = @$pops;
+ }
+ foreach my $pop ( sort { $a->{state} cmp $b->{state} } @initial_select ) {
$text .= qq! {popnum} == $popnum ) ? ' SELECTED' : '' ). ">".
$pop->{city}. ', '. $pop->{state}.
- ' ('. $pop->{ac}. ')/'. $pop->{exch};
+ ' ('. $pop->{ac}. ')/'. $pop->{exch}. '-'. $pop->{loc};
}
- $text .= ' ';
+
+ $text .= qq!
!;
$text;
+
}
sub expselect {
@@ -314,7 +509,7 @@ sub expselect {
$return .= ">$_";
}
$return .= qq!/!;
- for ( 1999 .. 2037 ) {
+ for ( 2001 .. 2037 ) {
$return .= "county;
+ $countyflag=1 if $c->{county};
+ #push @{$cust_main_county{$c->country}{$c->state}}, $c->county;
+ #$cust_main_county{$c->country}{$c->state}{$c->county} = 1;
+ $cust_main_county{$c->{country}}{$c->{state}}{$c->{county}} = 1;
+ }
+# }
+ $countyflag=1 if $selected_county;
+
+ my $script_html = <
+ function opt(what,value,text) {
+ var optionName = new Option(text, value, false, false);
+ var length = what.length;
+ what.options[length] = optionName;
+ }
+ function ${prefix}country_changed(what) {
+ country = what.options[what.selectedIndex].text;
+ for ( var i = what.form.${prefix}state.length; i >= 0; i-- )
+ what.form.${prefix}state.options[i] = null;
+END
+ #what.form.${prefix}state.options[0] = new Option('', '', false, true);
+
+ foreach my $country ( sort keys %cust_main_county ) {
+ $script_html .= "\nif ( country == \"$country\" ) {\n";
+ foreach my $state ( sort keys %{$cust_main_county{$country}} ) {
+ my $text = $state || '(n/a)';
+ $script_html .= qq!opt(what.form.${prefix}state, "$state", "$text");\n!;
+ }
+ $script_html .= "}\n";
+ }
+
+ $script_html .= <= 0; i-- )
+ what.form.${prefix}county.options[i] = null;
+END
+
+ foreach my $country ( sort keys %cust_main_county ) {
+ $script_html .= "\nif ( country == \"$country\" ) {\n";
+ foreach my $state ( sort keys %{$cust_main_county{$country}} ) {
+ $script_html .= "\nif ( state == \"$state\" ) {\n";
+ #foreach my $county ( sort @{$cust_main_county{$country}{$state}} ) {
+ foreach my $county ( sort keys %{$cust_main_county{$country}{$state}} ) {
+ my $text = $county || '(n/a)';
+ $script_html .=
+ qq!opt(what.form.${prefix}county, "$county", "$text");\n!;
+ }
+ $script_html .= "}\n";
+ }
+ $script_html .= "}\n";
+ }
+ }
+
+ $script_html .= <
+END
+
+ my $county_html = $script_html;
+ if ( $countyflag ) {
+ $county_html .= qq!!;
+ $county_html .= ' ';
+ } else {
+ $county_html .=
+ qq! !;
+ }
+
+ my $state_html = qq!!;
+ foreach my $state ( sort keys %{ $cust_main_county{$selected_country} } ) {
+ my $text = $state || '(n/a)';
+ my $selected = $state eq $selected_state ? 'SELECTED' : '';
+ $state_html .= "\n$text "
+ }
+ $state_html .= ' ';
+
+ $state_html .= ' ';
+
+ my $country_html = qq!!;
+ my $countrydefault = $init_data->{countrydefault} || 'US';
+ foreach my $country (
+ sort { ($b eq $countrydefault) <=> ($a eq $countrydefault) or $a cmp $b }
+ keys %cust_main_county
+ ) {
+ my $selected = $country eq $selected_country ? ' SELECTED' : '';
+ $country_html .= "\n$country "
+ }
+ $country_html .= ' ';
+
+ ($county_html, $state_html, $country_html);
+
+}
+
sub success_default { #html to use if you don't specify a success file
<<'END';
Signup successful
Signup successful
Thanks for signing up!
+
+Signup information for <%= $email_name %>:
+
+Username: <%= $username %>
+Password: <%= $password %>
+Access number: (<%= $ac %>) / $exch - $local
+Package: <%= $pkg %>
END
}
-sub signup_default { #html to use if you don't specify a template file
+sub decline_default { #html to use if there is a decline
<<'END';
-ISP Signup form
-ISP Signup form
-<%= $error %>
-
+Processing error
+Processing error
+There has been an error processing your account. Please contact customer
+support.
+
END
}
+