dounue1965 2016-12-15 08:56
浏览 15

重复的工作周

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.

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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)