Bonjour,

j'ai un bout de code qui va me faire la recherche d'une valeur entrée dans un formulaire, dans un champ d'une base de données. Le nom de ce champs est: "work_field".
Dans ma base de données, je dispose en fait de trois champs similaires : "work_field0", "work_field1" et "work_field2".

Comment puis-je modifier ce code pour que la recherche se fasse dans les 4 champs "work_field", "work_field0", "work_field1" et "work_field2"?

Merci

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
if(GetLookupTable("work_field", $strTableName))
		$pageObject->settingsMap["globalSettings"]['shortTNames'][GetLookupTable("work_field", $strTableName)] = GetTableURL(GetLookupTable("work_field", $strTableName));
 
	$pageObject->fillFieldToolTips("work_field");	
 
	$srchFields = $pageObject->searchClauseObj->getSearchCtrlParams("work_field");
	$firstFieldParams = array();
	if (count($srchFields))
	{
		$firstFieldParams = $srchFields[0];
	}
	else
	{
		$firstFieldParams['fName'] = "work_field";
		$firstFieldParams['eType'] = '';
		$firstFieldParams['value1'] = '';
		$firstFieldParams['opt'] = '';
		$firstFieldParams['value2'] = '';
		$firstFieldParams['not'] = false;
	}
	// create control	
	$ctrlBlockArr = $searchControlBuilder->buildSearchCtrlBlockArr($id, $firstFieldParams['fName'], 0, $firstFieldParams['opt'], $firstFieldParams['not'], false, $firstFieldParams['value1'], $firstFieldParams['value2']);	
 
	if(isEnableSection508())
		$xt->assign_section("work_field_label","<label for=\"".GetInputElementId("work_field", $id)."\">","</label>");
	else 
		$xt->assign("work_field_label", true);
 
	$xt->assign("work_field_fieldblock", true);		
	$xt->assignbyref("work_field_editcontrol", $ctrlBlockArr['searchcontrol']);					
	$xt->assign("work_field_notbox", $ctrlBlockArr['notbox']);		
	// create second control, if need it		
	$xt->assignbyref("work_field_editcontrol1", $ctrlBlockArr['searchcontrol1']);		
	// create search type select
	$xt->assign("searchtype_work_field", $ctrlBlockArr['searchtype']);	
	$isFieldNeedSecCtrl = $searchControlBuilder->isNeedSecondCtrl("work_field");
	$ctrlInd = 0;
	if ($isFieldNeedSecCtrl) 
	{				
		$pageObject->controlsMap["search"]["searchBlocks"][] = array('fName'=>"work_field", 'recId'=>$id, 'ctrlsMap'=>array(0=>$ctrlInd, 1=>($ctrlInd+1)));
		$ctrlInd+=2;
	}
	else
	{	
		$pageObject->controlsMap["search"]["searchBlocks"][] = array('fName'=>"work_field", 'recId'=>$id, 'ctrlsMap'=>array(0=>$ctrlInd));			
		$ctrlInd++;
	}