summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2011-08-18 01:23:02 +0000
committerivan <ivan>2011-08-18 01:23:02 +0000
commit2f8745267b13bd027109e12e64b3e37fa50edb9d (patch)
tree12259b461feea3e803f754321a54e45b5de147ee
parent150756fc304002a15fee61d622c230494f814ba6 (diff)
multiple state links in FCC report, RT#13922
-rwxr-xr-xhttemplate/search/477partVI_census.html13
1 files changed, 10 insertions, 3 deletions
diff --git a/httemplate/search/477partVI_census.html b/httemplate/search/477partVI_census.html
index fc260bef8..dbaaaab61 100755
--- a/httemplate/search/477partVI_census.html
+++ b/httemplate/search/477partVI_census.html
@@ -30,7 +30,8 @@
],
'fields' => [
sub { my $row = shift;
- $state_hash{substr($row->censustract, 0, 2)}++;
+ my $state = substr($row->censustract, 0, 2);
+ $state_hash{$state}++;
substr($row->censustract, 2, 3) || 'None'
},
sub { my $row = shift;
@@ -40,7 +41,11 @@
'download',
'technology_code',
sub { $cgi->param('_type') eq 'xml' ? '0' : '' },#broken
- 'quantity',
+ sub { my $row = shift;
+ my $state = substr($row->censustract, 0, 2);
+ $state_pkgcount{$state} += $row->quantity;
+ $row->quantity;
+ },
sub { my $row = shift; sprintf "%.2f", $row->residential },
],
'links' => [
@@ -71,6 +76,7 @@ my $html_init = '<H2>Part VI</H2>';
my %search_hash = ();
my @sql_query = ();
my %state_hash = ();
+my %state_pkgcount = ();
for ( qw(agentnum magic) ) {
$search_hash{$_} = $cgi->param($_) if $cgi->param($_);
@@ -154,7 +160,8 @@ my $html_foot = sub {
'</TD>'.
'<TD>'.
qq(<A HREF="${link}censustract2=$_">).
- $state_hash{$_}. ' census tracts</A>'.
+ $state_pkgcount{$_}. ' packages</A> in '.
+ $state_hash{$_}. ' census tracts'.
'</TD>'.
'</TR>';
}