I am building an app. for doctors’ offices to track appointments where sometimes there may be multiple locations. The idea here is that if you’re a front desk person at office 1, you only care/need office 1 activity. If you’re an admin, you may want to see all, or the office you’re in that day.
I am trying to create a page level level filter in my top bar to allow for this:
My code structure is such that the top bar is a PHP include file.
What I am having a tough time with is how to pass variables from the PHP include to the page and more importantly and perhaps more challenging, how to trigger an action from something that takes place in the top bar PHP include.
The use case here is a user is working at office 1 and wants to only see office 1 activity. She would select office 1 from the select menu which would trigger a series of already define server connect activities on the page to filter out everything except office 1.
How would you approach triggering the change from the select menu in the PHP include to trigger on page server connect actions? How would you pass the variable to the page?
You might have to post your specifics, as at a very basic level, a variable within a php include seems to be working fine:
Here is the contents of a header file that was created by first creating the header in main.php, and then using the move to include function of Wappler:
Now, if you want to for example, reload a server connect that is in the page, but do so when the select updates, you can manually code the server connect load ( eg. serverconnect.load() ) , as it won’t be available in the picker, OR you also can put your server connects up in the header. Kinda depends on the details you face.
EDIT: I’m also making the assumption that the page you are dealing with is not the head page for the include – if it were, then everything is available, in both directions.