fix to work against 1.3.x databases, with a warning
[freeside.git] / httemplate / edit / cust_main_county-expand.cgi
1 <%
2 #
3 # $Id: cust_main_county-expand.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $
4 #
5 # ivan@sisd.com 97-dec-16
6 #
7 # Changes to allow page to work at a relative position in server
8 #       bmccane@maxbaud.net     98-apr-3
9 #
10 # lose background, FS::CGI ivan@sisd.com 98-sep-2
11 #
12 # $Log: cust_main_county-expand.cgi,v $
13 # Revision 1.1  2001-07-30 07:36:04  ivan
14 # templates!!!
15 #
16 # Revision 1.6  1999/01/25 12:09:54  ivan
17 # yet more mod_perl stuff
18 #
19 # Revision 1.5  1999/01/19 05:13:35  ivan
20 # for mod_perl: no more top-level my() variables; use vars instead
21 # also the last s/create/new/;
22 #
23 # Revision 1.4  1999/01/18 09:41:25  ivan
24 # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
25 # (good idea anyway)
26 #
27 # Revision 1.3  1998/12/17 06:17:01  ivan
28 # fix double // in relative URLs, s/CGI::Base/CGI/;
29 #
30 # Revision 1.2  1998/11/18 09:01:38  ivan
31 # i18n! i18n!
32 #
33
34 use strict;
35 use vars qw( $cgi $taxnum $cust_main_county $p1 $delim $expansion );
36 use CGI;
37 use CGI::Carp qw(fatalsToBrowser);
38 use FS::UID qw(cgisuidsetup);
39 use FS::Record qw(qsearch qsearchs);
40 use FS::CGI qw(header menubar popurl);
41 use FS::cust_main_county;
42
43 $cgi = new CGI;
44
45 &cgisuidsetup($cgi);
46
47 if ( $cgi->param('error') ) {
48   $taxnum = $cgi->param('taxnum');
49   $delim = $cgi->param('delim');
50   $expansion = $cgi->param('expansion');
51 } else {
52   my ($query) = $cgi->keywords;
53   $query =~ /^(\d+)$/
54     or die "Illegal taxnum!";
55   $taxnum = $1;
56   $delim = 'n';
57   $expansion = '';
58 }
59
60 $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum});
61 die "Can't expand entry!" if $cust_main_county->getfield('county');
62
63 $p1 = popurl(1);
64 print $cgi->header( '-expires' => 'now' ), header("Tax Rate (expand)", menubar(
65   'Main Menu' => popurl(2),
66 ));
67
68 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
69       "</FONT>"
70   if $cgi->param('error');
71
72 print <<END;
73     <FORM ACTION="${p1}process/cust_main_county-expand.cgi" METHOD=POST>
74       <INPUT TYPE="hidden" NAME="taxnum" VALUE="$taxnum">
75       Separate by
76 END
77 print '<INPUT TYPE="radio" NAME="delim" VALUE="n"';
78 print ' CHECKED' if $delim eq 'n';
79 print '>line (rumor has it broken on some browsers) or',
80       '<INPUT TYPE="radio" NAME="delim" VALUE="s"';
81 print ' CHECKED' if $delim eq 's';
82 print '>whitespace.';
83 print <<END;
84       <BR><INPUT TYPE="submit" VALUE="Submit">
85       <BR><TEXTAREA NAME="expansion" ROWS=100>$expansion</TEXTAREA>
86     </FORM>
87     </CENTER>
88   </BODY>
89 </HTML>
90 END
91
92 %>