							<div class="table-toolbar">
							<div class="row">
								<div class="col-md-12">
									<a href="javascript:;" data-notice="BA" data-filter="week" class="btn purple pull-right btn_filter" style="margin-left:10px;">最近一週</a>
                                    <a href="javascript:;" data-notice="BA" data-filter="today" class="btn purple pull-right btn_filter" style="margin-left:10px;">本日</a>
									<a href="javascript:;" data-notice="BA" data-filter="0" class="btn green pull-right btn_filter" style="margin-left:10px;">正常</a>
									<a href="javascript:;" data-notice="BA" data-filter="1" class="btn red pull-right btn_filter" style="margin-left:10px;">待處理</a>
									<a href="javascript:;" data-notice="BA" data-filter="2" class="btn blue pull-right btn_filter" style="margin-left:10px;">處理中</a>
									<a href="javascript:;" data-notice="BA" data-filter="3" class="btn yellow pull-right btn_filter" style="margin-left:10px;">已處理</a>
								</div>
								<div class="col-md-12" style="margin-top: 20px;">
                                    <?php foreach($categories as $category): ?>
                                        <a href="javascript:;" data-category="<?php echo e($category->name); ?>" class="btn blue pull-right btn_filter_category" style="margin-left:10px;"><?php echo e($category->name); ?></a>
                                    <?php endforeach; ?>
								</div>
                                <div class="col-md-12" style="margin-top: 20px;">
                                    <a href="javascript:;" class="btn red pull-right" style="margin-left:10px;" onclick="ba_all_update();">全部變更</a>
                                    <select id="baAllUpdate" class="form-control pull-right" style="display: inline-block;width: 200px;">
                                        <option value="0">未選擇</option>
                                        <option value="1">待處理 to 處理中</option>
                                        <option value="2">處理中 to 已處理</option>
                                    </select>
								</div>
							</div>
						</div>
						<table id="table_ba" class="table table-striped table-bordered table-hover data_table">
							<thead>
							<tr>
								<th >
									 發布日期
								</th>
								<th >
									 設備種類
								</th>
								<th >
									 設備名稱
								</th>
								<th >
									 值
								</th>
								<th >
									 棟別
								</th>
								<th >
									 樓層
								</th>
								<th >
									 位置
								</th>
								<th >
									 狀況
								</th>
								<th>
									 狀態
								</th>
								<th>
									 動作
								</th>
							</tr>
							</thead>
							<tbody>
							<?php foreach($records as $record): ?>
							<?php $data=explode(",", $record->place)?>
							<tr class="odd gradeX">
								<td>
									<?php echo e($record->trigger_time); ?>

								</td>
								<td>
									<?php echo e($record->category_name); ?>

								</td>
								<td>
									<?php echo e($record->sensor_name); ?>

								</td>
								<td>
									<?php echo e($record->value); ?>

								</td>
								<td>
									<?php echo e($data[0]); ?>

								</td>
								<td >
									<?php echo e($data[1]); ?>

								</td>
								<td >
									<?php echo e($data[2]); ?>

								</td>
								<td >
									<?php if($record->error == '0'): ?>
									<span class="label label-sm label-success"> 正常 </span>
									<?php elseif($record->error == '1'): ?>
									<span class="label label-sm label-danger"> 不正常 </span>
									<?php endif; ?>
								</td>
								<td>
									<?php if($record->status == '0'): ?>
									<span class="label label-sm label-success"> 正常 </span>
									<?php elseif($record->status == '1'): ?>
									<span class="label label-sm label-danger"> 待處理 </span>
									<?php elseif($record->status == '2'): ?>
									<span class="label label-sm label-warning"> 處理中 </span>
									<?php elseif($record->status == '3'): ?>
									<span class="label label-sm label-default"> 已處理 </span>
									<?php endif; ?>
								</td>
								<td>
										<div class="btn-group pull-right" style="margin-right: 15px;">
                                            <a class="btn red dropdown-toggle pull-right" data-toggle="dropdown" href="javascript:;"> 動作
                                                <i class="fa fa-angle-down"></i>
                                            </a>
											<ul class="dropdown-menu">
												<?php if($record->status == '0'): ?>
	                                            <li>
	                                                <a href="#" onclick="ba_update(1,<?php echo e($record->id); ?>)">待處理</a>
	                                            </li>
	                                            <li>
	                                                <a href="#" onclick="ba_update(2,<?php echo e($record->id); ?>)">處理中</a>
	                                            </li>
	                                             <li>
	                                                <a href="#" onclick="ba_update(3,<?php echo e($record->id); ?>)">已處理</a>
	                                            </li>
	                                            <?php elseif($record->status == '1'): ?>
	                                            <li>
	                                                <a href="#" onclick="ba_update(2,<?php echo e($record->id); ?>)">處理中</a>
	                                            </li>
	                                             <li>
	                                                <a href="#" onclick="ba_update(3,<?php echo e($record->id); ?>)">已處理</a>
	                                            </li>
	                                            <?php elseif($record->status == '2'): ?>
	                                            <li>
	                                                <a href="#" onclick="ba_update(1,<?php echo e($record->id); ?>)">待處理</a>
	                                            </li>
	                                            <li>
	                                                <a href="#" onclick="ba_update(3,<?php echo e($record->id); ?>)">已處理</a>
	                                            </li>
	                                            <?php elseif($record->status == '3'): ?>
	                                            <li>
	                                                <a href="#" onclick="ba_update(1,<?php echo e($record->id); ?>)">待處理</a>
	                                            </li>
	                                            <li>
	                                                <a href="#" onclick="ba_update(2,<?php echo e($record->id); ?>)">處理中</a>
	                                            </li>
	                                            <?php endif; ?>
	                                        </ul>
	                                    </div>
								</td>
							</tr>
							<?php endforeach; ?>
							</tbody>
							</table>