Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
Fixed issue where the free slot can be too wide when looking at the future
  • Loading branch information
steven1350 committed Dec 14, 2021
1 parent b755d3a commit 7f3a0e2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion application/views/booking/booking_main.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,14 @@

//If too far in the future (past the roles booking window)
else if($tNow > (mktime(0,0,0, date("n"), date("j")+1)+($role->booking_window*24*60*60)) ){
echo '<td colspan="'. $free_slot_width.'" class="not_avail booking_cell"><div class="table_cell_height">'.date("g:iA",$tNow).'</div></td>';
//If the slot goes past the end of day (possible if building hours for other buildings are longer then current room hours)
while(($tNow + 30*$free_slot_width) >= $tEnd){
$free_slot_width -=1;
}

echo '<td colspan="'. $free_slot_width.'" class="not_avail booking_cell"><div class="table_cell_height">'.date("g:iA",$tNow).'</div></td>';
}

//If there are not enough hours for the day/week to make a booking
else if($limits['day_used'] >= $room->max_daily_hours || $limits['week_remaining'] <= 0){
echo '<td colspan="'. $free_slot_width.'" class="not_avail booking_cell"><div class="table_cell_height">'.date("g:iA",$tNow).'</div></td>';
Expand Down

0 comments on commit 7f3a0e2

Please sign in to comment.