I have two types of users, Manager and Store.
The User Manager, when signing in, can only view their registered stores.
Stores can also log in, and can only view their registered customers.
How can I make this user separation?
Ex.
Manager 1, has stores 1,3 and 4.
Manager 2, has stores 2.5 and 6.
Manager 1 will only be able to view stores 1,3 and 4 and consequently customers registered at these stores.
Hi rafaelscouto ,
You will need to add code to the Conditions box to look up the valid Stores for this user and add them to the conditions to create a query like WHERE `store` in (2,5,6)
Bob
If you do not see the images above
https://drive.google.com/file/d/1Lnkxg4LsTQ_VRKReutRVnMDJwGLxsHIn/view?usp=sharing
https://drive.google.com/file/d/1GfPYH9drGJ8vLw4V6eR2qslr5NZVDe5D/view?usp=sharing
https://drive.google.com/file/d/1J4WWkAV-KB-tHcXUeJFKEj0-lx-EhxrU/view?usp=sharing
Hi rafaelscouto,
I'm sorry, I have been ill this week and have not been in the forum for a few days.
The Where condition you have will find records for id_gerente = 383 but I thought you needed to see the records fro several different values of id_gerente in which case you need a IN condition. Please see pages 24-25 of the manual for using conditions like this.
Bob
Hi
I researched but I could not figure out how to make it work.
When I log into the system, Manager 1 should see only the stores linked to it, but that does not work for me.
What I need is for the system to somehow recognize the user who is currently logged on, and only return the stores that are linked to it.
I have no idea how to solve this.
Just a detail to help you.
I have a database as follows:
table_manager with id_manager - primary key
table_store with id_store - primary key
id_manager as foreign key
table_client with id_client - primary key
id_manager as foreign key
id_store as foreign key