[freeside-commits] freeside/httemplate/search 477partVI_census.html, 1.1.2.3, 1.1.2.4

Jeff Finucane,420,, jeff at wavetail.420.am
Wed Sep 1 13:25:10 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv10429

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	477partVI_census.html 
Log Message:
warn about multiple states

Index: 477partVI_census.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/477partVI_census.html,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -w -d -r1.1.2.3 -r1.1.2.4
--- 477partVI_census.html	25 Aug 2010 16:04:54 -0000	1.1.2.3
+++ 477partVI_census.html	1 Sep 2010 20:25:08 -0000	1.1.2.4
@@ -1,5 +1,13 @@
 <% include( 'elements/search.html',
                   'html_init'     => $html_init,
+                  'html_foot'     => sub { if (scalar(keys %state_hash) > 1) {
+                                             '<BR><B>'.
+                                               'WARNING: multiple states found'.
+                                             '</B><BR>';
+                                           } else { 
+                                             '';
+                                           }
+                                         },
                   'name'          => 'regions',
                   'query'         => [ @sql_query ],
                   'count_query'   =>  $count_query,
@@ -28,7 +36,10 @@
                                        'percentage',
                                      ],
                   'fields'        => [
-                    sub { my $row = shift; substr($row->censustract, 2, 3) },
+                    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',
@@ -64,6 +75,7 @@
 
 my %search_hash = ();
 my @sql_query = ();
+my %state_hash = ();
   
 for ( qw(agentnum magic classnum) ) {
   $search_hash{$_} = $cgi->param($_) if $cgi->param($_);



More information about the freeside-commits mailing list