Only 5 rows to show

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
fciprian
Veteran Member
Posts: 52
Joined: 2020-04-20 10:51

Only 5 rows to show

Post by fciprian » 2020-05-03 08:07

Hello
And thank you again for all your work!

Can anyone help me with this ? I have a table with 100 rows. And i want only last 5 rows to be showen for all groups that i grant access to view. And only the admin to see all rows.
Is that possible?

Thank you verry much!

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: Only 5 rows to show

Post by pbottcher » 2020-05-03 19:16

Hi,

short answer. Yes.

You can do this in the hooks/tablenmame.php --> init function by modifying the options->QueryWhere to your needs.

Also you should add a check to the dv function, if the user would try to call a direct record that he/she is not allowed to.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

fciprian
Veteran Member
Posts: 52
Joined: 2020-04-20 10:51

Re: Only 5 rows to show

Post by fciprian » 2020-05-04 09:58

Hello and thank you for the answer.

I can not see any QueryWhere in hooks/tablenmame.php (tablename is my table)
I need to insert new row?
Please can you guide me? I apriciate.

Thank you

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1160
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Only 5 rows to show

Post by onoehring » 2020-05-04 13:14

Hi,

check out this page: https://bigprof.com/appgini/help/advanc ... ist-object
but, you will not find queywhere there either. You can use the code on the bottom of the page to see all data options available - and there you will see querywhere.
You should check (where pböthcer suggested) for the current user. If that is the admin - fine. If not, just define a querywhere. I would suggest something like adding " 1=1 LIMIT 5" (not tested)

Olaf

Post Reply