Something Have been wanting to do for a while is to allow my users to search for more than one variable at once. So far I have no found an easy way to do this without creating more than one "View" for the users. Even then I can't always anticipate everything.
I have been testing a few ideas using the addwhere function and have something working but I need some help to get it to the next level.
So far I have this,
In the user table there is a field called SQLQuery
When the users logs in I put the field into a system variable called SpecialSearch using the following line in the "After Successful login" event
$_SESSION["SpecialSearch"]=@$data["SQLQuery"];
Then on the View I want to give the users this ablity I added the following in the List Page "Before SQL Query" event
$strSQL = AddWhere($strSQL,"$_SESSION[SpecialSearch]");
So if I put: `State` in ('IN','MI') and `job` = 'New'
in the user.SQLQuery field the system will filter the results as such. It works great, but having to log in and out every time would be a bit of a pain for the users.
My best idea for this so far (that I need help with) is a pop box that the user could enter the SQL in that would then save the SQL to a session variable each time they clicked on the list or a button. I have no idea how to do this (if it is even possible). For example, when they click on the tab for "Location" the box pops up, they enter the where string and click ok, the system then goes to the list page and using addwhere gives the results.
I am also open to other ideas on this. I would rather store the string in variable and not a table as one of the databases I work with is a read only setup.
Thanks for you help and ideas.