7cf4230e65f616c760978e477acbe60d8f852259
[freeside.git] / fs_signup / FS-SignupClient / cgi / signup.cgi
1 #!/usr/bin/perl -Tw
2 #
3 # $Id: signup.cgi,v 1.18 2002-04-07 00:00:40 ivan Exp $
4
5 use strict;
6 use vars qw( @payby $cgi $locales $packages $pops $init_data $error
7              $last $first $ss $company $address1 $address2 $city $state $county
8              $country $zip $daytime $night $fax $invoicing_list $payby $payinfo
9              $paydate $payname $referral_custnum
10              $pkgpart $username $password $password2 $sec_phrase $popnum
11              $ieak_file $ieak_template $cck_file $cck_template
12              $signup_html $signup_template $success_html $success_template
13              $ac $exch $loc
14              $self_url
15            );
16 use subs qw( print_form print_okay expselect signup_default success_default );
17 use CGI;
18 use CGI::Carp qw(fatalsToBrowser);
19 use Text::Template;
20 use Business::CreditCard;
21 use HTTP::Headers::UserAgent 2.00;
22 use FS::SignupClient 0.03 qw( signup_info new_customer );
23
24 #acceptable payment methods
25 #
26 #@payby = qw( CARD BILL COMP );
27 #@payby = qw( CARD BILL );
28 #@payby = qw( CARD );
29 @payby = qw( CARD PREPAY );
30
31 $ieak_file = '/usr/local/freeside/ieak.template';
32 $cck_file = '/usr/local/freeside/cck.template';
33 $signup_html = '/usr/local/freeside/signup.html';
34 $success_html = '/usr/local/freeside/success.html';
35
36 if ( -e $ieak_file ) {
37   my $ieak_txt = Text::Template::_load_text($ieak_file)
38     or die $Text::Template::ERROR;
39   $ieak_txt =~ /^(.*)$/s; #untaint the template source - it's trusted
40   $ieak_txt = $1;
41   $ieak_template = new Text::Template ( TYPE => 'STRING', SOURCE => $ieak_txt )
42     or die $Text::Template::ERROR;
43 } else {
44   $ieak_template = '';
45 }
46
47 if ( -e $cck_file ) {
48   my $cck_txt = Text::Template::_load_text($cck_file)
49     or die $Text::Template::ERROR;
50   $cck_txt =~ /^(.*)$/s; #untaint the template source - it's trusted
51   $cck_txt = $1;
52   $cck_template = new Text::Template ( TYPE => 'STRING', SOURCE => $cck_txt )
53     or die $Text::Template::ERROR;
54 } else {
55   $cck_template = '';
56 }
57
58 if ( -e $signup_html ) {
59   my $signup_txt = Text::Template::_load_text($signup_html)
60     or die $Text::Template::ERROR;
61   $signup_txt =~ /^(.*)$/s; #untaint the template source - it's trusted
62   $signup_txt = $1;
63   $signup_template = new Text::Template ( TYPE => 'STRING',
64                                           SOURCE => $signup_txt,
65                                           DELIMITERS => [ '<%=', '%>' ]
66                                         )
67     or die $Text::Template::ERROR;
68 } else {
69   $signup_template = new Text::Template ( TYPE => 'STRING',
70                                           SOURCE => &signup_default,
71                                           DELIMITERS => [ '<%=', '%>' ]
72                                         )
73     or die $Text::Template::ERROR;
74 }
75
76 if ( -e $success_html ) {
77   my $success_txt = Text::Template::_load_text($success_html)
78     or die $Text::Template::ERROR;
79   $success_txt =~ /^(.*)$/s; #untaint the template source - it's trusted
80   $success_txt = $1;
81   $success_template = new Text::Template ( TYPE => 'STRING',
82                                            SOURCE => $success_txt,
83                                            DELIMITERS => [ '<%=', '%>' ],
84                                          )
85     or die $Text::Template::ERROR;
86 } else {
87   $success_template = new Text::Template ( TYPE => 'STRING',
88                                            SOURCE => &success_default,
89                                            DELIMITERS => [ '<%=', '%>' ],
90                                          )
91     or die $Text::Template::ERROR;
92 }
93
94 ( $locales, $packages, $pops, $init_data ) = signup_info();
95 @payby = @{$init_data->{'payby'}} if @{$init_data->{'payby'}};
96
97 $cgi = new CGI;
98
99 if ( defined $cgi->param('magic') ) {
100   if ( $cgi->param('magic') eq 'process' ) {
101
102     $cgi->param('state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/
103       or die "Oops, illegal \"state\" param: ". $cgi->param('state');
104     $state = $1;
105     $county = $3 || '';
106     $country = $4;
107
108     $payby = $cgi->param('payby');
109     $payinfo = $cgi->param( $payby. '_payinfo' );
110     $paydate =
111       $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' );
112     $payname = $cgi->param( $payby. '_payname' );
113
114     if ( $invoicing_list = $cgi->param('invoicing_list') ) {
115       $invoicing_list .= ', POST' if $cgi->param('invoicing_list_POST');
116     } else {
117       $invoicing_list = 'POST';
118     }
119
120     $error = '';
121
122     if ( $cgi->param('_password') ne $cgi->param('_password2') ) {
123       $error = "Passwords don't match"; #msgcat
124       $password  = '';
125       $password2 = '';
126     } else {
127       $password2 = $cgi->param('_password2');
128
129       if ( $payby eq 'CARD' && $cgi->param('CARD_type')
130            && cardtype($payinfo) ne $cgi->param('CARD_type') ) {
131         $error = 'Not an '. $cgi->param('CARD_type'). '| - is: |'. cardtype($payinfo). '|'; #msgcat
132       }
133
134       $error ||= new_customer ( {
135         'last'             => $last             = $cgi->param('last'),
136         'first'            => $first            = $cgi->param('first'),
137         'ss'               => $ss               = $cgi->param('ss'),
138         'company'          => $company          = $cgi->param('company'),
139         'address1'         => $address1         = $cgi->param('address1'),
140         'address2'         => $address2         = $cgi->param('address2'),
141         'city'             => $city             = $cgi->param('city'),
142         'county'           => $county,
143         'state'            => $state,
144         'zip'              => $zip              = $cgi->param('zip'),
145         'country'          => $country,
146         'daytime'          => $daytime          = $cgi->param('daytime'),
147         'night'            => $night            = $cgi->param('night'),
148         'fax'              => $fax              = $cgi->param('fax'),
149         'payby'            => $payby,
150         'payinfo'          => $payinfo,
151         'paydate'          => $paydate,
152         'payname'          => $payname,
153         'invoicing_list'   => $invoicing_list,
154         'referral_custnum' => $referral_custnum = $cgi->param('ref'),
155         'pkgpart'          => $pkgpart          = $cgi->param('pkgpart'),
156         'username'         => $username         = $cgi->param('username'),
157         'sec_phrase'       => $sec_phrase       = $cgi->param('sec_phrase'),
158         '_password'        => $password         = $cgi->param('_password'),
159         'popnum'           => $popnum           = $cgi->param('popnum'),
160       } );
161
162     }
163     
164     if ( $error ) {
165       print_form();
166     } else {
167       print_okay();
168     }
169
170   } else {
171     die "unrecognized magic: ". $cgi->param('magic');
172   }
173 } else {
174   $error = '';
175   $last = '';
176   $first = '';
177   $ss = '';
178   $company = '';
179   $address1 = '';
180   $address2 = '';
181   $city = '';
182   $state = '';
183   $county = '';
184   $country = '';
185   $zip = '';
186   $daytime = '';
187   $night = '';
188   $fax = '';
189   $invoicing_list = '';
190   $payby = '';
191   $payinfo = '';
192   $paydate = '';
193   $payname = '';
194   $pkgpart = '';
195   $username = '';
196   $password = '';
197   $password2 = '';
198   $sec_phrase = '';
199   $popnum = '';
200   $referral_custnum = $cgi->param('ref') || '';
201   print_form;
202 }
203
204 sub print_form {
205
206   $cgi->delete('ref');
207   $self_url = $cgi->self_url;
208
209   $error = "Error: $error" if $error;
210
211   print $cgi->header( '-expires' => 'now' ),
212         $signup_template->fill_in();
213
214 }
215
216 sub print_okay {
217   my $user_agent = new HTTP::Headers::UserAgent $ENV{HTTP_USER_AGENT};
218
219   $cgi->param('username') =~ /^(.+)$/
220     or die "fatal: invalid username got past FS::SignupClient::new_customer";
221   my $username = $1;
222   $cgi->param('_password') =~ /^(.+)$/
223     or die "fatal: invalid password got past FS::SignupClient::new_customer";
224   my $password = $1;
225   ( $cgi->param('first'). ' '. $cgi->param('last') ) =~ /^(.*)$/
226     or die "fatal: invalid email_name got past FS::SignupCLient::new_customer";
227   my $email_name = $1;
228
229   my $pop = pop_info($cgi->param('popnum'))
230     or die "fatal: invalid popnum got past FS::SignupClient::new_customer";
231   ( $ac, $exch, $loc ) = ( $pop->{'ac'}, $pop->{'exch'}, $pop->{'loc'} );
232
233   if ( $ieak_template
234        && $user_agent->platform eq 'ia32'
235        && $user_agent->os =~ /^win/
236        && ($user_agent->browser)[0] eq 'IE'
237      )
238   { #send an IEAK config
239     print $cgi->header('application/x-Internet-signup'),
240           $ieak_template->fill_in();
241   } elsif ( $cck_template
242             && $user_agent->platform eq 'ia32'
243             && $user_agent->os =~ /^win/
244             && ($user_agent->browser)[0] eq 'Netscape'
245           )
246   { #send a Netscape config
247     my $cck_data = $cck_template->fill_in();
248     print $cgi->header('application/x-netscape-autoconfigure-dialer-v2'),
249           map {
250             m/(.*)\s+(.*)$/;
251             pack("N", length($1)). $1. pack("N", length($2)). $2;
252           } split(/\n/, $cck_data);
253
254   } else { #send a simple confirmation
255     print $cgi->header( '-expires' => 'now' ),
256           $success_template->fill_in();
257   }
258 }
259
260 sub pop_info {
261   my $popnum = shift;
262   my $pop;
263   foreach $pop ( @{$pops} ) {
264     if ( $pop->{'popnum'} == $popnum ) { return $pop; }
265   }
266   '';
267 }
268
269 #horrible false laziness with FS/FS/svc_acct_pop.pm::popselector
270 sub popselector {
271   my( $popnum, $state ) = @_;
272
273   my %pop = ();
274   push @{ $pop{$_->{state}} }, $_ foreach @$pops;
275
276   my $text = <<END;
277     <SCRIPT>
278     function opt(what,href,text) {
279       var optionName = new Option(text, href, false, false)
280       var length = what.length;
281       what.options[length] = optionName;
282     }
283     
284     function popstate_changed(what) {
285       state = what.options[what.selectedIndex].text;
286       for (var i = what.form.popnum.length;i > 0;i--)
287                 what.form.popnum.options[i] = null;
288       what.form.popnum.options[0] = new Option("", "", false, true);
289 END
290
291   foreach my $popstate ( sort { $a cmp $b } keys %pop ) {
292     $text .= "\nif ( state == \"$popstate\" ) {\n";
293
294     foreach my $pop ( @{$pop{$popstate}}) {
295       my $o_popnum = $pop->{popnum};
296       my $poptext =  $pop->{city}. ', '. $pop->{state}.
297                      ' ('. $pop->{ac}. ')/'. $pop->{exch};
298
299       $text .= "opt(what.form.popnum, \"$o_popnum\", \"$poptext\");\n"
300     }
301     $text .= "}\n";
302   }
303
304   $text .= "}\n</SCRIPT>\n";
305
306   $text .=
307     qq!<SELECT NAME="popstate" SIZE=1 onChange="popstate_changed(this)">!.
308     qq!<OPTION> !;
309   $text .= "<OPTION>$_" foreach sort { $a cmp $b } keys %pop;
310   $text .= '</SELECT>'; #callback? return 3 html pieces?  #'</TD><TD>';
311
312   $text .= qq!<SELECT NAME="popnum" SIZE=1><OPTION> !;
313   foreach my $pop ( @$pops ) {
314     $text .= qq!<OPTION VALUE="!. $pop->{popnum}. '"'.
315              ( ( $popnum && $pop->{popnum} == $popnum ) ? ' SELECTED' : '' ). ">".
316              $pop->{city}. ', '. $pop->{state}.
317                ' ('. $pop->{ac}. ')/'. $pop->{exch};
318   }
319   $text .= '</SELECT>';
320
321   $text;
322 }
323
324 sub expselect {
325   my $prefix = shift;
326   my $date = shift || '';
327   my( $m, $y ) = ( 0, 0 );
328   if ( $date  =~ /^(\d{4})-(\d{2})-\d{2}$/ ) { #PostgreSQL date format
329     ( $m, $y ) = ( $2, $1 );
330   } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
331     ( $m, $y ) = ( $1, $3 );
332   }
333   my $return = qq!<SELECT NAME="$prefix!. qq!_month" SIZE="1">!;
334   for ( 1 .. 12 ) {
335     $return .= "<OPTION";
336     $return .= " SELECTED" if $_ == $m;
337     $return .= ">$_";
338   }
339   $return .= qq!</SELECT>/<SELECT NAME="$prefix!. qq!_year" SIZE="1">!;
340   for ( 2001 .. 2037 ) {
341     $return .= "<OPTION";
342     $return .= " SELECTED" if $_ == $y;
343     $return .= ">$_";
344   }
345   $return .= "</SELECT>";
346
347   $return;
348 }
349
350 sub success_default { #html to use if you don't specify a success file
351   <<'END';
352 <HTML><HEAD><TITLE>Signup successful</TITLE></HEAD>
353 <BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>Signup successful</FONT><BR><BR>
354 Thanks for signing up!
355 </BODY></HTML>
356 END
357 }
358
359 sub signup_default { #html to use if you don't specify a template file
360   <<'END';
361 <HTML><HEAD><TITLE>ISP Signup form</TITLE></HEAD>
362 <BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>ISP Signup form</FONT><BR><BR>
363 <FONT SIZE="+1" COLOR="#ff0000"><%= $error %></FONT>
364 <FORM ACTION="<%= $self_url %>" METHOD=POST>
365 <INPUT TYPE="hidden" NAME="magic" VALUE="process">
366 <INPUT TYPE="hidden" NAME="ref" VALUE="<%= $referral_custnum %>">
367 <INPUT TYPE="hidden" NAME="ss" VALUE="">
368 Contact Information
369 <TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
370 <TR>
371   <TH ALIGN="right"><font color="#ff0000">*</font>Contact name<BR>(last, first)</TH>
372   <TD COLSPAN=5><INPUT TYPE="text" NAME="last" VALUE="<%= $last %>">,
373                 <INPUT TYPE="text" NAME="first" VALUE="<%= $first %>"></TD>
374 </TR>
375 <TR>
376   <TD ALIGN="right">Company</TD>
377   <TD COLSPAN=5><INPUT TYPE="text" NAME="company" SIZE=70 VALUE="<%= $company %>"></TD>
378 </TR>
379 <TR>
380   <TH ALIGN="right"><font color="#ff0000">*</font>Address</TH>
381   <TD COLSPAN=5><INPUT TYPE="text" NAME="address1" SIZE=70 VALUE="<%= $address1 %>"></TD>
382 </TR>
383 <TR>
384   <TD ALIGN="right">&nbsp;</TD>
385   <TD COLSPAN=5><INPUT TYPE="text" NAME="address2" SIZE=70 VALUE="<%= $address2 %>"></TD>
386 </TR>
387 <TR>
388   <TH ALIGN="right"><font color="#ff0000">*</font>City</TH>
389   <TD><INPUT TYPE="text" NAME="city" VALUE="<%= $city %>"></TD>
390   <TH ALIGN="right"><font color="#ff0000">*</font>State/Country</TH>
391   <TD><SELECT NAME="state" SIZE="1">
392
393   <%=
394     foreach ( @{$locales} ) {
395       $OUT .= '<OPTION';
396       $OUT .= ' SELECTED' if ( $state eq $_->{'state'}
397                                && $county eq $_->{'county'}
398                                && $country eq $_->{'country'}
399                              );
400       $OUT .= '>'. $_->{'state'};
401       $OUT .= ' ('. $_->{'county'}. ')' if $_->{'county'};
402       $OUT .= ' / '. $_->{'country'};
403     }
404   %>
405
406   </SELECT></TD>
407   <TH><font color="#ff0000">*</font>Zip</TH>
408   <TD><INPUT TYPE="text" NAME="zip" SIZE=10 VALUE="<%= $zip %>"></TD>
409 </TR>
410 <TR>
411   <TD ALIGN="right">Day Phone</TD>
412   <TD COLSPAN=5><INPUT TYPE="text" NAME="daytime" VALUE="<%= $daytime %>" SIZE=18></TD>
413 </TR>
414 <TR>
415   <TD ALIGN="right">Night Phone</TD>
416   <TD COLSPAN=5><INPUT TYPE="text" NAME="night" VALUE="<%= $night %>" SIZE=18></TD>
417 </TR>
418 <TR>
419   <TD ALIGN="right">Fax</TD>
420   <TD COLSPAN=5><INPUT TYPE="text" NAME="fax" VALUE="<%= $fax %>" SIZE=12></TD>
421 </TR>
422 </TABLE><font color="#ff0000">*</font> required fields<BR>
423 <BR>Billing information<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
424 <TR><TD>
425
426   <%=
427     $OUT .= '<INPUT TYPE="checkbox" NAME="invoicing_list_POST" VALUE="POST"';
428     my @invoicing_list = split(', ', $invoicing_list );
429     $OUT .= ' CHECKED'
430       if ! @invoicing_list || grep { $_ eq 'POST' } @invoicing_list;
431     $OUT .= '>';
432   %>
433
434   Postal mail invoice
435 </TD></TR>
436 <TR><TD>Email invoice <INPUT TYPE="text" NAME="invoicing_list" VALUE="<%= join(', ', grep { $_ ne 'POST' } split(', ', $invoicing_list ) ) %>">
437 </TD></TR>
438 <%= scalar(@payby) > 1 ? '<TR><TD>Billing type</TD></TR>' : '' %>
439 </TABLE>
440 <TABLE BGCOLOR="#c0c0c0" BORDER=1 WIDTH="100%">
441 <TR>
442
443   <%=
444
445     my $cardselect = '<SELECT NAME="CARD_type"><OPTION></OPTION>';
446     my %types = (
447                   'VISA' => 'VISA card',
448                   'MasterCard' => 'MasterCard',
449                   'Discover' => 'Discover card',
450                   'American Express' => 'American Express card',
451                 );
452     foreach ( keys %types ) {
453       $selected = $cgi->param('CARD_type') eq $types{$_} ? 'SELECTED' : '';
454       $cardselect .= qq!<OPTION $selected VALUE="$types{$_}">$_</OPTION>!;
455     }
456     $cardselect .= '</SELECT>';
457   
458     my %payby = (
459       'CARD' => qq!Credit card<BR><font color="#ff0000">*</font>$cardselect<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="" MAXLENGTH=19><BR><font color="#ff0000">*</font>Exp !. expselect("CARD"). qq!<BR><font color="#ff0000">*</font>Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="">!,
460       'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE=""><BR><font color="#ff0000">*</font>Exp !. expselect("BILL", "12-2037"). qq!<BR><font color="#ff0000">*</font>Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="Accounts Payable">!,
461       'COMP' => qq!Complimentary<BR><font color="#ff0000">*</font>Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE=""><BR><font color="#ff0000">*</font>Exp !. expselect("COMP"),
462       'PREPAY' => qq!Prepaid card<BR><font color="#ff0000">*</font><INPUT TYPE="text" NAME="PREPAY_payinfo" VALUE="" MAXLENGTH=80>!,
463     );
464
465     my %paybychecked = (
466       'CARD' => qq!Credit card<BR><font color="#ff0000">*</font>$cardselect<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="$payinfo" MAXLENGTH=19><BR><font color="#ff0000">*</font>Exp !. expselect("CARD", $paydate). qq!<BR><font color="#ff0000">*</font>Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="$payname">!,
467       'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE="$payinfo"><BR><font color="#ff0000">*</font>Exp !. expselect("BILL", $paydate). qq!<BR><font color="#ff0000">*</font>Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="$payname">!,
468       'COMP' => qq!Complimentary<BR><font color="#ff0000">*</font>Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE="$payinfo"><BR><font color="#ff0000">*</font>Exp !. expselect("COMP", $paydate),
469       'PREPAY' => qq!Prepaid card<BR><font color="#ff0000">*</font><INPUT TYPE="text" NAME="PREPAY_payinfo" VALUE="$payinfo" MAXLENGTH=80>!,
470     );
471
472     for (@payby) {
473       if ( scalar(@payby) == 1) {
474         $OUT .= '<TD VALIGN=TOP>'.
475                 qq!<INPUT TYPE="hidden" NAME="payby" VALUE="$_">!.
476                 "$paybychecked{$_}</TD>";
477       } else {
478         $OUT .= qq!<TD VALIGN=TOP><INPUT TYPE="radio" NAME="payby" VALUE="$_"!;
479         if ($payby eq $_) {
480           $OUT .= qq! CHECKED> $paybychecked{$_}</TD>!;
481         } else {
482           $OUT .= qq!> $payby{$_}</TD>!;
483         }
484
485       }
486     }
487   %>
488
489 </TR></TABLE><font color="#ff0000">*</font> required fields for each billing type
490 <BR><BR>First package
491 <TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
492 <TR>
493   <TD COLSPAN=2><SELECT NAME="pkgpart"><OPTION VALUE="">(none)
494
495   <%=
496     foreach my $package ( @{$packages} ) {
497       $OUT .= '<OPTION VALUE="'. $package->{'pkgpart'}. '"';
498       $OUT .= ' SELECTED' if $pkgpart && $package->{'pkgpart'} == $pkgpart;
499       $OUT .= '>'. $package->{'pkg'};
500     }
501   %>
502
503   </SELECT></TD>
504 </TR>
505 <TR>
506   <TD ALIGN="right">Username</TD>
507   <TD><INPUT TYPE="text" NAME="username" VALUE="<%= $username %>"></TD>
508 </TR>
509 <TR>
510   <TD ALIGN="right">Password</TD>
511   <TD><INPUT TYPE="password" NAME="_password" VALUE="<%= $password %>">
512   (blank to generate)</TD>
513 </TR>
514 <TR>
515   <TD ALIGN="right">Re-enter Password</TD>
516   <TD><INPUT TYPE="password" NAME="_password2" VALUE="<%= $password2 %>">
517   </TD>
518 </TR>
519 <%=
520   if ( $init_data->{'security_phrase'} ) {
521     $OUT .= <<ENDOUT;
522 <TR>
523   <TD ALIGN="right">Security Phrase</TD>
524   <TD><INPUT TYPE="text" NAME="sec_phrase" VALUE="$sec_phrase">
525   </TD>
526 </TR>
527 ENDOUT
528   } else {
529     $OUT .= '<INPUT TYPE="hidden" NAME="sec_phrase" VALUE="">';
530   }
531 %>
532 <TR>
533   <TD ALIGN="right">Access number</TD>
534   <TD><%= popselector($popnum) %></TD>
535 </TR>
536 </TABLE>
537 <BR><BR><INPUT TYPE="submit" VALUE="Signup">
538 </FORM></BODY></HTML>
539 END
540 }