beckie
Posts: 16
|
| Posted: 01/15/2005, 8:02 AM |
|
I want to offfer users a search form that allows them to search on a keyword in every table that they're allowed to access, which can vary based on the user / password / groupid combination.
Is there an elegant way to do this?
I'm using CSS in combination with PHP / MySQL.
|
 |
 |
peterr
Posts: 5971
|
| Posted: 01/15/2005, 1:21 PM |
|
The only way that comes to my mind is to create many grids, one for each table, then show them one below another. You can also hide each grid if there are no results or the users shouldn't have access to that table.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
beckie
Posts: 16
|
| Posted: 01/16/2005, 12:40 AM |
|
How can I check if a user has access to a certain table? Isn't the access related to a certain page?
And is it possible to create a page with (grid) objects on the fly? So that - depending on the groupid - objects are dynamically added to a page.
|
 |
 |
peterr
Posts: 5971
|
| Posted: 01/16/2005, 1:58 AM |
|
You would need to create your own table where you store user permissions, then use custom function in Before Show of each grid to hide it. Or maybe you could read MySQL table permissions in PHP and do the same.
Grid with columns has to be defined during design-time, thus you cannot create it on the fly. But if table fields are similar then you could probably define one grid and then replace its SQL/datasource during run-time. But then I don't know how you could display results from multiple tables in one grid.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
beckie
Posts: 16
|
| Posted: 01/22/2005, 2:08 AM |
|
Two more questions regarding peterr's first answer:
[1] How can a certain serach keyword be used in the "WHERE" clause of multiple grids?
[2] How can a certain grid be hidden when there's no hit?
|
 |
 |
peterr
Posts: 5971
|
| Posted: 01/22/2005, 11:51 AM |
|
Re: 1
No different from a single grid. Just configure the same parameter for each of the grids, instead of one.
Re: 2
There is such example in the programming examples section of the documentation.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
peterr
Posts: 5971
|
| Posted: 01/22/2005, 12:13 PM |
|
Here is the link to that example: http://docs.codecharge.com/studio/html/ProgrammingTechn...s/HideGrid.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |