<!DOCTYPE html>
<html lang="en">
<style type="text/css">
    div.scrollmenu {
        width: 100vw;
        /*position: fixed;*/
        /*overflow-y: scroll;*/
    }
    body{
        /*height: 100%;*/
    }
    .meteorological{
        width: 100vw;
        height: 10vh;
        background-color: #46BE8A;
        text-align: center;
        vertical-align: middle;
    }
    .meteorological-label{
        font-size: 5vh;
        color: white;
    }
    .btn-size{
        width: 48vw;
        height: 20vh;
    }
    .btn-width{
        width: 48vw;
    }
    .label-size-large{
        width: 50%;
        font-size:4vh;
        color: white;
    }
    .label-size-small{
        color: white;
        margin-top: -8px;
    }
    .btn-full-image{
        width: 50vw;
        height: 35vh;
        background-size: 100% 100%;
        margin-left: 1vw;
        background-repeat:no-repeat;
        border: 0px #AAA solid;
    }
    .text-info{
        font-size: 4rem;
    }
    #btn_set_preservation {
        width: 30vw;
        height: 10vh;
        font-size: 2.5rem;
    }
</style>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="user-scalable=0; initial-scale=1.0; width=device-width; maximum-scale=1.0;">
    <!--   <meta content="IE=edge" http-equiv="X-UA-Compatible"> -->
    <link href="ico/favicon.ico" rel="shortcut icon">
    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" href="<?php echo e(asset('front/css/bootstrap.css')); ?>">

    <!-- Custom styles for this template -->
    <link rel="stylesheet" href="<?php echo e(asset('front/css/style.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('front/css/typicons.css')); ?>" />
    <link rel="stylesheet" href="<?php echo e(asset('assets/global/plugins/font-awesome/css/font-awesome.min.css')); ?>"  />
    <link rel="stylesheet" href="<?php echo e(asset('front/js/tip/tooltipster.css')); ?>">
    <link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css')); ?>"/>
</head>
<body>
    <div class="scrollmenu" style="margin-top: 1vh;">
        <table style="width: 100vw;text-align: center;">
            <tr>
                <td>
                    <div class="text-info">保 全 設 定 紀 錄</div>
                </td>
            </tr>
            <tr>
                <a id="btn_back" class="btn btn-success">返回</a>
            </tr>
            <tr style="height: 5vh;"></tr>
            <tr>
                <table class="table table-striped table-bordered table-hover" id="table_record">
                    <thead>
                        <tr>
                            <td>
                                時間
                            </td>
                            <td>
                                狀態
                            </td>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($record as $one): ?>
                        <tr>
                            <td>
                                <?php echo e($one->created_at); ?>

                            </td>
                            <td>
                                <?php if($one->type_mode == 'alarm'): ?>
                                    <span class="label label-sm label-danger"> 告警中 </span>
                                <?php elseif($one->type_mode == 'proccess'): ?>
                                    <span class="label label-sm label-warning"> 處理中 </span>
                                <?php elseif($one->type_mode == 'release'): ?>
                                    <span class="label label-sm label-info"> 告警解除 </span>
                                <?php elseif($one->type_mode == 'recover'): ?>
                                    <span class="label label-sm label-info"> 異常復歸 </span>
                                <?php elseif($one->type_mode == 'set'): ?>
                                    <?php if($one->mode == 'set_secstatus'): ?>
                                        <span class="label label-sm label-info"> 安防設定 </span>　
                                        <?php if($one->mode_value == '0'): ?>
                                            <span class="label label-sm label-danger">關閉</span>
                                        <?php else: ?>
                                            <span class="label label-sm label-success">開啟</span>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                <?php endif; ?>
                            </td>
                        </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </tr>
        </table>
    </div>
    <form id="form_intercom" action="<?php echo e($url); ?>" method="post"></form>
    <script type='text/javascript' src="<?php echo e(asset('front/js/jquery.js')); ?>"></script>
    <script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/datatables/media/js/jquery.dataTables.min.js')); ?>"></script>
    <script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js')); ?>"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            var table = $('#table_record');
            var oTable = table.dataTable({
                // Internationalisation. For more info refer to http://datatables.net/manual/i18n
                "language": {
                    "aria": {
                        "sortAscending": ": activate to sort column ascending",
                        "sortDescending": ": activate to sort column descending"
                    },
                    "emptyTable": "尚無對講機紀錄",
                    "info": "顯示第 _START_ 到第 _END_ 則 共有 _TOTAL_ 則",
                    "infoEmpty": "",
                    "lengthMenu": "顯示 _MENU_ 則",
                    "zeroRecords": "查無資料",
                },
                "aaSorting": [[0,'desc']],
                "pageLength": 10,
                "searching": false,
                "dom": "Bfrtip",
                "bPaginate": false,
                "info": false,
                "pagingType": "bootstrap_full_number",
            });
            $(document).on('click','#btn_back',function(){
                var form = $('#form_intercom');
                form[0].submit();
            });
        });
    </script>
</body>

</html>