Ok,,, Great I ended up with this....
SELECT sb_time_slots.slot_start_time, sb_bookings.booking_date, sb_bookings.start_time
FROM sb_time_slots LEFT JOIN sb_bookings ON sb_time_slots.slot_start_time = TIME(start_time)
AND DATE(booking_date) = '$SelectedDate' WHERE booking_start IS NULL
and ultimately ending up with,,,,
<div class="col-lg-3">
<select type="text" class="form-control m-t-5" name="available_time" id="available_time" required="">
<?php
$SQL_AvailableTime = mysqli_query($conn, "SELECT sb_time_slots.slot_start_time, sb_bookings.booking_date, sb_bookings.start_time FROM sb_time_slots LEFT JOIN sb_bookings ON sb_time_slots.slot_start_time = TIME(start_time) AND DATE(booking_date) = '$SelectedDate' WHERE booking_start IS NULL");
while ($row = mysqli_fetch_array($SQL_AvailableTime)) {
echo("<option value='" . $row['slot_start_time'] . "'>" . $row['slot_start_time'] . "</option>");
}
?>
<label for="dropdown">Select</label>
</select>
</div><!-- col -->
and it works great, however i was wondering how can this work between the 2 or more branches when we decide to open another store? Specifically when updating hours of operation and say changing the booking slot duration from 1 hour to 45min for instance.
is there an alternate way to do this for when one of our branches decides to change booking slot times.
<div class="col-lg-4">
<?php
$start = "08:00:00";
$end = "17:00:00";
$tStart = strtotime($start);
$tEnd = strtotime($end);
$tNow = $tStart;
?>
<select class="form-control m-t-5" name="booking_start" required="">
<option value="">Select Time</option>
<?php
while($tNow <= $tEnd){ ?>
<option value="<?php echo date("H:i:s",$tNow); ?>"> <?php echo date("H:i:s",$tNow);?></option>
<?php
$tNow = strtotime('+60 minutes',$tNow);
}
?>
</select>
</div>
is there any way to dynamically update the hours of operation and the time slot duration without the use of a second table while achieving the required results