Changeset 376


Ignore:
Timestamp:
Jan 10, 2008, 2:19:02 PM (15 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Flag blocks tagged with 'SWIP: Yes' (with a star next to the "yes" in
the allocation listing) when they do not actually have data in the
customers table.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/cgi-bin/main.cgi

    r366 r376  
    401401  $sth->execute();
    402402
     403  # hack hack hack
     404  # set up to flag swip=y records if they don't actually have supporting data in the customers table
     405  my $custsth = $ip_dbh->prepare("select count(*) from customers where custid=?");
     406
    403407  my $count=0;
    404408  while (my @data = $sth->fetchrow_array()) {
     
    409413#    $data[2] =~ s/\s+//g;
    410414
     415    $custsth->execute($data[3]);
     416    my ($ncust) = $custsth->fetchrow_array();
     417
    411418    # Prefix subblocks with "Sub "
    412419    my @row = ( (($data[2] =~ /^.r$/) ? 'Sub ' : '').
    413420        qq(<a href="/ip/cgi-bin/main.cgi?action=edit&block=$data[0]">$data[0]</a>),
    414421        $data[1], $disp_alloctypes{$data[2]}, $data[3],
    415         ($data[4] eq 'y' ? 'Yes' : 'No'), $data[5]);
     422        ($data[4] eq 'y' ? ($ncust == 0 ? 'Yes<small>*</small>' : 'Yes') : 'No'), $data[5]);
    416423    # If the allocation is a pool, allow listing of the IPs in the pool.
    417424    if ($data[2] =~ /^.[pd]$/) {
Note: See TracChangeset for help on using the changeset viewer.