Changeset 169


Ignore:
Timestamp:
Oct 24, 2006, 8:06:02 PM (13 years ago)
Author:
Dominic Hargreaves
Message:

Have the deleted flag take effect.

Location:
trunk/npemap.org.uk/cgi
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/cgi/bad-postcode.fcgi

    r82 r169  
    4949
    5050    # Check that the requested ID exists
    51     my $sth = $dbh->prepare('SELECT id FROM postcodes WHERE id = ?');
     51    my $sth = $dbh->prepare('SELECT id FROM postcodes WHERE id = ? AND NOT deleted');
    5252    unless ($sth->execute($cgi->param('postcode'))) {
    5353        print_err('Database error when checking for the postcode', $returnlink);
     
    5656
    5757    unless ($sth->rows) {
    58         print_err('A postcode with that identifier does not exist.', $returnlink);
     58        print_err('A postcode with that identifier does not exist, or has already been deleted.', $returnlink);
    5959        next REQUEST;
    6060    }
  • trunk/npemap.org.uk/cgi/get-postcodes.fcgi

    r84 r169  
    7373    }
    7474
    75     my $sth = $dbh->prepare("SELECT outward || ' ' || inward AS postcode, easting, northing,id FROM postcodes WHERE easting BETWEEN ? AND ? AND northing BETWEEN ? AND ?");
     75    my $sth = $dbh->prepare("SELECT outward || ' ' || inward AS postcode, easting, northing,id FROM postcodes WHERE easting BETWEEN ? AND ? AND northing BETWEEN ? AND ? AND NOT deleted");
    7676   
    7777    if ($sth->execute($cgi->param('mineasting'), $cgi->param('maxeasting'), $cgi->param('minnorthing'), $cgi->param('maxnorthing'))) {
  • trunk/npemap.org.uk/cgi/submit.fcgi

    r140 r169  
    119119    # corroboration factor; this just catches accidental double-submission
    120120    # really.
    121     $sth = $dbh->prepare('SELECT raw_postcode_outward FROM postcodes WHERE raw_postcode_outward = ? AND raw_postcode_inward = ? AND easting = ? AND northing = ? AND ip = ?');
     121    $sth = $dbh->prepare('SELECT raw_postcode_outward FROM postcodes WHERE raw_postcode_outward = ? AND raw_postcode_inward = ? AND easting = ? AND northing = ? AND ip = ? AND NOT deleted');
    122122    unless ($sth->execute($cgi->param('postcode1'), $cgi->param('postcode2'), $easting, $northing, $ENV{'REMOTE_ADDR'})) {
    123123        print_err('Database error when checking for duplicate data :(', $returnlink);
Note: See TracChangeset for help on using the changeset viewer.