From 3ce7691203a7737406bf2d4442f7fd84b81f847e Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 23 Aug 2006 22:25:39 +0000 Subject: Will things ever be the same again? It's the final masonize --- httemplate/misc/counties.cgi | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'httemplate/misc/counties.cgi') diff --git a/httemplate/misc/counties.cgi b/httemplate/misc/counties.cgi index 80ae616c9..c9eb98500 100644 --- a/httemplate/misc/counties.cgi +++ b/httemplate/misc/counties.cgi @@ -1,17 +1,18 @@ -<% - - my( $state, $country ) = $cgi->param('arg'); - - my @counties = - sort - map { s/[\n\r]//g; $_; } - map { $_->county; } - qsearch( 'cust_main_county', - { 'state' => $state, - 'country' => $country, - }, - ) - ; - - -%>[ <%= join(', ', map { qq("$_") } @counties) %> ] +% +% +% my( $state, $country ) = $cgi->param('arg'); +% +% my @counties = +% sort +% map { s/[\n\r]//g; $_; } +% map { $_->county; } +% qsearch( 'cust_main_county', +% { 'state' => $state, +% 'country' => $country, +% }, +% ) +% ; +% +% +% +[ <% join(', ', map { qq("$_") } @counties) %> ] -- cgit v1.2.1 From 8e95986bf97e83e00b0375dd1517c4bd0afb23e5 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 27 Dec 2006 01:07:28 +0000 Subject: fix county selector --- httemplate/misc/counties.cgi | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'httemplate/misc/counties.cgi') diff --git a/httemplate/misc/counties.cgi b/httemplate/misc/counties.cgi index c9eb98500..940cba7dc 100644 --- a/httemplate/misc/counties.cgi +++ b/httemplate/misc/counties.cgi @@ -1,18 +1,27 @@ -% -% -% my( $state, $country ) = $cgi->param('arg'); -% -% my @counties = -% sort -% map { s/[\n\r]//g; $_; } -% map { $_->county; } -% qsearch( 'cust_main_county', -% { 'state' => $state, -% 'country' => $country, -% }, -% ) -% ; -% -% -% [ <% 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; + + -- cgit v1.2.1 From 3c8870ee619416f126a65c93d5ef7a2f2e24bc96 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 27 Dec 2006 02:37:17 +0000 Subject: Add a (magically appearing and disappearing) label on the county selector. confusing when labeled "state" --- httemplate/misc/counties.cgi | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'httemplate/misc/counties.cgi') diff --git a/httemplate/misc/counties.cgi b/httemplate/misc/counties.cgi index 940cba7dc..c022a27d9 100644 --- a/httemplate/misc/counties.cgi +++ b/httemplate/misc/counties.cgi @@ -1,27 +1,7 @@ [ <% 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; +my @counties = counties($state, $country); -- cgit v1.2.1