summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-02-20 23:53:06 -0800
committerMark Wells <mark@freeside.biz>2012-02-20 23:53:06 -0800
commita3f6af253b06d80e3be43b0f954df9c18a93c12d (patch)
tree37ae8928050afc41d867605d738c2e81b3e911cb /httemplate
parent42c5857d4df6eb6108a7d5f79569c9273384a245 (diff)
parentc96f38c9a16df1fe84172e53cf58acd551b1937d (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/search/477partVI_census.html129
1 files changed, 66 insertions, 63 deletions
diff --git a/httemplate/search/477partVI_census.html b/httemplate/search/477partVI_census.html
index 3883a1c0f..be3a9c057 100755
--- a/httemplate/search/477partVI_census.html
+++ b/httemplate/search/477partVI_census.html
@@ -1,64 +1,27 @@
<% include( 'elements/search.html',
- 'html_init' => $html_init,
- 'html_foot' => $html_foot,
- 'name' => 'regions',
- 'query' => [ @sql_query ],
- 'count_query' => $count_query,
- 'order_by' => 'ORDER BY censustract',
- 'avoid_quote' => 1,
- 'no_csv_header' => 1,
- 'nohtmlheader' => 1,
- 'header' => [
- 'County code',
- 'Census tract code',
- 'Upload rate',
- 'Download rate',
- 'Technology code',
- 'Technology code other',
- 'Quantity',
- 'Percentage residential',
- ],
- 'xml_elements' => [
- 'county_fips',
- 'census_tract',
- 'upload_rate_code',
- 'download_rate_code',
- 'technology_code',
- 'technology_code_other',
- 'value',
- 'percentage',
- ],
- 'fields' => [
- sub { my $row = shift;
- 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';
- },
- 'upload',
- 'download',
- 'technology_code',
- 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' => [
- [ $link, $link_suffix ],
- [ $link, $link_suffix ],
- [ $link, $link_suffix ],
- [ $link, $link_suffix ],
- [ $link, $link_suffix ],
- [ $link, $link_suffix ],
- [ $link, $link_suffix ],
- [ $link, $link_suffix ],
- ],
- 'url' => $opt{url} || '',
+ 'html_init' => '<H2>Part VI</H2>',
+ 'html_foot' => $html_foot,
+ 'name' => 'regions',
+ 'query' => [ @sql_query ],
+ 'count_query' => $count_query,
+ 'order_by' => 'ORDER BY censustract',
+ 'avoid_quote' => 1,
+ 'no_csv_header' => 1,
+ 'nohtmlheader' => 1,
+ 'header' => \@header,
+ 'xml_elements' => [
+ 'county_fips',
+ 'census_tract',
+ 'upload_rate_code',
+ 'download_rate_code',
+ 'technology_code',
+ 'technology_code_other',
+ 'value',
+ 'percentage',
+ ],
+ 'fields' => \@fields,
+ 'links' => \@links,
+ 'url' => $opt{url} || '',
'xml_row_element' => 'Datarow',
)
%>
@@ -71,12 +34,52 @@ die "access denied"
my %opt = @_;
-my $html_init = '<H2>Part VI</H2>';
+my %state_hash = ();
+my %state_pkgcount = ();
+
+my @header = ();
+my @fields = ();
+my @links = ();
+my $num = ($cgi->param('offset') =~ /^(\d+)$/) ? $1 : 0;
+unless ( $cgi->param('_type') eq 'xml' ) {
+ push @header, '#';
+ push @fields, sub { ++$num };
+ push @links, '';
+}
+push @header,
+ 'County code',
+ 'Census tract code',
+ 'Upload rate',
+ 'Download rate',
+ 'Technology code',
+ 'Technology code other',
+ 'Quantity',
+ 'Percentage residential',
+;
+push @fields,
+ sub { my $row = shift;
+ 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';
+ },
+ 'upload',
+ 'download',
+ 'technology_code',
+ 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 },
+;
+push @links, ( [ $link, $link_suffix ] x 8 );
my %search_hash = ();
my @sql_query = ();
-my %state_hash = ();
-my %state_pkgcount = ();
for ( qw(agentnum magic) ) {
$search_hash{$_} = $cgi->param($_) if $cgi->param($_);