diff options
Diffstat (limited to 'httemplate/misc/states.cgi')
-rw-r--r-- | httemplate/misc/states.cgi | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/httemplate/misc/states.cgi b/httemplate/misc/states.cgi new file mode 100644 index 000000000..cff2c9774 --- /dev/null +++ b/httemplate/misc/states.cgi @@ -0,0 +1,16 @@ +<% + + my $country = $cgi->param('arg'); + + my @states = + sort + map { s/[\n\r]//g; $_; } + map { $_->state; } + qsearch( 'cust_main_county', + { 'country' => $country }, + 'DISTINCT ON ( state ) *', + ) + ; + + +%>[ <%= join(', ', map { qq("$_") } @states) %> ] |