Automatically filter queries with user information
Posted: 2020-05-27 20:05
Hello all.
I am currently working on an AppGini application but have hit something of a roadblock. I would like to automatically filter the results of a user's query with information that the user provides to the application when they create an account. Users can already filter their search results by this information manually, but for quality of life reasons I would like to make this more automatic.
For example, our business application would work in a number of cities, and we already have tables that contain information for a variety of places, and while some clients need to see information relating to multiple areas, other clients would only need to see the information for one city. For those clients, it would be more convenient for them to automatically filter results by their own city, rather than have to input the filter every time. However, I'm not sure exactly how to implement this. This type of user already has their own group set up, and I understand that in the tablename_init() function you can alter the information displayed before it renders on the page. However the customer's custom user info is part of a SQL table, and is not included in the information provided from getMemberInfo(). Is there a way to access this custom information via PHP, then modify the SQL query with that info in a way that works with the hooks files?
Thank you in advance.
I am currently working on an AppGini application but have hit something of a roadblock. I would like to automatically filter the results of a user's query with information that the user provides to the application when they create an account. Users can already filter their search results by this information manually, but for quality of life reasons I would like to make this more automatic.
For example, our business application would work in a number of cities, and we already have tables that contain information for a variety of places, and while some clients need to see information relating to multiple areas, other clients would only need to see the information for one city. For those clients, it would be more convenient for them to automatically filter results by their own city, rather than have to input the filter every time. However, I'm not sure exactly how to implement this. This type of user already has their own group set up, and I understand that in the tablename_init() function you can alter the information displayed before it renders on the page. However the customer's custom user info is part of a SQL table, and is not included in the information provided from getMemberInfo(). Is there a way to access this custom information via PHP, then modify the SQL query with that info in a way that works with the hooks files?
Thank you in advance.