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
| function stringEtage ($sender, $params)
{
$a=0;
$items=$sender; // Tableau de la string
$var2 =$params; //Nom du Batiment
//REQUÊTE SQL
$this->Query3->close();
$dc = $this->Datasource3->DataSet;
$this->Query3->SQL = "SELECT DISTINCT NOM_ETAGE
FROM ETAGE_PAR_BATIMENT,BATIMENT,LOCAL
WHERE LOCAL.CODE_ETAGE=ETAGE_PAR_BATIMENT.CODE_ETAGE
AND LOCAL.CODE_BAT=BATIMENT.CODE_BAT AND UPPER(NOM_BAT) =UPPER('$var2')";
$this->Query3->open();
$dc->first();
//BOUCLE SUR LES ETAGES
while(!$dc->EOF)
{
$etage=$dc->NOM_ETAGE;
$items['Items'][$a]['Items'][]= array('Caption'=>$etage);
$dc->next();
}
$a=$a+1;
return $items;
} |