summaryrefslogtreecommitdiff
path: root/httemplate/misc/counties.cgi
blob: 940cba7dcc1d6ea6c3f89f73a20a34a2ebce388b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[ <% join(', ', map { qq("$_") } @counties) %> ]
<%init>

my $DEBUG = 0;

my( $state, $country ) = $cgi->param('arg');

warn "fetching counties for $state / $country \n"
  if $DEBUG;

my @counties = 
    sort
    map { s/[\n\r]//g; $_; }
    map { $_->county; }
    qsearch( {
      'select'  => 'DISTINCT county',
      'table'   => 'cust_main_county',
      'hashref' => { 'state'   => $state,
                     'country' => $country,
                   },
    } )
;

warn "counties: ". join(', ', map { qq("$_") } @counties). "\n"
  if $DEBUG;

</%init>