I am working on a web tool where the user can see who works certain dates.
Have a look at this picture of an example schedule.
Let's say that this planned schedule starts Week 1 2017. Monday in week 1 we can read from the table that employee 1 and 2 works 0800-1500 and emplyee 3 and 4 works 1900-2300. Employee 5 and 6 have the day off. Next week they all skip down one line.
We can read that Monday in week 2, employee 1 and 2 works 1900-2300, employee 3 and 4 have the day off, employee 5 and 6 works 0800-1500.
I hope this gives a clear concept of how this table works, cause here comes my question:
How would the best practice be to script this so that the user can look up any date and see who is working. The schedule changes two-three times a year; should this info be saved in a database or maybe a xml-file?
Since the schedule is repeated every third week my thought was to script it so that when the user looks up a certain date, javascript checks how many times the roster has been repeated (as integer) and then uses the modulo to create a "offset". So if employee 1 asks for Monday in week 10 (3x3)+1=10. The +1 is used as the offset to show who is actually working.
I'm quite new to programming/scripting in general, does anybody have any suggestions to what technique to use for this issue?
I plan to use html 5, css, javascript, php and sql.