fix county selector
[freeside.git] / httemplate / misc / counties.cgi
1 [ <% join(', ', map { qq("$_") } @counties) %> ]
2 <%init>
3
4 my $DEBUG = 0;
5
6 my( $state, $country ) = $cgi->param('arg');
7
8 warn "fetching counties for $state / $country \n"
9   if $DEBUG;
10
11 my @counties = 
12     sort
13     map { s/[\n\r]//g; $_; }
14     map { $_->county; }
15     qsearch( {
16       'select'  => 'DISTINCT county',
17       'table'   => 'cust_main_county',
18       'hashref' => { 'state'   => $state,
19                      'country' => $country,
20                    },
21     } )
22 ;
23
24 warn "counties: ". join(', ', map { qq("$_") } @counties). "\n"
25   if $DEBUG;
26
27 </%init>