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;
Index: /branches/stable/templates/search/sresults.tmpl
===================================================================
--- /branches/stable/templates/search/sresults.tmpl	(revision 620)
+++ /branches/stable/templates/search/sresults.tmpl	(revision 621)
@@ -17,5 +17,5 @@
 <TMPL_LOOP NAME=sresults>
 <tr class="row<TMPL_VAR NAME=rowclass>">
-<td><TMPL_IF issub>Sub </TMPL_IF><a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?<TMPL_IF avail>action=edit&amp;block=<TMPL_VAR NAME=block><TMPL_ELSE>action=assign&block=<TMPL_VAR NAME=block>&fbtype=i</TMPL_IF>"><TMPL_VAR NAME=block></a><TMPL_IF ispool>&nbsp; <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=listpool&amp;pool=<TMPL_VAR NAME=block>">List IPs</a></TMPL_IF></td>
+<td><TMPL_IF issub>Sub </TMPL_IF><a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?<TMPL_IF avail>action=assign&block=<TMPL_VAR NAME=block>&fbtype=i<TMPL_ELSE>action=edit&amp;block=<TMPL_VAR NAME=block></TMPL_IF>"><TMPL_VAR NAME=block></a><TMPL_IF ispool>&nbsp; <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=listpool&amp;pool=<TMPL_VAR NAME=block>">List IPs</a></TMPL_IF></td>
 <td><TMPL_VAR NAME=custid></td>
 <td><TMPL_VAR NAME=disptype></td>
