<div class="modal-dialog">
	<div class="modal-content">
		<div class="modal-header bg-red-sunglo">
			<button type="button" class="close" data-dismiss="modal"></button>
			<h4 class="modal-title font-white"><i class="fa fa-calendar-check-o"></i> 公設預約 - <?php echo e($inst->name); ?></h4>
		</div>
		<div class="modal-body">
			<table class="table table-striped table-bordered table-hover">
				<tbody>
					<tr>
						<td colspan=2>
						<?php
							$todaydate = date('w');
							if($todaydate == 0){
								$todaydate = 7;
							}
							$str = array('0','一','二','三','四','五','六','日'); //日期陣列
							echo '今天星期'.$str[$todaydate].'<br>';
						?>
						</td>
					</tr>
					<?php if($inst_type == "reservation"): ?>
					<tr>
						<td>
							<label>今日 <?php echo e($inst->name); ?> 的開放時段</label><br>
						</td>
						<td>
						<?php
							$today_open_tf = false;
							$today_time_section = explode(",", $inst->time_section);
							$imax = count($today_time_section);
							for($i = 0;$i < $imax;$i++){
								$timeday = explode('=', $today_time_section[$i]);
								$open = explode('#', $today_time_section[$i]);
								if($timeday[0] == $todaydate){
									if($open[1] == 1){
										$open_time = substr($timeday[1],0,-2);
										$inst_time = explode("-", $open_time);
										$inst_hour = explode(":", $inst_time[0]);
										$today = date('H');
										if($inst_hour[0] <= $today){
											echo "<label style='color:gray'>".$open_time."</label><br>";
										}else{
											echo "<label style='color:black'>".$open_time."</label><br>";
										}
										$today_open_tf = true;
									}
								}
							}
							if(!$today_open_tf){
								echo '今日全日不開放！！';
							}
								echo '<br>';
						?>
						</td>
					</tr>
					<tr>
						<td>
							今日已被預約時段
						</td>
						<td>
						<?php foreach($order as $one): ?>
							<label><?php echo e($one->time_section); ?></label><br>
						<?php endforeach; ?>
						</td>
					</tr>
					<?php else: ?>
					<tr>
						<td colspan=2>
							<label>目前 <?php echo e($inst->name); ?> 的使用狀況</label>
						</td>
					</tr>
					<tr>
						<td colspan=2>
							<?php foreach($order as $one): ?>
							<label><?php echo e($one->enter_time); ?> - 有住戶正在使用中</label><br>
							<?php endforeach; ?>
						</td>
					</tr>
					<?php endif; ?>
				</tbody>
			</table>
		</div>
		<div class="modal-footer">
			<button type="button" class="btn default" data-dismiss="modal"><?php echo app('translator')->get('messages.close'); ?></button>
		</div>
	</div>
</div>