M
M
Mick Coder2015-03-02 19:04:30
Yii
Mick Coder, 2015-03-02 19:04:30

Workstation on Yii2. How to implement the formation and preservation of dynamic information?

Hello! I am making an workstation for a cleaning department manager. I decided to choose the Yii2 framework. To make it clear in general what is at stake, here is the database schema
36342582969d45da9b31269089665997.png
, and the view of the main window with explanations
cc6a6f28e8e34845a17951db1c272398.png
The problem is this - When reserving (settlement) of the client in the specified room, the start date of the reservation and departure is set.
From the start date (for example, 03/02/2015) to the check-out date (for example, 03/20/2015), the room must be cleaned on the day of arrival, departure, and once every 7 days on the day specified by the client (for example, on Tuesday every week).
I did everything except regular cleaning, I don’t know how best to implement regular cleaning.
So far I have 3 options:
1) I need to make some kind of additional table with records for each room reservation;
2) you can also make calculations in the model for each actual booking, but this is the worst option because not flexible.
3) Do the same calculations on the JS client side.
What if the client changes "cleaning day" from Tuesday to Wednesday.
Perhaps there are some tools in Yii2 that will simplify my task, for example, working with Redis, etc.!
Tell junior how to do it better! Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kir ---, 2015-03-03
@lbondodesc

When creating a reserve, create cleaning records with a status such as "planned" on the server.
What's the problem then?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question