+ function opt(what,href,text) {
+ var optionName = new Option(text, href, false, false)
+ var length = what.length;
+ what.options[length] = optionName;
+ }
+
+ function popstate_changed(what) {
+ state = what.options[what.selectedIndex].text;
+ for (var i = what.form.popnum.length;i > 0;i--)
+ what.form.popnum.options[i] = null;
+ what.form.popnum.options[0] = new Option("", "", false, true);
END
- print qq!Error: $error! if $error;
+ foreach my $popstate ( sort { $a cmp $b } keys %pop ) {
+ $text .= "\nif ( state == \"$popstate\" ) {\n";
+
+ foreach my $pop ( @{$pop{$popstate}}) {
+ my $o_popnum = $pop->{popnum};
+ my $poptext = $pop->{city}. ', '. $pop->{state}.
+ ' ('. $pop->{ac}. ')/'. $pop->{exch};
+
+ $text .= "opt(what.form.popnum, \"$o_popnum\", \"$poptext\");\n"
+ }
+ $text .= "}\n";
+ }
+
+ $text .= "}\n\n";
+
+ $text .=
+ qq!'; #callback? return 3 html pieces? #'';
+
+ $text .= qq!';
+
+ $text;
+}
- print <
+sub expselect {
+ my $prefix = shift;
+ my $date = shift || '';
+ my( $m, $y ) = ( 0, 0 );
+ if ( $date =~ /^(\d{4})-(\d{2})-\d{2}$/ ) { #PostgreSQL date format
+ ( $m, $y ) = ( $2, $1 );
+ } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
+ ( $m, $y ) = ( $1, $3 );
+ }
+ my $return = qq! |
+Email invoice
+ |
+<%= scalar(@payby) > 1 ? 'Billing type |
' : '' %>
+
-END
- my %payby = (
- 'CARD' => qq!Credit card
${r}
${r}Exp !. expselect("CARD"). qq!
${r}Name on card
!,
- 'BILL' => qq!Billing
P.O.
${r}Exp !. expselect("BILL", "12-2037"). qq!
${r}Attention
!,
- 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP"),
- 'PREPAY' => qq!Prepaid card
${r}!,
- );
-
- my %paybychecked = (
- 'CARD' => qq!Credit card
${r}
${r}Exp !. expselect("CARD", $paydate). qq!
${r}Name on card
!,
- 'BILL' => qq!Billing
P.O.
${r}Exp !. expselect("BILL", $paydate). qq!
${r}Attention
!,
- 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP", $paydate),
- 'PREPAY' => qq!Prepaid card
${r}!,
- );
-
- for (@payby) {
- print qq! $paybychecked{$_} | !;
- } else {
- print qq!> $payby{$_}!;
+ <%=
+
+ my $cardselect = '';
+
+ my %payby = (
+ 'CARD' => qq!Credit card
*$cardselect
*Exp !. expselect("CARD"). qq!
*Name on card
!,
+ 'BILL' => qq!Billing
P.O.
*Exp !. expselect("BILL", "12-2037"). qq!
*Attention
!,
+ 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP"),
+ 'PREPAY' => qq!Prepaid card
*!,
+ );
+
+ my %paybychecked = (
+ 'CARD' => qq!Credit card
*$cardselect
*Exp !. expselect("CARD", $paydate). qq!
*Name on card
!,
+ 'BILL' => qq!Billing
P.O.
*Exp !. expselect("BILL", $paydate). qq!
*Attention
!,
+ 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP", $paydate),
+ 'PREPAY' => qq!Prepaid card
*!,
+ );
+
+ for (@payby) {
+ if ( scalar(@payby) == 1) {
+ $OUT .= ''.
+ qq!!.
+ "$paybychecked{$_} | ";
+ } else {
+ $OUT .= qq! $paybychecked{$_} | !;
+ } else {
+ $OUT .= qq!> $payby{$_}!;
+ }
+
+ }
+ }
+ %>
- print <
$r required fields for each billing type
+* required fields for each billing type
First package
|
Username |
- |
+ |
Password |
-
- (blank to generate) |
+ |
- POP |
- |
+ Re-enter Password |
+ |
+<%=
+ if ( $init_data->{'security_phrase'} ) {
+ $OUT .= <
+ Security Phrase |
+
+ |
+
+ENDOUT
+ } else {
+ $OUT .= '';
+ }
+%>
+<%=
+ if ( scalar(@$pops) ) {
+ $OUT .= 'Access number | '.
+ popselector($popnum). ' |
';
+ } else {
+ $OUT .= popselector($popnum);
+ }
+%>
END
-
-}
-
-sub print_okay {
- my $user_agent = new HTTP::Headers::UserAgent $ENV{HTTP_USER_AGENT};
- if ( $ieak_template
- && $user_agent->platform eq 'ia32'
- && $user_agent->os =~ /^win/
- && ($user_agent->browser)[0] eq 'IE'
- )
- { #send an IEAK config
- my $username = $cgi->param('username');
- my $password = $cgi->param('_password');
- my $email_name = $cgi->param('first'). ' '. $cgi->param('last');
-
- print $cgi->header('application/x-Internet-signup'),
- $ieak_template->fill_in();
-
-# my $ins_file = rand(4294967296). ".ins";
-# open(INS_FILE, ">$ieak_docroot/$ins_file");
-# print INS_FILE <redirect("$ieak_docroot/$ins_file");
-
- } else { #send a simple confirmation
- print $cgi->header( '-expires' => 'now' ), <Signup successful
-Signup successful
-blah blah blah
-
-