[Vtigercrm-commits] [vtiger-commits] r4319 - /vtigercrm/trunk/include/utils/SearchUtils.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon Mar 20 04:05:42 EST 2006
Author: saraj
Date: Mon Mar 20 02:05:37 2006
New Revision: 4319
Log:
changes made for advance search
Modified:
vtigercrm/trunk/include/utils/SearchUtils.php
Modified: vtigercrm/trunk/include/utils/SearchUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/SearchUtils.php (original)
+++ vtigercrm/trunk/include/utils/SearchUtils.php Mon Mar 20 02:05:37 2006
@@ -365,9 +365,37 @@
$CRIT_OPT = "<option value=\'cts\'>Contains</option><option value=\'dcts\'>does not Contains</option><option value=\'is\'>is</option><option value=\'isn\'>is not</option><option value=\'bwt\'>Begins With</option><option value=\'ewt\'>Ends With</option>";
return $CRIT_OPT;
}
-function getSearch_criteria()
-{
- $condition_array = Array(''=>'',''=>'',''=>'',''=>'',''=>'',''=>'');
+function getSearch_criteria($criteria,$searchstring,$searchfield)
+{
+ $where_string = '';
+ switch($criteria)
+ {
+ case 'cts':
+ $where_string = $searchfield." like '%".$searchstring."%' ";
+ break;
+
+ case 'dcts':
+ $where_string = $searchfield." not like '%".$searchstring."%' ";
+ break;
+
+ case 'is':
+ $where_string = $searchfield." = '".$searchstring."' ";
+ break;
+
+ case 'isn':
+ $where_string = $searchfield." <> '".$searchstring."' ";
+ break;
+
+ case 'bwt':
+ $where_string = $searchfield." like '".$searchstring."%' ";
+ break;
+
+ case 'ewt':
+ $where_string = $searchfield." like '%".$searchstring."' ";
+ break;
+
+ }
+ return $where_string;
}
?>
More information about the vtigercrm-commits
mailing list