% include( 'elements/search.html',
'html_init' => $html_init,
'html_foot' => sub { if (scalar(keys %state_hash) > 1) {
'
'.
'WARNING: multiple states found'.
'
';
} else {
'';
}
},
'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;
$state_hash{substr($row->censustract, 0, 2)} = 1;
substr($row->censustract, 2, 3)
},
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 { 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} || '',
'xml_row_element' => 'Datarow',
)
%>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
unless $curuser->access_right('List packages');
my %opt = @_;
my $html_init = '