Changeset 532 for trunk/cgi-bin/IPDB.pm
- Timestamp:
- 10/30/12 16:01:39 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r531 r532 28 28 &addMaster 29 29 &listSummary &listMaster &listRBlock &listFree &listPool 30 &getTypeList 30 &getTypeList &getPoolSelect 31 31 &getParent &getRoutedCity 32 32 &allocateBlock &updateBlock &deleteBlock &getBlockData … … 42 42 &addMaster 43 43 &listSummary &listMaster &listRBlock &listFree &listPool 44 &getTypeList 44 &getTypeList &getPoolSelect 45 45 &getParent &getRoutedCity 46 46 &allocateBlock &updateBlock &deleteBlock &getBlockData … … 497 497 return $tlist; 498 498 } 499 500 501 ## IPDB::getPoolSelect() 502 # Get a list of pools matching the passed city and type that have 1 or more free IPs 503 sub getPoolSelect { 504 my $dbh = shift; 505 my $iptype = shift; 506 my $pcity = shift; 507 508 my ($ptype) = ($iptype =~ /^(.)i$/); 509 return if !$ptype; 510 $ptype .= '_'; 511 512 my $plist = $dbh->selectall_arrayref( 513 "SELECT (SELECT city FROM allocations WHERE cidr=poolips.pool) AS poolcit, ". 514 "poolips.pool AS poolblock, COUNT(*) AS poolfree FROM poolips,allocations ". 515 "WHERE poolips.available='y' AND poolips.pool=allocations.cidr ". 516 "AND allocations.city = ? AND poolips.type LIKE ? ". 517 "GROUP BY pool", { Slice => {} }, ($pcity, $ptype) ); 518 return $plist; 519 } # end getPoolSelect() 499 520 500 521
Note:
See TracChangeset
for help on using the changeset viewer.