D
D
Dmitriy G2019-02-03 17:34:16
Yii
Dmitriy G, 2019-02-03 17:34:16

Busy calendar, free time to write?

Hello, I am developing a system for recording filming, I would like to know how to check a person’s free time for recording, day and time, (an analogy for an appointment with a doctor, a doctor cannot see several people at the same time)
Employees work from 9 o’clock to 18
There is a table - Event where
Datetime_start
Datetime_end
id_journalist
Id_operator
id_driver
id_car
According to the logic, it is necessary to implement:
1) The journalist selects the date and time of shooting the beginning and the end date of the shooting through Datetimepicker; (while the second Calendar should start from the selected date and time in the first calendar)
Question: how to set up the widget like this?
UPD: done
5c5c023e18b76512232705.png
2) Available (free) in this interval are shown to him: -
dropdownlist operators,
- dropdownlist drivers,
- dropdownlist machines,
Question: how should the request look like?
Question: how to take into account the selected interval in a query from calendars?
UPD: done
Option 2: the journalist selects the required Operator and looks where you can sign up through Datetimepicker
Question: how to do this in datetimepickere? widget setup?
Or in the style of public services when making an appointment with a doctor
(Calendar with highlighted free days)
5c541729910f5539950638.png
Question: how to do this?
At the moment, a convenient Datetimepicker widget from Kartik is installed
Question: is it possible to somehow highlight in the widget which days you can sign up for, plus for what time
Unavailable days and times, therefore, would not be active
I googled a lot, but I didn’t find what I need, especially modern and in Yii
Maybe someone saw or implemented similar
Theme is very similar with doctors, booking, etc.
Staff schedule
Work with datetime
Any examples with date and time filtering will be very grateful

SELECT
  operators.id
FROM user operators
  INNER JOIN categoryuser
    ON operators.category_user = categoryuser.id_catuser
WHERE operators.id NOT IN (SELECT
    event.id_operator
  FROM event
  WHERE event.date_start < :end_date
  AND event.date_end > :start_date)

5c5c00b2f0dc8309990889.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
morricone85, 2019-02-03
@morricone85

you already asked this question

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question