Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

phayes0289's avatar

Fire Station Schedule For Given Date

I need to display a list of names of firefighters that are working on a given date AND at a given station. There are TEN fire stations. A user needs to b able to bounce between dates and between stations (1,2,3,4,5,6,7,8,9 and 911) easily. My question is, what is the best way to pass the data and station criteria and draw the data from the database?

I was thinking I want to create two jump menus at the top of the page, one for the date and one for the stations, that would allow the user to quickly change the data they are looking at. When these jump menus are used, they save some type of variable, maybe by cookie, that stays until another use of the jump menu changes it?

What are your thoughts? Cookies or some other type of variable? What is the most efficient and best practice?

0 likes
2 replies
OussamaMater's avatar

If I understood you correctly, something like users preferences?

Well it really depends:

  • do you want the preferences to be stored on one device only? because let's say you used cookies to store the station and date, and whenever the application loads it will check the cookies for these preferences, they will be accessible only via one machine, so if access your application from his phone or another computer, these preferences are lost.
  • If you want it to be consistent you need to use a database for this.
phayes0289's avatar

Well... the values will change often. For instance, one day I may be working at Station #1 and want to see everything associated with it on the given date. There are roughly ten different tasks on different pages associated with each station. But the next day, I may be working at Station #6 and for that day, I would want to see everything specific to that station. On occasion, I may want to see what another station is doing on a different date. The current app built in ColdFusion, stores the station and date as a session variable. That is an expensive way to store it in CF.

I am aware that the cookies or session variables would not be carried over from computer to computer. That is one of the issues that sucks right now in the CF app. So maybe I should store it as a user preference as you suggested? I like that idea. They just may be changed numerous times throughout the day (we work 24-hour shifts). And since the logged-in user would always have that data available, I think it makes sense.

Please or to participate in this conversation.