From cf31f199baa6e7d5cb9508ffbadd98360e2f2d66 Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 1 Sep 2010 20:25:08 +0000 Subject: [PATCH] warn about multiple states --- httemplate/search/477partVI_census.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/httemplate/search/477partVI_census.html b/httemplate/search/477partVI_census.html index 5f3039d1a..1d625dcb0 100755 --- a/httemplate/search/477partVI_census.html +++ b/httemplate/search/477partVI_census.html @@ -1,5 +1,13 @@ <% include( 'elements/search.html', 'html_init' => $html_init, + 'html_foot' => sub { if (scalar(keys %state_hash) > 1) { + '
'. + 'WARNING: multiple states found'. + '
'; + } else { + ''; + } + }, 'name' => 'regions', 'query' => [ @sql_query ], 'count_query' => $count_query, @@ -28,7 +36,10 @@ 'percentage', ], 'fields' => [ - sub { my $row = shift; substr($row->censustract, 2, 3) }, + sub { my $row = shift; + $state_hash{substr($row->censustract, 0, 2)} = 1; + substr($row->censustract, 2, 3) + }, sub { my $row = shift; substr($row->censustract, 5) }, 'upload', 'download', @@ -64,6 +75,7 @@ my $html_init = '

Part VI

'; my %search_hash = (); my @sql_query = (); +my %state_hash = (); for ( qw(agentnum magic classnum) ) { $search_hash{$_} = $cgi->param($_) if $cgi->param($_); -- 2.11.0