Check the reservation on the web page

as shown in the picture, how to check the reservation according to the time on the Internet

May.27,2021

it goes something like this:

there is a reservation table. The fields are as follows: date date, time time point, location position

date     time   location
20180906 09:00    1
20180906 09:00    2
20180906 10:00    2

take out the reservation information to form the following array format:

$result = ['09:00-1', '09:00-2', '10:00-2'];

because your time list and position list are fixed and not easy to change. So you can define an array in advance (of course, if it is not fixed, you can generate the corresponding format according to your business).
one is the array of time points, which is the time point on the left side of your picture:

$times = ['09:00', '10:00', '11:00', '12:00', '13:00'];

one is a position array:

$locations = ['1' => '', '2' => ''];

pseudo code is as follows:

foreach ($times as $time) {
    foreach ($locations as $id => $name) {
        if (in_array($time . '-' . $id, $result)) {
            echo '';
        } else {
            echo '';
        }
    }
    echo '<br/>';
}

above.

Menu