';
foreach($resources[$room->room_id]->result() as $resource){
echo '
'.$resource->name . '';
@@ -144,7 +160,7 @@
$numSlots = ceil(((($hours['max'] - $hours['min']) * 24) * 60) / 30) + 1;
//Output the placeholder
- echo '
Closed | ';
+ echo '
Closed | ';
$tStart = mktime(0,0,0, $date_raw['month'], $date_raw['day'], $date_raw['year']) + (($hours['min'] * 24) * 60 * 60); //Start the "closed" slot at the earliest time
}
@@ -153,7 +169,7 @@
$numSlots = ceil(((($hours[$room->external_id]->STARTTIME - $hours['min']) * 24) * 60) / 30);
//Output the placeholder
- echo '
Closed | ';
+ echo '
Closed | ';
//Adjust the starting time to be offset
$tStart = mktime(0,0,0,$date_raw['month'], $date_raw['day'], $date_raw['year']) + (($hours[$room->external_id]->STARTTIME * 24) * 60 * 60);
@@ -176,10 +192,12 @@
if(strtotime($block_booking['start']) < $tStart){
$block_booking['start'] = date('Y-m-d H:i:s', $tStart);
}
-
+
//Since we bumped the start time forward, make sure it didn't pass the end time. If it did, ignore the block booking (since the booking started/ended during closed hours)
if($block_booking['end'] > $block_booking['start']){
+
if(array_key_exists($room->room_id, $block_booking['room']) && strtotime($block_booking['start']) == $tNow){
+
$bbStart = strtotime($block_booking['start']);
$bbEnd = strtotime($block_booking['end']);
@@ -199,7 +217,7 @@
$end_row = true;
}
- echo '
'.$block_booking['reason'].' | ';
+ echo '
'.$block_booking['reason'].' | ';
break;
}
@@ -219,11 +237,14 @@
$booker_name = $bookings[$room->room_id][$tNow]->booker_name;
//If this is your booking, or you are admin, show who booked it
- if($booker_username == $this->session->userdata('username') || $this->session->userdata('super_admin') == TRUE){
- echo '
'.$booker_name.' | ';
+ if($booker_username == $this->session->userdata('username') ){
+ echo '
'.$booker_name.' | ';
+ }
+ else if($this->session->userdata('super_admin') == TRUE){
+ echo '
'.$booker_name.' | ';
}
else{
- echo '
Booked | ';
+ echo '
Booked | ';
}
$tNow += 60 * $diff ; //Add "diff" minutes
@@ -237,10 +258,10 @@
//Check to see if the date is in the past, or too far in the future
if(time() > $tNow){
- echo '
'.date("g:iA",$tNow).' | ';
+ echo '
'.date("g:iA",$tNow).' | ';
}
else{
- echo '
'.date("g:iA",$tNow).' | ';
+ echo '
| ';
}
$tNow += 60 * 30; //Add 30 minutes
@@ -254,7 +275,7 @@
$numSlots = ceil(((($hours['max'] - $hours[$room->external_id]->ENDTIME) * 24) * 60) / 30);
//Output the placeholder
- echo '
Closed | ';
+ echo '
Closed | ';
}
echo '