Index: branches/stable/cgi-bin/ipdb.psql
===================================================================
--- branches/stable/cgi-bin/ipdb.psql	(revision 620)
+++ branches/stable/cgi-bin/ipdb.psql	(revision 621)
@@ -73,5 +73,5 @@
 );
 
-CREATE VIEW "searchme" as SELECT allocations.cidr, allocations.custid, allocations."type", allocations.city, allocations.description, allocations.notes, allocations.circuitid, allocations.vrf FROM allocations UNION SELECT poolips.ip, poolips.custid, poolips.type, poolips.city, poolips.description, poolips.notes, poolips.circuitid, poolips.vrf FROM poolips;
+CREATE VIEW "searchme" as SELECT allocations.cidr, allocations.custid, allocations."type", allocations.city, allocations.description, allocations.notes, allocations.circuitid, allocations.vrf, 'n' AS available FROM allocations UNION SELECT poolips.ip, poolips.custid, poolips.type, poolips.city, poolips.description, poolips.notes, poolips.circuitid, poolips.vrf, poolips.available FROM poolips;
 
 CREATE TABLE "alloctypes" (
Index: branches/stable/cgi-bin/search.cgi
===================================================================
--- branches/stable/cgi-bin/search.cgi	(revision 620)
+++ branches/stable/cgi-bin/search.cgi	(revision 621)
@@ -148,5 +148,5 @@
   # Columns actually returned.  Slightly better than hardcoding it
   # in each (sub)select
-  my $cols = "cidr,custid,type,city,description,vrf";
+  my $cols = "cidr,custid,type,city,description,vrf,available";
 
   # hack fix for undefined variables
@@ -351,5 +351,5 @@
 #    which probably shouldn't be for reasons of sanity.
 
-  my $cols = "cidr,custid,type,city,description,vrf";
+  my $cols = "cidr,custid,type,city,description,vrf,available";
 
   if ($category eq 'all') {
@@ -478,5 +478,5 @@
 	desc => $desc,
 	vrf => $vrf,
-	avail => $avail eq 'y',
+	avail => ($avail eq 'y' ? 1 : 0),
 	);
     push @sresults, \%row;
