Good day.
There are a lot of manuals for writing event calendars on the web, there are even frameworks, but I want to write a calendar for keeping records of duties with the admin panel.
Differences from event calendars:
There are no events that are tied to time.
There is a direct bundle of people -> date (day), there is no time reference.
And a person can have a different status on this day (for example, he is sick, at work, sent), but only one status (he cannot have 2 status at the same time: sick and sent, for example.)
I'm not sure that my mysql database has the right architecture, if anything, correct me.
The table is called <month>-<year>
(that is, a new table is formed for each month, for example, 11-2014 for the current month).
Screenshot in the application .
Table fields:
ID Name 1 <- Это поля дней месяца, в которых содержатся специфические ключи: Болен (S), Выходной(W), Дежурный (D) 2 3 4 .. 31
The user interface is easy to get by simply querying the desired table and forming an HTML table using PHP. Screenshot in the application .
The problem with the administrative interface when formatting data on attendants.
The selection of the required fields for the future status assignment implemented using the selectable jquery UI library. Screenshot in the application .
The question is: I do not know in what form and how to save the data in the database using ajax.
1) It is better to correct the contents for the selected positions to the desired status (put down the status D in all the selected cells, for example), and then send the ajax with all the cells to the database.
2) Or immediately form a request to the database for the selected cells and send information to the database only for the selected ones, then reload the page to form already actual data?
Well, the general question is how to correctly send data to the database using ajax? (I study jquery for the second day, do not kick much, did not work with javascript before.)
How can I correctly send data to the database from each cell?
Thank!