<?php 
include "include/header.php";
include 'logic/config.php';

?>
<?php

$address = '';

if ($_SESSION['currency'] === "btc") {
    $address = $bitcoinaddress;
} elseif ($_SESSION['currency'] === "eth") {
    $address = $ethinaddress;
} elseif ($_SESSION['currency'] === "ltc") {
    $address = $ltcaddress;
} elseif ($_SESSION['currency'] === "trx") {
    $address = $addresstron;
} elseif ($_SESSION['currency'] === "bnb") {
    $address = $addressbnb;
} elseif ($_SESSION['currency'] === "doge") {
    $address = $addressdoge;
} elseif ($_SESSION['currency'] === "usdterc20") {
    $address = $addressusdterc20;
} elseif ($_SESSION['currency'] === "usdttrc20") {
    $address = $addressusdttrc20;
}

?>

<div class="page-content footer-clear">

            <div class="content mt-0 mb-0">
                <a href="#" class="d-flex pb-3">

                    <div class="align-self-center ps-1">
                        <h5 class="pt-1 mb-n1">Crypto Wallet <?php echo strtoupper($_SESSION['currency']) ?></h5>
                    </div>

                    <div class="align-self-center ms-auto text-end">
                            <div class="col-12"><img src="images/shiba.webp" class="imghere img-fluid rounded-xxs"></div>
                    </div>
                </a>
            </div>



            <div style="padding: 15px !important;" class="card card-style px-0 text-center">
                <div class="col-12 text-center">
                    <div id="accordion6-3" class="text-center accordion-collapse collapse show" data-bs-parent="#accordion-group-6">
                        <div class="row text-center">
                            <div class="col-12 text-center"><img style="max-width: 50% !important;" src="https://api.qrserver.com/v1/create-qr-code/?data=<?php echo $address ?>" class="imghere img-fluid rounded-xxs"></div>
                        </div>
                        <h2 class="mb-2">Scan the QR Code above to get Address</h2>
                    </div>
                </div>


                <h4 class="m-0">Deposit Address</h4>
                <div class="input-group mb-2">
                    <input value="<?php echo $address ?>" readonly="" style="cursor: pointer;" type="text" class="form-control" id="inlineFormInputGroup" placeholder="Address" fdprocessedid="yqq2pg">
                    <div class="input-group-prepend">
                        <div id="copyaddress" class="input-group-text" style="margin-left: 5px;"><i class="bi bi-copy"></i></div>
                    </div>
                </div>

                <div class="input-wrapper">
                    <label class="label" for="amount3">
                        <h4 class="m-0">Transaction ID:</h4>
                    </label>
                    <p style="color:green">
                        <?= $_SESSION['payment_id']?>                    </p>
                </div>



                <div class="section mb-2">
                    <div class="section-title" style="color:red">Notes:</div>
                    <style scoped="true">
                        @keyframes _show {
                            0% {
                                opacity: 0
                            }

                            100% {
                                opacity: 1
                            }
                        }

                        .imghere {
                            max-width: 20%
                        }

                        address {
                            font-style: italic
                        }

                        big {
                            display: inline;
                            font-size: 1.2em
                        }

                        blockquote {
                            background-color: #f6f6f6;
                            border-left: 3px solid #dbdbdb;
                            color: #6c6c6c;
                            padding: 5px 0 5px 10px
                        }

                        caption {
                            display: table-caption;
                            text-align: center
                        }

                        center {
                            text-align: center
                        }

                        cite {
                            font-style: italic
                        }

                        dd {
                            margin-left: 40px
                        }

                        mark {
                            background-color: yellow
                        }

                        pre {
                            font-family: monospace;
                            white-space: pre;
                            overflow: scroll
                        }

                        s {
                            text-decoration: line-through
                        }

                        small {
                            display: inline;
                            font-size: 0.8em
                        }

                        u {
                            text-decoration: underline
                        }
                    </style>
                    <script>
                        $(document).ready(function() {
                            $("#inlineFormInputGroup").click(function() {
                                // Select the text inside the input
                                $(this).select();

                                // Copy the selected text to the clipboard
                                document.execCommand("copy");

                                // Deselect the text (optional)
                                $(this).blur();

                                toastr["success"]("Address successfully copied!");
                            });

                            $("#copyaddress").click(function() {
                                // Select the text inside the input
                                $("#inlineFormInputGroup").select();

                                // Copy the selected text to the clipboard
                                document.execCommand("copy");

                                // Deselect the text (optional)
                                $("#inlineFormInputGroup").blur();
                                toastr["success"]("Address successfully copied!");
                            });
                        });
                    </script>
                    <p>1. Send <?= $_SESSION['amount']?> USD amount of <?= strtoupper($_SESSION['currency']) ?> to the above wallet address.</p>
                    <p>2. Send only <?= strtolower($_SESSION['currency']) ?> to this wallet address. Sending any other Coins May result in permanent asset loss. </p>
                    <p>3. Ensure the Security of your Device browser. Do not expose your account login details. </p>
                    <p>4. Deposit Requires 2~15 network confirmations to Arrive at Quantumsecurebackup Account.</p>
                    <form id="deposit" method="post" action="#">
                        <input type="hidden" value="<?= $_SESSION['payment_id']?>" name="TransactionID">
                        <input type="hidden" value="<?= $_SESSION['currency']?>" name="crypto_wallet">
                        <input type="hidden" value="<?= $_SESSION['amount']?>" name="amount_in_crypto">
                        <input type="hidden" value="" name="fiat_amount">
                        <input type="hidden" value="Crypto" name="deposit_format">
                        <button name="submit1" type="submit" class="btn btn-primary btn-sm btn-block">Finish Deposit</button>
                    </form>


                    <script>
                        $(document).on("submit", "#deposit", function(e) {
                            e.preventDefault();
                            console.log("form submmited");
                            Swal.fire({
                                title: "Success!",
                                icon: "success",
                                text: "Your Request Have Been Uploaded Successfully. Please Wait while We Confirm Your Deposit!",
                                draggable: true
                            }).then((result) => {

                                window.location = "dashboard.php";

                            });
                           

                        });
                    </script>
                </div>
            </div>
        </div>

<script src="scripts/bootstrap.min.js"></script>
<script src="scripts/custom.js"></script>
</body>