Changeset 560


Ignore:
Timestamp:
12/19/12 16:03:38 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Work in progress, see #5:
Update listSummary() for new table logic and fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r559 r560  
    341341
    342342  foreach (@{$mlist}) {
    343     my ($rcnt) = $dbh->selectrow_array("SELECT count(*) FROM routed WHERE cidr <<= ?", undef, ($$_{master}));
     343    my ($rcnt) = $dbh->selectrow_array("SELECT count(*) FROM allocations WHERE cidr <<= ? AND type='rm'",
     344        undef, ($$_{master}));
    344345    $$_{routed} = $rcnt;
    345     my ($acnt) = $dbh->selectrow_array("SELECT count(*) FROM allocations WHERE cidr <<= ?", undef, ($$_{master}));
     346    my ($acnt) = $dbh->selectrow_array("SELECT count(*) FROM allocations WHERE cidr <<= ? AND NOT type='rm'",
     347        undef, ($$_{master}));
    346348    $$_{allocated} = $acnt;
    347     my ($fcnt) = $dbh->selectrow_array("SELECT count(*) FROM freeblocks WHERE cidr <<= ?".
    348         " AND (routed='y' OR routed='n')", undef, ($$_{master}));
     349    my ($fcnt) = $dbh->selectrow_array("SELECT count(*) FROM freeblocks WHERE cidr <<= ?",
     350        undef, ($$_{master}));
    349351    $$_{free} = $fcnt;
    350     my ($bigfree) = $dbh->selectrow_array("SELECT maskbits FROM freeblocks WHERE cidr <<= ?".
    351         " AND (routed='y' OR routed='n') ORDER BY maskbits LIMIT 1", undef, ($$_{master}));
     352    my ($bigfree) = $dbh->selectrow_array("SELECT masklen(cidr) AS maskbits FROM freeblocks WHERE cidr <<= ?".
     353        " AND parent = ? ORDER BY masklen(cidr) LIMIT 1", undef, ($$_{master}, $$_{master}));
    352354##fixme:  should find a way to do this without having to HTMLize the <>
    353355    $bigfree = "/$bigfree" if $bigfree;
Note: See TracChangeset for help on using the changeset viewer.