I currently have a webpage (for example 'conveyor') with contains many buttons, when a button is clicked the user fills in the relevant fields on the page (page 2) and saves the record, which then turns the text on the button on 'conveyor' to red, to show the user a record has been entered.
There is also a logout button on 'conveyor' which i want to check whether all the buttons text have changed to red, if not then the shift needs to be saved as not complete until all the buttons text is red. If they have all been changed to red then the shift can be changed to complete.

Everyday when a user logins into this site the buttons on 'conveyor' are not red, until the user enters the records, because when they log in its using todays date to display the buttons, but if the shift was in complete from the previous day i would like it to show that shift of buttons so the rest of them can have records entered against them.

Can anyone help me?

You can set a Session for every record and check it when click logout, you can assign the color code to session.

Member Avatar

OK, this should be done via the DB - you don't really need sessions or anything else from what I can see.

Not knowing how your DB / data is set up, it's difficult to know what's going on.

I'm assuming that you have multiple buttons, each sending you to a different form, which on 'save' / 'sumbit', enters a record to the DB.

When you go back to the main page / dashboard, the colour of the buttons should be determined by the data in the DB. If a record is present for a particular date, the button linked to that record, should show the equivalent colour to 'done', otherwise set to 'not done'. In addition, the 'done' button should be disabled.