summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeff <jeff>2010-09-01 20:25:00 +0000
committerjeff <jeff>2010-09-01 20:25:00 +0000
commit60a603adb62f03d90391b16ce5b89242adf9c1d5 (patch)
tree7426e9e0748b91bcef852530054f37c18e96dac1
parentd5cc5b2fbb03670d2082cf2521aa9b9d8760d607 (diff)
warn about multiple states
-rwxr-xr-xhttemplate/search/477partVI_census.html14
1 files changed, 13 insertions, 1 deletions
diff --git a/httemplate/search/477partVI_census.html b/httemplate/search/477partVI_census.html
index 5f3039d..1d625dc 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) {
+ '<BR><B>'.
+ 'WARNING: multiple states found'.
+ '</B><BR>';
+ } 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 = '<H2>Part VI</H2>';
my %search_hash = ();
my @sql_query = ();
+my %state_hash = ();
for ( qw(agentnum magic classnum) ) {
$search_hash{$_} = $cgi->param($_) if $cgi->param($_);