Using JS to write a calendar, how to implement the PHP calendar on the check-in record and MySQL How to store these registration information?
What do I do with the PHP calendar sign in?
Reply content:
Using JS to write a calendar, how to implement the PHP calendar on the check-in record and MySQL How to store these registration information?
What do I do with the PHP calendar sign in?
Well, this, I've met before.
The sign-in table will be very large.
If one months, 30 days, 10 users, then there will be 300 records.
Data interaction, the natural is Ajax.
Another way to store it is to throw it into MongoDB.
Create a check-in table, store the check-in date and other information, and then listen to your calendar every day of the Click event, through the AJAX submission is not OK (use server-side time when saving)
可以用redis来存,每一个月建一个key:value的键值对,比如第一个月就用sign:111:1,分别表示用户id和签到月份,然后value用队列,将每次签到的数据尾插到队列末尾,每次需要显示签到表的时候去查询这个本月的key就可以了。
When initializing the calendar, determine whether the day has been checked in (Calendar day compared to the data in the database), assuming the same day check-in, add class to indicate that has been signed! otherwise continue. What you do when you initialize your calendar, maybe you can post it.