Changeset 521
- Timestamp:
- 10/19/12 16:38:06 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/search.cgi
r520 r521 146 146 my $cols = "cidr,custid,type,city,description"; 147 147 148 # hack fix for undefined variables 149 $webvar{custid} = '' if !$webvar{custid}; 150 $webvar{desc} = '' if !$webvar{desc}; 151 $webvar{notes} = '' if !$webvar{notes}; 152 $webvar{custexclude} = '' if !$webvar{custexclude}; 153 $webvar{descexclude} = '' if !$webvar{descexclude}; 154 $webvar{notesexclude} = '' if !$webvar{notesexclude}; 155 148 156 # First chunk of SQL. Filter on custid, description, and notes as necessary. 149 my $sql = "(select $cols from searchme where".150 " $webvar{custexclude} (custid ilike '%$webvar{custid}%'". 151 " $sqlconcat (select $cols from searchme where $webvar{descexclude} description ilike '%$webvar{desc}%')". 152 " $sqlconcat (select $cols from searchme where $webvar{notesexclude} notes ilike '%$webvar{notes}%')";157 my $sql = qq(SELECT $cols FROM searchme\n); 158 $sql .= " WHERE $webvar{custexclude} (custid ~ '$webvar{custid}')\n"; 159 $sql .= " $sqlconcat (select $cols from searchme where $webvar{descexclude} description ~ '$webvar{desc}')\n"; 160 $sql .= " $sqlconcat (select $cols from searchme where $webvar{notesexclude} notes ~ '$webvar{notes}')"; 153 161 154 162 # If we're not supposed to search for all types, search for the selected types.
Note:
See TracChangeset
for help on using the changeset viewer.