Changeset 455 for trunk/cgi-bin
- Timestamp:
- 07/30/10 15:40:36 (14 years ago)
- Location:
- trunk/cgi-bin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/ipdb.psql
r417 r455 76 76 "pool" cidr DEFAULT '255.255.255.255/32' NOT NULL, 77 77 "ip" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY, 78 "oldcustid" character varying(16) DEFAULT '' NOT NULL,79 78 "city" character varying(30) DEFAULT '' NOT NULL, 80 79 "type" character(2) DEFAULT '' NOT NULL, … … 95 94 CREATE TABLE "allocations" ( 96 95 "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY, 97 "oldcustid" character varying(16) DEFAULT '',98 96 "type" character(2) DEFAULT '', 99 97 "city" character varying(30) DEFAULT '', … … 112 110 GRANT ALL on "allocations" to "ipdb"; 113 111 114 CREATE VIEW "searchme" as SELECT allocations.cidr, allocations.custid, allocations."type", allocations.city, allocations.description, allocations.notes, allocations. oldcustid, allocations.circuitid FROM allocations UNION SELECT poolips.ip, poolips.custid, poolips.type, poolips.city, poolips.description, poolips.notes, poolips.oldcustid, poolips.circuitid FROM poolips;112 CREATE VIEW "searchme" as SELECT allocations.cidr, allocations.custid, allocations."type", allocations.city, allocations.description, allocations.notes, allocations.circuitid FROM allocations UNION SELECT poolips.ip, poolips.custid, poolips.type, poolips.city, poolips.description, poolips.notes, poolips.circuitid FROM poolips; 115 113 116 114 REVOKE ALL on "searchme" from PUBLIC; -
trunk/cgi-bin/main.cgi
r442 r455 997 997 # because I'm lazy, we'll try to make the SELECT's bring out identical)ish) data 998 998 if ($webvar{block} =~ /\/32$/) { 999 $sql = "select ip,custid,type,city,circuitid,description,notes,modifystamp,privdata ,oldcustidfrom poolips where ip='$webvar{block}'";999 $sql = "select ip,custid,type,city,circuitid,description,notes,modifystamp,privdata from poolips where ip='$webvar{block}'"; 1000 1000 } else { 1001 $sql = "select cidr,custid,type,city,circuitid,description,notes,modifystamp,privdata, oldcustid,swip from allocations where cidr='$webvar{block}'"1001 $sql = "select cidr,custid,type,city,circuitid,description,notes,modifystamp,privdata,swip from allocations where cidr='$webvar{block}'" 1002 1002 } 1003 1003 … … 1074 1074 } 1075 1075 ## end node hack 1076 $html =~ s/\$\$OLDCUSTID\$\$/$data[9]/g;1077 1076 $html =~ s/\$\$CITY\$\$/<input type=text name=city value="$data[3]">/g; 1078 1077 $html =~ s/\$\$CIRCID\$\$/<input type="text" name="circid" value="$data[4]" maxlength=64 size=64 class="regular">/g; … … 1092 1091 ## end node hack 1093 1092 $html =~ s/\$\$CUSTID\$\$/$data[1]/g; 1094 $html =~ s/\$\$OLDCUSTID\$\$/$data[9]/g;1095 1093 $html =~ s/\$\$TYPESELECT\$\$/$disp_alloctypes{$data[2]}/g; 1096 1094 $html =~ s/\$\$CITY\$\$/$data[3]/g; -
trunk/cgi-bin/search.cgi
r439 r455 128 128 my $sql = "(select $cols from searchme where". 129 129 " $webvar{custexclude} (custid ilike '%$webvar{custid}%'". 130 " OR $webvar{custexclude} oldcustid ilike '%$webvar{custid}%'))".131 130 " $sqlconcat (select $cols from searchme where $webvar{descexclude} description ilike '%$webvar{desc}%')". 132 131 " $sqlconcat (select $cols from searchme where $webvar{notesexclude} notes ilike '%$webvar{notes}%')"; … … 335 334 # Query for a customer ID. Note that we can't restrict to "numeric-only" 336 335 # as we have non-numeric custIDs in the legacy data. :/ 337 $sql = "select $cols from searchme where custid ilike '%$query%' or oldcustid ilike '%$query%' ordescription like '%$query%'";336 $sql = "select $cols from searchme where custid ilike '%$query%' or description like '%$query%'"; 338 337 my $count = countRows($sql); 339 338 $sql .= " order by cidr limit $RESULTS_PER_PAGE offset $offset";
Note:
See TracChangeset
for help on using the changeset viewer.