X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2F477partVI_census.html;h=b6043539a1e7c746643c10f976576bcb6f844a6d;hb=5a492bf6c76aebbbee96544e2a1ed5929b505da5;hp=1d625dcb06a6ba8273e4b424c8bf97af4143ab51;hpb=aaf8baf3662e16e9414de236a39f8801a8c41b01;p=freeside.git
diff --git a/httemplate/search/477partVI_census.html b/httemplate/search/477partVI_census.html
index 1d625dcb0..b6043539a 100755
--- a/httemplate/search/477partVI_census.html
+++ b/httemplate/search/477partVI_census.html
@@ -1,13 +1,6 @@
<% include( 'elements/search.html',
'html_init' => $html_init,
- 'html_foot' => sub { if (scalar(keys %state_hash) > 1) {
- '
'.
- 'WARNING: multiple states found'.
- '
';
- } else {
- '';
- }
- },
+ 'html_foot' => $html_foot,
'name' => 'regions',
'query' => [ @sql_query ],
'count_query' => $count_query,
@@ -37,15 +30,22 @@
],
'fields' => [
sub { my $row = shift;
- $state_hash{substr($row->censustract, 0, 2)} = 1;
- substr($row->censustract, 2, 3)
+ my $state = substr($row->censustract, 0, 2);
+ $state_hash{$state}++;
+ substr($row->censustract, 2, 3) || 'None';
+ },
+ sub { my $row = shift;
+ substr($row->censustract, 5) || 'None';
},
- sub { my $row = shift; substr($row->censustract, 5) },
'upload',
'download',
'technology_code',
- sub { $cgi->param('_type') eq 'xml' ? '0' : '' }, # doesn't really work
- 'quantity',
+ sub { $cgi->param('_type') eq 'xml' ? '0' : '' },#broken
+ 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' => [
@@ -76,10 +76,13 @@ my $html_init = '
'. + ( &FS::Report::FCC_477::statenum2state($_) || 'None' ). + ' | '. + ''. + qq(). + $state_pkgcount{$_}. ' packages in '. + $state_hash{$_}. ' census tracts'. + ' | '. + '