Testing - PHP

Search Arrays

Example #3

Pay Period 14 - Sep 15/24 to Sep 28/24

$array__shifts
Array
(
    [0] => Array
        (
            [date__shift] => 2024-09-20
            [time__start] => 19:00:00
            [time__finish] => 07:00:00
            [hours__shift] => 12
            [house] => RC
        )

    [1] => Array
        (
            [date__shift] => 2024-09-21
            [time__start] => 19:00:00
            [time__finish] => 07:00:00
            [hours__shift] => 12
            [house] => RC
        )

    [2] => Array
        (
            [date__shift] => 2024-09-22
            [time__start] => 19:00:00
            [time__finish] => 07:00:00
            [hours__shift] => 12
            [house] => LH
        )

    [3] => Array
        (
            [date__shift] => 2024-09-27
            [time__start] => 19:00:00
            [time__finish] => 07:00:00
            [hours__shift] => 12
            [house] => RC
        )

    [4] => Array
        (
            [date__shift] => 2024-09-28
            [time__start] => 19:00:00
            [time__finish] => 07:00:00
            [hours__shift] => 12
            [house] => RC
        )

)
$array__shifts__date
Array
(
    [0] => 2024-09-20
    [1] => 2024-09-21
    [2] => 2024-09-22
    [3] => 2024-09-27
    [4] => 2024-09-28
)
$pp_shifts

2024-09-15
2024-09-16
2024-09-17
2024-09-18
2024-09-19
2024-09-20
2024-09-21
2024-09-22
2024-09-23
2024-09-24
2024-09-25
2024-09-26
2024-09-27
2024-09-28

Test #1

2024-09-15 OFF
2024-09-16 OFF
2024-09-17 OFF
2024-09-18 OFF
2024-09-19 OFF
2024-09-20 OFF
2024-09-21 ON
2024-09-22 ON
2024-09-23 OFF
2024-09-24 OFF
2024-09-25 OFF
2024-09-26 OFF
2024-09-27 ON
2024-09-28 ON

Test #2
2024-09-06 OFF
Test #3
2024-09-07 OFF
Test #4
2024-09-06 OFF
Test #5 (works but only partially)

2024-09-15 OFF
2024-09-16 OFF
2024-09-17 OFF
2024-09-18 OFF
2024-09-19 OFF
2024-09-20 ON
2024-09-21 ON
2024-09-22 ON
2024-09-23 OFF
2024-09-24 OFF
2024-09-25 OFF
2024-09-26 OFF
2024-09-27 ON
2024-09-28 ON

Test #6 (fails)
Test #7

Shift date: 2024-09-20
Shift start: 19:00:00

Test #8

2024-09-15 OFF
2024-09-16 OFF
2024-09-17 OFF
2024-09-18 OFF
2024-09-19 OFF
2024-09-20 ON ($x = 0 - 19:00:00 to 07:00:00 at RC)
2024-09-21 ON ($x = 1 - 19:00:00 to 07:00:00 at RC)
2024-09-22 ON ($x = 2 - 19:00:00 to 07:00:00 at LH)
2024-09-23 OFF
2024-09-24 OFF
2024-09-25 OFF
2024-09-26 OFF
2024-09-27 ON ($x = 3 - 19:00:00 to 07:00:00 at RC)
2024-09-28 ON ($x = 4 - 19:00:00 to 07:00:00 at RC)