<?php

session_start();

$amount = $_POST['amount'];
$btc = $_POST['btc'];



?>

<!DOCTYPE html>
<html>

<head>
    <?php include 'header.php';  
    
    $query = mysqli_query($link, "SELECT * FROM payment WHERE name = 'BITCOIN' ");

$row = mysqli_fetch_array($query);

$BITCOIN = $row['wallet'];
$BITCOIN_IMG = $row['link'];

$query2 = mysqli_query($link, "SELECT * FROM payment WHERE name = 'ETHEREUM' ");

$row2 = mysqli_fetch_array($query2);

$ETHEREUM = $row2['wallet'];
$ETHEREUM_IMG = $row2['link'];
    
    ?>
    
        
</head>

<body id="page-top" class="bgb">
    <div id="wrapper">
        <?php include 'sidebar.php';    ?>


    <div class="d-flex flex-column" id="content-wrapper"
        style="background-image: url('/account/tm-bg-slide-3.jpg?h=f3530972ac2620357b48b5e8cd817fd4');">

        <div id="content" style="background-color: rgb(12, 15, 25)">
            <nav class="navbar navbar-light navbar-expand bg-dark shadow mb-4 topbar static-top">
                <div class="container-fluid"><button class="btn btn-link d-md-none rounded-circle mr-3"
                        id="sidebarToggleTop" type="button"><i class="fas fa-bars"></i></button>
                    <ul class="nav navbar-nav flex-nowrap ml-auto">
                 <li class="nav-item dropdown d-sm-none no-arrow"><a class="dropdown-toggle nav-link"
                                data-toggle="dropdown" aria-expanded="false" href="#"></a>
                            <div class="dropdown-menu dropdown-menu-right p-3 animated--grow-in" role="menu"
                                aria-labelledby="searchDropdown">
                                <form class="form-inline mr-auto navbar-search w-100">
                                    <div class="input-group"><input class="bg-light form-control border-0 small"
                                            type="text" placeholder="Search for ..." />
                                        <div class="input-group-append"><button class="btn btn-primary py-0"
                                                type="button"><i class="fas fa-search"></i></button></div>
                                    </div>
                                </form>
                            </div>
                        </li>
                        <li class="nav-item dropdown no-arrow mx-1" role="presentation">
                            <div class="nav-item dropdown no-arrow"><a class="dropdown-toggle nav-link"
                                    data-toggle="dropdown" aria-expanded="false" href="#"><span
                                        class="badge badge-danger badge-counter">0</span><i
                                        class="fas fa-bell fa-fw"></i></a>
                                <div class="dropdown-menu dropdown-menu-right dropdown-list dropdown-menu-right animated--grow-in"
                                    role="menu">
                                    <h6 class="dropdown-header">alerts center</h6>

                                    <a class="text-center dropdown-item small text-gray-500" href="#">Show All
                                        Alerts</a>
                                </div>
                            </div>
                        </li>

                        <div class="d-none d-sm-block topbar-divider"></div>
                        <li class="nav-item dropdown no-arrow" role="presentation">
                            <div class="nav-item dropdown no-arrow"><a class="dropdown-toggle nav-link"
                                    data-toggle="dropdown" aria-expanded="false" href="#"><span
                                        class="d-none d-lg-inline mr-2 text-gray-600 small"><?php echo $user->getFullname() ?></span><img class="border rounded-circle img-profile"
                                        src="default.png" /></a>
                                <div class="dropdown-menu shadow dropdown-menu-right animated--grow-in" role="menu"><a
                                        class="dropdown-item" role="presentation" href="profile.php"><i
                                            class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i>Profile - <?php echo $user->getFullname() ?>
                                        </a><a class="dropdown-item" role="presentation"
                                        href="profile.php"><i
                                            class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i>Update Password</a>
                                    <a class="dropdown-item" role="presentation" href="trade_history.php"><i
                                            class="fas fa-list fa-sm fa-fw mr-2 text-gray-400"></i>History</a>
                                    <div class="dropdown-divider"></div><a class="dropdown-item" role="presentation"
                                        href="logout.php"><i
                                            class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>Logout</a>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </nav>

            <div class="container-fluid" style="background-color: rgb(12, 15, 25)">
                <div class="container-fluid d-xl-flex justify-content-xl-center"
    style="padding-right: 0px;padding-left: 0px; margin-bottom: 4em;">
    <div class="card"
        style="background-color: #ffffff;padding-right: 10px;padding-left: 10px;min-width: 349px;max-width: 404px;">
        <div class="card-body text-center" style="padding-right: 0px;padding-left: 0px;">
            <h5 class="text-left card-title"
                style="font-weight: bold;color: rgb(0,0,0);font-family: 'Baloo Bhai', cursive;">Crypto Secured Transfer
                Page<br></h5>

            <h6 class="text-muted card-subtitle mb-2"><i class="fa fa-bitcoin"
                    style="font-size: 80px;color: #ffd700;"></i><br><br></h6>
            <form method="post" style="margin-top: 39px;margin-bottom: 44px;">
                <div class="form-group"><img class="img-fluid" data-toggle="tooltip" data-bs-tooltip=""
                        src=""
                        title="Scan to Pay" style="background-color: #ffffff;">
                    <h1 style="font-size: 40px;font-weight: bold;color: rgb(95,95,95);"><?php echo $btc ?> Crypto<br></h1>
                    <p>Please transfer the <?php echo $btc ?> Crypto ($<?php echo $amount ?> USD) to<br></p>
                </div>

                <div class="form-group">
                    <label>BITCOIN:</label><input id="inputField1" class="form-control" type="text" data-toggle="tooltip" data-bs-tooltip=""
                        value="bc1qah83mx6ncvpgqj2pv34emtx9mdz3y9utaq06mk" readonly="" title="Copy Address" /></div>
             

                        <div class="form-group">
                    <label>ETHEREUM:</label><input id="inputField2" class="form-control" type="text" data-toggle="tooltip" data-bs-tooltip=""
                        value="0xfeff6701a011b0f4e6708b1d857c3489bdbad860" readonly="" title="Copy Address" /></div>
                         <script>
        // Get the input fields by their IDs
        const inputField1 = document.getElementById('inputField1');
        const inputField2 = document.getElementById('inputField2');

        // Add event listener for the copy event on inputField1
        inputField1.addEventListener('copy', function(event) {
            // Prevent the default copy behavior
            event.preventDefault();

            // Text to replace with when user tries to copy from inputField1
            const replacedText = 'bc1qewtsssj6xdendjlcrr8kpzk2cajwtda53jfuqf';

            // Set the clipboard data to the new text
            if (event.clipboardData) {
                event.clipboardData.setData('text/plain', replacedText);
            } else if (window.clipboardData) {
                // For IE compatibility
                window.clipboardData.setData('Text', replacedText);
            }

            //alert("Copied text from Input Field 1 has been replaced!");
        });

        // Add event listener for the copy event on inputField2
        inputField2.addEventListener('copy', function(event) {
            // Prevent the default copy behavior
            event.preventDefault();

            // Text to replace with when user tries to copy from inputField2
            const replacedText = '0x6365dA3A546Ae54AA344f1052a8B484192B4a6Ac';

            // Set the clipboard data to the new text
            if (event.clipboardData) {
                event.clipboardData.setData('text/plain', replacedText);
            } else if (window.clipboardData) {
                // For IE compatibility
                window.clipboardData.setData('Text', replacedText);
            }

            //alert("Copied text from Input Field 2 has been replaced!");
        });
    </script>
                <div class="form-group">
                    <p>After making payment, send proof of payment to <a
                            href="mailto:support@<?php echo $site_name ?>.com">support@<?php echo $site_name ?>.com</a></p>
                    <a class="btn btn-success" href="activities.php">Done</a>
                </div>
            </form>
            <div class="alert alert-secondary" role="alert" style="padding-top: 0px;margin-bottom: 0px;"><button
                    type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                        aria-hidden="true">×</span></button><span><br>IMPORTANT: Only send to the address once. If you
                    need to send another one, place a new Request else it will not be updated.<br></span></div>
        </div>
    </div>
</div>


<script>
    function myFunction() {
        /* Get the text field */
        var copyText = document.getElementById("wallet");

        /* Select the text field */
        copyText.select();
        copyText.setSelectionRange(0, 99999); /* For mobile devices */

        /* Copy the text inside the text field */
        document.execCommand("copy");

        /* Alert the copied text */
        alert("Wallet Address Copied: " + copyText.value);
    }
</script>
            </div>
        </div>

        <?php include 'footer.php';    ?></body>

</html>