
<!DOCTYPE html>
<html lang="en">
<?php 
    require_once('../include/head.php');
?>
<body class="dark-theme">
<!-- <div class="notify fixed inset-0 flex items-end justify-center px-4 py-6 pointer-events-none sm:p-6 sm:items-start sm:justify-end">
        <div
            x-data="{ show:  true  }"
            x-show="show"
            x-description="Notification panel, show/hide based on alert state."
            x-transition:enter="transform ease-out duration-300 transition"
            x-transition:enter-start="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"
            x-transition:enter-end="translate-y-0 opacity-100 sm:translate-x-0"
            x-transition:leave="transition ease-in duration-100"
            x-transition:leave-start="opacity-100"
            x-transition:leave-end="opacity-0"
            class="max-w-sm w-full  bg-white  shadow-lg rounded-lg pointer-events-auto border-l-4     border-red-600 "
        >
            <div class="relative rounded-lg shadow-xs overflow-hidden">
                <div class="p-4">
                    <div class="flex items-start">
                                                                                                                            <div class="inline-flex items-center bg-red-600 p-2 text-white text-sm rounded-full flex-shrink-0">
                                <svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="x w-5 h-5">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
                                </svg>
                            </div>
                                                <div class="ml-4 w-0 flex-1">
                            <p class="text-base leading-5 font-medium capitalize     text-red-600 ">
                                Error
                            </p>
                            <p class="mt-1 text-sm leading-5  text-gray-500 ">
                                The from wallet and to wallet must be different.
                            </p>
                        </div>
                        <div class="ml-4 flex-shrink-0 flex">
                            <button @click="show = false;" class="inline-flex text-gray-400 focus:outline-none focus:text-gray-500 transition ease-in-out duration-150">
                                <svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
                                    <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path>
                                </svg>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    
    
    
     -->
     <?php 
    require_once('../include/notify.php');
?>


<script>
    var notify = {
        timeout: "5000",
    }
</script>
<!--Full Layout-->
<div class="panel-layout">
    <!--Header-->
    <?php 
    require_once('../include/header.php');
?>
    <!--/Header-->

    <!--Side Nav-->
    <?php 
    require_once('../include/sidebar.php');
?>
    <!--/Side Nav-->

    <div class="page-container">
        <div class="main-content">
            <div class="section-gap">
                <div class="container-fluid">
                                            
        <div class="row">
                        <?php 
    require_once('../include/head.php');
?>
    </div>
                                        <!--Page Content-->
                        <div class="row">
        <div class="col-xl-12">
            <div class="site-card">
                <div class="site-card-header">
                    <h3 class="title">Wallet Exchange</h3>
                </div>
                <div class="site-card-body">
                    <div class="progress-steps">
                        <div class="single-step current">
                            <div class="number">01</div>
                            <div class="content">
                                <h4>Wallet Details</h4>
                                <p>Enter your Wallet details</p>
                            </div>
                        </div>
                        <div class="single-step <?php echo (isset($_SESSION['exchange_success']) && ($_SESSION['exchange_success']==true)) ? 'current' : ''; ?> ">
                            <div class="number">02</div>
                            <div class="content">
                                <h4>Success</h4>
                                <p>Successfully Exchanged</p>
                            </div>
                        </div>
                    </div>
                   
               <?php if(isset($_SESSION['exchange_success']) && ($_SESSION['exchange_success']==true)){ ?> 
                
               <div class="progress-steps-form">
               <div class="transaction-status centered">
                   <div class="icon success">
                       <i class="anticon anticon-check"></i>
                   </div>
                   <h2>$<?php echo $_SESSION['pay_amount_usd']; ?> Exchange Wallet Money Successfully</h2>
                   <p><?php echo $_SESSION['xc_msg']; ?></p>
                   <p>Transaction ID: <?php echo $_SESSION['trans_id']; ?></p>
                   <a href="../wallet-exchange" class="site-btn">
                       <i class="anticon anticon-plus"></i>Exchange Wallet Money again
                   </a>
               </div>
           </div>
                   
                   <?php unset($_SESSION['trans_id']); unset($_SESSION['pay_amount_usd']);  unset($_SESSION['exchange_success']); unset($_SESSION['xc_msg']); }else{ ?>
                <div class="progress-steps-form">
                    <form action="../php/wallet-exchange-now.php" method="post">
                        <input type="hidden" name="_token" value="GJ2s3NLFrmVthRdn56m1WtDvOjBfNw8VtfZgqT8D">            <div class="row">
                            <div class="col-xl-4 col-md-12">
                                <label for="exampleFormControlInput1" class="form-label">From Wallet:</label>
                                <div class="input-group">
                                    <select name="wallet_from" class="site-nice-select">
                                        <option value="1">Main Wallet (<?php echo $infos['bal']; ?> USD)</option>
                                        <option selected
                                                value="2">Profit Wallet (<?php echo $infos['bal2']; ?> USD)</option>
                                    </select>
                                </div>
                            </div>
                            <div class="col-xl-4 col-md-12">
                                <label for="exampleFormControlInput1" class="form-label">Enter Amount:</label>
                                <div class="input-group">
                                    <input type="text" name="amount" class="form-control"
                                        oninput="this.value = validateDouble(this.value)" aria-label="Amount" id="amount"
                                        aria-describedby="basic-addon1">
                                    <span class="input-group-text" id="basic-addon1">USD</span>
                                </div>
                                <div class="input-info-text charge"></div>
                            </div>

                            <div class="col-xl-4 col-md-12">
                                <label for="exampleFormControlInput1" class="form-label">To Wallet:</label>
                                <div class="input-group">
                                    <select name="wallet_to" class="site-nice-select">
                                        <option selected
                                                value="1">Main Wallet (<?php echo $infos['bal']; ?> USD)</option>
                                        <option
                                            value="2">Profit Wallet (<?php echo $infos['bal2']; ?> USD)</option>
                                    </select>
                                </div>

                            </div>

                        </div>


                        <div class="transaction-list table-responsive">
                            <div class="user-panel-title">
                                <h3>Review Details:</h3>
                            </div>
                            <table class="table">
                                <tbody>
                                <tr>
                                    <td><strong>Amount</strong></td>
                                    <td><span class="amount"></span> <span class="currency"></span></td>
                                </tr>
                                <tr>
                                    <td><strong>Charge</strong></td>
                                    <td class="charge2"></td>
                                    <input type="hidden" class="charge3"  name="fee">
                                </tr>
                                <tr>
                                    <td><strong>Total</strong></td>
                                    <td class="total"></td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="buttons">
                            <button type="submit" class="site-btn blue-btn">
                                Proceed to Exchange<i class="anticon anticon-double-right"></i>
                            </button>
                        </div>
                    </form>
                </div>

 <?php }   ?>
                </div>
            </div>
        </div>
    </div>
                    <!--Page Content-->
                </div>
            </div>
        </div>
    </div>


    <!-- Automatic Popup -->
    
    <!-- /Automatic Popup End -->
