[Vtigercrm-commits] [vtiger-commits] r4356 - /vtigercrm/trunk/modules/Leads/ListView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Mar 21 02:10:33 EST 2006


Author: saraj
Date: Tue Mar 21 00:10:27 2006
New Revision: 4356

Log:
Changes made for advance search added again

Modified:
    vtigercrm/trunk/modules/Leads/ListView.php

Modified: vtigercrm/trunk/modules/Leads/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/ListView.php (original)
+++ vtigercrm/trunk/modules/Leads/ListView.php Tue Mar 21 00:10:27 2006
@@ -71,8 +71,36 @@
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
 {
- 	$where=Search($currentModule);
-
+	if($_REQUEST['searchtype']=='advance')
+	{
+		$adv_string='';
+		if(isset($_REQUEST['search_cnt']))
+		$tot_no_criteria = $_REQUEST['search_cnt'];
+		if($_REQUEST['matchtype'] == 'all')
+			$matchtype = "or";
+		else
+			$matchtype = "and";
+		
+		for($i=0; $i<=$tot_no_criteria; $i++)
+		{
+			if($i == $tot_no_criteria-1)
+			$matchtype= "";
+			
+			$table_colname = 'Fields'.$i;
+			$search_condition = 'Condition'.$i;
+			$search_value = 'Srch_value'.$i;
+
+			$tab_col = str_replace('\'','',stripslashes($_REQUEST[$table_colname]));
+			$srch_cond = str_replace('\'','',stripslashes($_REQUEST[$search_condition]));
+			$srch_val = $_REQUEST[$search_value];
+			$adv_string .= " ".getSearch_criteria($srch_cond,$srch_val,$tab_col)." ".$matchtype;	
+		}
+		$where=$adv_string;
+	}
+	else
+	{
+ 		$where=Search($currentModule);
+	}
 	// we have a query
 	$url_string .="&query=true";
 





More information about the vtigercrm-commits mailing list