Changeset 205


Ignore:
Timestamp:
Oct 27, 2006, 10:10:28 AM (13 years ago)
Author:
Nick Burch
Message:

Include source

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/cgi/get-distant-postcodes.fcgi

    r204 r205  
    7575
    7676        # Then join to find problem ones
    77         my $sql .= "SELECT id, outward || ' ' || inward AS postcode, $pcpart AS pcpart, easting, northing, avg_easting, avg_northing FROM postcodes ";
     77        my $sql .= "SELECT postcodes.id, outward || ' ' || inward AS postcode, $pcpart AS pcpart, easting, northing, avg_easting, avg_northing, source, sources.name AS source_name ";
     78        $sql .= "FROM postcodes ";
    7879        $sql .= "INNER JOIN averages ON ($pcpart = pcpart) ";
     80        $sql .= "INNER JOIN sources ON (postcodes.source = sources.id) ";
    7981        $sql .= "WHERE NOT deleted AND (";
    8082        $sql .= "       abs(avg_easting-easting) > $flag_distance ";
     
    9092        print "Content-type: text/javascript\n\n";
    9193
    92                 print "// id, postcode, match part, easting, northing, avg easting, avg northing\n";
     94                print "// id, postcode, match part, easting, northing, avg easting, avg northing, source id, source\n";
    9395        while(my @row = $sth->fetchrow_array) {
    9496                        # Tidy up avg
     
    9799
    98100                        # Print
    99                         print "addProblem($row[0],'$row[1]','$row[2]', $row[3], $row[4], $avg_e, $avg_n);\n";
     101                        print "addProblem($row[0],'$row[1]','$row[2]', $row[3], $row[4], $avg_e, $avg_n, $row[7], '$row[8]');\n";
    100102        }
    101103    } else {
Note: See TracChangeset for help on using the changeset viewer.