I have to display user schedule with created data,which i am getting as php array like below.
[0] => stdClass Object
(
[id] => 1
[slot_owner] => 2128
[dateFrom] => 2016-01-01 05:00:00
[dateTo] => 2016-01-01 06:00:00
)
[1] => stdClass Object
(
[id] => 2
[slot_owner] => 2129
[dateFrom] => 2016-01-01 06:00:00
[dateTo] => 2016-01-01 07:00:00
)
[2] => stdClass Object
(
[id] => 3
[slot_owner] => 2129
[dateFrom] => 2016-01-01 07:00:00
[dateTo] => 2016-01-01 08:00:00
)
[3] => stdClass Object
(
[id] => 4
[slot_owner] => 2128
[dateFrom] => 2016-01-01 08:00:00
[dateTo] => 2016-01-01 09:00:00
)
[4] => stdClass Object
(
[id] => 5
[slot_owner] => 2128
[dateFrom] => 2016-01-01 09:00:00
[dateTo] => 2016-01-01 10:00:00
)
Here array is just sample and this can be set of date range and hours of the day. My requirement is to show the data in below format in a table.
slot_owner | from date | to date
2128 | 2016-01-01 5:00:00 | 2016-01-01 06:00:00
2129 | 2016-01-01 6:00:00 | 2016-01-01 08:00:00
2128 | 2016-01-01 8:00:00 | 2016-01-01 10:00:00
Kindly provide me some solution. Thanks in advance.
Let me try to explorer my requirement. My client wants to implement a driver schedule. For this i have created a functionality where client can create entries by selecting a driver and start date and end date with start time and end time. Till here everything was fine, but now he is asking to add more drivers between existing date and time slot, i have also done this. My problem is the when i am fetching records from database it is showing all entries, where as it should be clubbed with date, time and driver. e.g. if A driver is assigned for 5AM to 10 AM on some date and other is assigned on same date after 10AM. Similar for all selected date range.