X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2F477partVI_census.html;h=dbaaaab611db8372d33486c366cad5b849b2d5ca;hb=ab3fff6ecf4d614e73f8f9d6a2c12511db8de371;hp=53b6db0629d013dc583a360a94a7e271e077f507;hpb=67cc29cf8d4ce046599a857437b6b3c105820e08;p=freeside.git diff --git a/httemplate/search/477partVI_census.html b/httemplate/search/477partVI_census.html index 53b6db062..dbaaaab61 100755 --- a/httemplate/search/477partVI_census.html +++ b/httemplate/search/477partVI_census.html @@ -30,17 +30,22 @@ ], 'fields' => [ sub { my $row = shift; - $state_hash{substr($row->censustract, 0, 2)}++; - substr($row->censustract, 2, 3) || 'none' + 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' + substr($row->censustract, 5) || 'None' }, 'upload', '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 = '

Part VI

'; my %search_hash = (); my @sql_query = (); my %state_hash = (); +my %state_pkgcount = (); for ( qw(agentnum magic) ) { $search_hash{$_} = $cgi->param($_) if $cgi->param($_); @@ -149,9 +155,14 @@ my $html_foot = sub { '
WARNING: multiple states found
'. ''. #nicer formatting someday join('', map { ''. - "". - qq('. + ''. + ''. ''; } keys %state_hash
$_). - $state_hash{$_}. ''. + ( &FS::Report::FCC_477::statenum2state($_) || 'None' ). + ''. + qq(). + $state_pkgcount{$_}. ' packages in '. + $state_hash{$_}. ' census tracts'. + '