as shown in the picture, how to check the reservation according to the time on the Internet
as shown in the picture, how to check the reservation according to the time on the Internet
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.
Previous: Vue uses Ali OSS server to sign and upload pictures. What can I do?
Next: Is it feasible to use RabbitMQ to implement peer-to-peer message push?
question: I am using the lightning strike net custom form. In the rich text submitted to the backend, I extract the string of the html tag in the rich text string, and then I want to replace the html tag string in the rich text string with a space (tha...