</div>
<!--/Full Layout-->

<script src="/assets2/global/js/jquery.min.js"></script>
<script src="/assets2/global/js/jquery-migrate.js"></script>

<script src="/assets2/frontend/js/bootstrap.bundle.min.js"></script>
<script src="/assets2/frontend/js/scrollUp.min.js"></script>

<script src="/assets2/frontend/js/owl.carousel.min.js"></script>
<script src="/assets2/global/js/waypoints.min.js"></script>
<script src="/assets2/frontend/js/jquery.counterup.min.js"></script>
<script src="/assets2/frontend/js/jquery.nice-select.min.js"></script>
<script src="/assets2/frontend/js/lucide.min.js"></script>
<script src="/assets2/frontend/js/magnific-popup.min.js"></script>
<script src="/assets2/frontend/js/aos.js"></script>
<script src="/assets2/global/js/datatables.min.js" type="text/javascript" charset="utf8"></script>
<script src="/assets2/frontend/js/main.js?var=5"></script>
<script src="/assets2/frontend/js/cookie.js"></script>
<script src="/assets2/global/js/custom.js?var=5"></script>


    <script>
        (function ($) {
            'use strict';
            // To top
            $.scrollUp({
                scrollText: '<i class="fas fa-caret-up"></i>',
                easingType: 'linear',
                scrollSpeed: 500,
                animation: 'fade'
            });
        })(jQuery);
    </script>

<script type="text/javascript" src="/assets2/vendor/mckenziearts/laravel-notify/js/notify.js"></script>    <script>

        "use strict"

        var currency = "USD";

        var charge_type = "percentage";
        var charge = "0.05";

        $('#amount').on('keyup',function (e) {

            var amount = $(this).val()

            $('.amount').text((Number(amount)))

            $('.currency').text(currency)

            var finalCharge = charge_type === 'percentage' ? calPercentage(amount, charge) : charge


            $('.charge2').text(finalCharge + ' ' + currency)

            $('.charge3').val(finalCharge )

            $('.total').text((Number(amount) + Number(finalCharge)) + ' ' + currency)


            $('.charge').text('Charge ' + charge + ' ' + (charge_type === 'percentage' ? ' % ' : currency))
        })
    </script>
    <script>
        // Color Switcher
        $(".color-switcher").on('click', function () {
            "use strict"
            $("body").toggleClass("dark-theme");
            var url = 'https://app.hyiprio.xyz/theme-mode';
            $.get(url)
        });
    </script>







</body>
</html>

