This topic is locked

Advanced search don´t work

11/23/2010 10:59:03 AM
PHPRunner General questions
A
almeida author

Hi,
The project need to have the table filtered for 2 creteria.
I put the code below in the Before SQL query of list Page:
if (($_SESSION["Nivel"] !="A") and ($_SESSION["Nivel"] !="S"))

{

$strWhereClause = whereAdd('', 'id_empresa = '.$_SESSION["Empresa"].' and id_gerencia = '.$_SESSION["Gerencia"]);

}

else

{

if ($_SESSION["Nivel"] == "S")

{

$strWhereClause = whereAdd('', 'id_empresa = '.$_SESSION["Empresa"]);

}

}
It worked fine, but the advanced search always return all the records.
The search works fine if the filter above is deleted.
What I am doing wrong?
Att,

Almeida

Sergey Kornilov admin 11/23/2010

Asked for additional details off list.