hey,
thank you for your help.
the point is, because only one person will “instal” all the clients, this person can take a new client every 15min,
so we will have one client à 9h00, one à 9h15, 9h30 etc. so maximum 12 clients (inscriptions).
with a table inscriptions, i could easily hide the taken inscriptions, but the point is, if a test is too long, i’ll not have a computer to put the client on it, because i have only 6 computer
you can check this small code i did to test the first part.
<?php $inscriptions = [
'1'=> [
'date' => '05-10-2018',
'start_time'=>'09:00:00',
'end_time'=>'11:45:00',
'state'=>'taken',
],
'2'=> [
'date' => '05-10-2018',
'start_time'=>'09:15:00',
'end_time'=>'00:00:00',
'state'=>'free',
],
'3'=> [
'date' => '05-10-2018',
'start_time'=>'09:30:00',
'end_time'=>'11:00:00',
'state'=>'taken',
],
'4'=> [
'date' => '05-10-2018',
'start_time'=>'09:45:00',
'end_time'=>'00:00:00',
'state'=>'free',
],
'5'=> [
'date' => '05-10-2018',
'start_time'=>'10:00:00',
'end_time'=>'00:00:00',
'state'=>'free',
],
'6'=> [
'date' => '05-10-2018',
'start_time'=>'10:15:00',
'end_time'=>'00:00:00',
'state'=>'free',
],
'11'=> [
'date' => '06-12-2018',
'start_time'=>'09:00:00',
'end_time'=>'11:45:00',
'state'=>'taken',
],
'12'=> [
'date' => '06-12-2018',
'start_time'=>'09:15:00',
'end_time'=>'11:30:00',
'state'=>'taken',
],
'13'=> [
'date' => '06-12-2018',
'start_time'=>'09:30:00',
'end_time'=>'00:00:00',
'state'=>'free',
],
'14'=> [
'date' => '06-12-2018',
'start_time'=>'09:45:00',
'end_time'=>'00:00:00',
'state'=>'free',
],
'15'=> [
'date' => '06-12-2018',
'start_time'=>'10:00:00',
'end_time'=>'11:30:00',
'state'=>'taken',
],
'16'=> [
'date' => '06-12-2018',
'start_time'=>'10:15:00',
'end_time'=>'00:00:00',
'state'=>'free',
],
];
echo '<pre>';
$olddate = '';
foreach ($inscriptions as $inscription) {
# code...
if($inscription['date'] != $oldate){
echo '<div style="width:100%; display:block; padding:5px;padding-top:20px; border-bottom: 1px solid">new date: '.$inscription['date'].'</div>';
$oldate = $inscription['date'];
}
if ($inscription['state']=='free') {
# code...
echo $inscription['start_time'].' | ';
}
}
?>