From babf31c14098f2eb79bc464a197eca460d7c4ac0 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 8 Aug 2010 15:45:00 +0000 Subject: [PATCH] Replace the query for the autocomplete used with card, this version is quite faster --- html/fid_card.php | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/html/fid_card.php b/html/fid_card.php index 9de8b902a..4ca8a2e4b 100644 --- a/html/fid_card.php +++ b/html/fid_card.php @@ -98,24 +98,40 @@ if ( $jrn != -1 ) { /* create a filter based on j */ -$sql_str="select f_id, vw_name,quick_code,vw_description ". +/*$sql_str="select f_id, vw_name,quick_code,vw_description ". " from vw_fiche_attr where ". " ( vw_name ilike '%'||$1||'%' or quick_code ilike $2||'%' or vw_description ilike '%'||$3||'%') ". $filter_card; +*/ -$sql=$cn->get_array($sql_str - ,array($_REQUEST['FID'],$_REQUEST['FID'],$_REQUEST['FID'])); +$sql_str="select distinct f_id from fiche join jnt_fic_att_value using (f_id) join attr_value using(jft_id) where ad_id in (9,1,23) and av_text ilike '%'||$1||'%' ".$filter_card; + +$sql=$cn->get_array($sql_str ,array($_REQUEST['FID'])); if (sizeof($sql) != 0 ) { echo "