  
    <!-- /Automatic Popup End -->
    </div>
<!--/Full Layout-->
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery-migrate.js"></script>

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

<script src="/js/owl.carousel.min.js"></script>
<script src="/js/waypoints.min.js"></script>
<script src="/js/jquery.counterup.min.js"></script>
<script src="/js/jquery.nice-select.min.js"></script>
<script src="/js/lucide.min.js"></script>
<script src="/js/magnific-popup.min.js"></script>
<script src="/js/aos.js"></script>
<script src="/js/datatables.min.js" type="text/javascript" charset="utf8"></script>
<script src="https://cdn.datatables.net/responsive/2.2.9/js/dataTables.responsive.min.js"></script>
<script src="/js/main.js?var=5"></script>
<!-- <script src="/js/cookie.js"></script> -->
<script src="/js/custom.js?var=5"></script>
<script src="//code.jivosite.com/widget/Ekg65cbouB" async></script>

<script>
    function testtr(type,msg,extra=null){
        if(type != false && msg != false){
  const Toast = Swal.mixin({
  toast: true,
  position: 'top-end',
  showConfirmButton: false,
  timer: 5000,
  timerProgressBar: true,
  didOpen: (toast) => {
    toast.addEventListener('mouseenter', Swal.stopTimer)
    toast.addEventListener('mouseleave', Swal.resumeTimer)
  }
})

Toast.fire({
  icon: type,
  title: msg
})
        }
    }
</script>
<?php
echo "<script type='text/javascript'>";
echo "var jsonData = $jsonString;";
echo "var walletsArr = $walletsArr;";
echo "var walletSelect = '$walletSelect';";
echo "var currency = '$Dcurrency';";
echo "</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>
        function copyRef() {
            /* Get the text field */
            var copyApi = document.getElementById("refLink");
            /* Select the text field */
            copyApi.select();
            copyApi.setSelectionRange(0, 999999999); /* For mobile devices */
            /* Copy the text inside the text field */
            document.execCommand('copy');
            $('#copy').text($('#copied').val())

        }
        function copyAddr() {
            /* Get the text field */
            var copyApi = document.getElementById("uniqueAddress");
            /* Select the text field */
            copyApi.select();
            copyApi.setSelectionRange(0, 999999999); /* For mobile devices */
            /* Copy the text inside the text field */
            document.execCommand('copy');
            $('#copy').text($('#copied').val())

        }
    </script>
    <script>
        'use strict';
        // Auto Popup
        $('.auto-popup-close-now').on('click', function () {
            var $this = $(this),
                $popup = $this.closest('#auto-popup'),
                $dialog = $this.parent('.auto-popup-dialog');
            $popup.addClass('close');
            $dialog.removeClass('fadeInUp').addClass('fadeOutUp');
        });
</script>
<script>
var globalData;
var currency = "USD"
$("#gatewaySelect").on('change',function (e) {
    "use strict"
    e.preventDefault();

    $('.manual-row').empty();

    var code = $(this).val()

    var data = walletsArr[code];

        globalData = data;

        $('.charge').text('Charge ' + data.charge + ' ' + (data.charge_type === 'percentage' ? ' % ' : currency))
        $('.min-max').text('Minimum ' + data.minimum_deposit + ' ' + currency + ' and ' + 'Maximum ' + data.maximum_deposit + ' ' + currency)

        $('#logo').html(`<img class="payment-method" src='${document.location.origin + '/assets/' + data.logo}'>`);

        var amount = $('#amount').val()
        $('#d-charges').val(data.charge)
        $('#d-method').val(data.wallet_name)

        if (Number(amount) > 0) {

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

            var charge = data.charge_type === 'percentage' ? calPercentage(amount, data.charge) : data.charge
            $('.charge2').text(charge + ' ' + currency)

            $('.total').text((Number(amount) + Number(charge)) + ' ' + currency)
        }


        if (data.credentials !== undefined) {
            $('.manual-row').append(data.credentials)
            imagePreview()
        }


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

        var amount = $(this).val()
        $('.amount').text((Number(amount)))

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

        var charge = globalData.charge_type === 'percentage' ? calPercentage(amount, globalData.charge) : globalData.charge
        $('.charge2').text(charge + ' ' + currency)

        $('.total').text((Number(amount) + Number(charge)) + ' ' + currency)
    })


});
</script>
<script>
// Color Switcher
$(".color-switcher").on('click', function () {
    "use strict"
    $("body").toggleClass("dark-theme");
    var url = '/theme-mode';
    $.get(url)
});
</script>
<script>

        $('.sendAmount').on('keyup',function (e) {
            "use strict"
            var amount = $(this).val();
            $('.previewAmount').text(amount);

            var charge = "5";
            var chargeType = "percentage";


            if (chargeType === 'percentage') {
                var finalCharge = calPercentage(amount, charge)
            } else {
                var finalCharge = charge

            }
            $('.previewCharge').text(finalCharge);
        })


    </script>
    <script>


(function ($) {
    "use strict";
    var table = $('#dataTable').DataTable({
        processing: false,
        serverSide: true,
        ajax: "/user/transactions",
        columns: [
            {data: 'description', name: 'description'},
            {data: 'tnx', name: 'tnx'},
            {data: 'type', name: 'type'},
            {data: 'amount', name: 'amount'},
            {data: 'charge', name: 'charge'},
            {data: 'status', name: 'status'},
            {data: 'method', name: 'method'},
        ]
    });


})(jQuery);
(function ($) {
    "use strict";
    var transactionData = <?php echo $transactionData; ?>;
    var table = $('#dataTableTransactions').DataTable({
        processing: false,
        serverSide: false,
        data: transactionData, // Assign JSON data directly to the data option
        columns: [
            {data: 'description', name: 'description'},
            {data: 'tnx', name: 'tnx'},
            {data: 'type', name: 'type'},
            {data: 'amount', name: 'amount'},
            {data: 'charge', name: 'charge'},
            {data: 'status', name: 'status'},
            {data: 'method', name: 'method'},
        ]
    });

})(jQuery);

</script>
<script>
        (function ($) {
            "use strict";
            var withdrawData = <?php echo $withdrawData; ?>;
            var table = $('#withdrawData').DataTable({
                processing: false,
                serverSide: false,
                data: withdrawData,
                columns: [
                    {data: 'description', name: 'description'},
                    {data: 'tnx', name: 'tnx'},
                    {data: 'amount', name: 'amount'},
                    {data: 'charge', name: 'charge'},
                    {data: 'status', name: 'status'},
                    {data: 'method', name: 'method'},
                ]
            });


        })(jQuery);
        (function ($) {
            "use strict";
            var fundTransferData = <?php echo $fundTransferData; ?>;
            var table = $('#fundTransferData').DataTable({
                processing: false,
                serverSide: false,
                data: fundTransferData,
                columns: [
                    {data: 'description', name: 'description'},
                    {data: 'tnx', name: 'tnx'},
                    {data: 'amount', name: 'amount'},
                    {data: 'charge', name: 'charge'},
                    {data: 'status', name: 'status'},
                    {data: 'method', name: 'method'},
                ]
            });


        })(jQuery);
        (function ($) {
            "use strict";
            var depositData = <?php echo $depositData; ?>;
            var table = $('#depositData').DataTable({
                processing: false,
                serverSide: false,
                data: depositData,
                columns: [
                    {data: 'description', name: 'description'},
                    {data: 'tnx', name: 'tnx'},
                    {data: 'amount', name: 'amount'},
                    {data: 'charge', name: 'charge'},
                    {data: 'status', name: 'status'},
                    {data: 'method', name: 'method'},
                ]
            });


        })(jQuery);
        (function ($) {
            "use strict";
            var botHistory = <?php echo $botHistory; ?>;
            var table = $('#botHistory').DataTable({
                processing: false,
                serverSide: false,
                data: botHistory,
                columns: [
                    {data: 'description', name: 'description'},
                    {data: 'tnx', name: 'tnx'},
                    {data: 'amount', name: 'amount'},
                    {data: 'charge', name: 'charge'},
                    {data: 'status', name: 'status'},
                    {data: 'method', name: 'method'},
                ]
            });


        })(jQuery);
        (function ($) {
            "use strict";
            var investData = <?php echo $investData; ?>;
            var table = $('#investData').DataTable({
                responsive:true,
                processing: false,
                serverSide: false,
                data: investData,
                columns: [
                    {data: 'icon', name: 'icon'},
                    {data: 'schema', name: 'schema'},
                    {data: 'roi', name: 'roi'},
                    {data: 'profit', name: 'profit'},
                    {data: 'capital_back', name: 'capital_back'},
                    {data: 'timeline', name: 'timeline'},
                ]
            });


        })(jQuery);
        (function ($) {
            "use strict";
            var tradeData = <?php echo $tradeData; ?>;
            var table = $('#tradeData').DataTable({
                responsive:true,
                processing: false,
                serverSide: false,
                data: tradeData,
                columns: [
                    {data: 'Pairs', name: 'Pairs'},
                    {data: 'Market', name: 'Market'},
                    {data: 'Type', name: 'Type'},
                    {data: 'PnL', name: 'PnL'},
                    {data: 'Execution', name: 'Execution'},
                    {data: 'Timeline', name: 'Timeline'},
                ]
            });
        })(jQuery);

    </script>
    <script>

"use strict"

var currency = "USD";

var charge_type = "percentage";
var charge = "0";

$('#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)

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


    $('.charge').text('Charge ' + charge + ' ' + (charge_type === 'percentage' ? ' % ' : currency))
})
</script>
<script>

$("#select-schema").on('change', function(e) {
    "use strict";
    e.preventDefault();
    // alert('here');
    var id = $(this).val(); // Assuming you're using this for something else in your logic.

    var invest_amount = $("#enter-amount");
    invest_amount.val('');
    invest_amount.attr('readonly', false);

    // Simulating the AJAX call success callback with jsonData.
    var result = jsonData[id]; // Directly using the jsonData object.
// console.log(result);
var Amtrange = result.amount_range;
var parts = Amtrange.split('-'); 
Amtrange = "minimum " + parts[0] + " "+currency+" - maximum " + parts[1]+ " "+currency;
    $('#amount').html(Amtrange);
    $('#return-interest').html(result.return_interest);
    $('#number-period').html(result.number_period);
    $('#capital_back').html(result.capital_back);
    $('#plan_id').val(id);
    $('#plan_name').val(result.plan_name);
// Set minimum and maximum values
invest_amount.attr('min', parts[0]);
invest_amount.attr('max', parts[1]);
    if (result.invest_amount > 0) {
        invest_amount.val(result.invest_amount);
        invest_amount.attr('readonly', true);
    }
});

        $("#enter-amount").on('keyup',function (e) {
            "use strict";
            e.preventDefault();
            var amount = $(this).val();
            $("#total-amount").html(amount);
        })

        $("#selectWallet").on('change',function (e) {
            "use strict";
            $('.gatewaySelect').empty();
            $('.manual-row').empty();
            var wallet = $(this).val();
            if (wallet === 'gateway') {
                    $('.gatewaySelect').append(walletSelect)
                    $('select').niceSelect();

            }

        })
        $('body').on('change', '#gatewaySelect', function (e) {
            "use strict"
            e.preventDefault();

            $('.manual-row').empty();

            var code = $(this).val()
            var data = walletsArr[code];

                if (data.credentials !== undefined) {

                    // console.log(data.credentials);

                    $('.manual-row').append(data.credentials)
                    imagePreview()
                }

            $('#amount').on('keyup',function (e) {
                "use strict"
                var amount = $(this).val()
                $('.amount').text((Number(amount)))
                $('.currency').text(currency)
                var charge = globalData.charge_type === 'percentage' ? calPercentage(amount, globalData.charge) : globalData.charge
                $('.charge2').text(charge + ' ' + currency)

                $('.total').text((Number(amount) + Number(charge)) + ' ' + currency)
            })


        });
    </script>
<script>
        $("#kycTypeSelect").on('change',function (e) {
            "use strict"
            e.preventDefault();

            $('.kycData').empty();

            var id = $(this).val();
            var kycdata = {2:'<div class="col-xl-12 col-md-12"><div class="body-title">Front Image</div><div class="wrap-custom-file"><input type="file" name="front_kyc_credential" id="1" accept=".gif, .jpg, .png" required><label for="1"><img class="upload-icon" src="/images/upload.svg" alt=""><span>Select Front Image</span></label></div></div><div class="col-xl-12 col-md-12"><div class="body-title">Back Image</div><div class="wrap-custom-file"><input type="file" name="back_kyc_credential" id="2" accept=".gif, .jpg, .png" required><label for="2"><img class="upload-icon" src="/images/upload.svg" alt=""><span>Select Back Image</span></label></div></div><div class="col-xl-12 col-md-12"><div class="body-title">Selfie Image</div><div class="wrap-custom-file"><input type="file" name="selfie_kyc_credential" id="3" accept=".gif, .jpg, .png" required><label for="3"><img class="upload-icon" src="/images/upload.svg" alt=""><span>Select Selfie Image</span></label></div></div>',
            1:'<div class="col-xl-12 col-md-12"><div class="progress-steps-form"><label for="exampleFormControlInput1" class="form-label">NID Number</label><div class="input-group"><input type="text" name="nid_kyc_credential" class="form-control" aria-label="Amount" id="amount" aria-describedby="basic-addon1"></div></div></div><div class="col-xl-12 col-md-12"><div class="body-title">Front Image</div><div class="wrap-custom-file"><input type="file" name="front_kyc_credential" id="2" accept=".gif, .jpg, .png" required><label for="2"><img class="upload-icon" src="/images/upload.svg" alt=""><span>Select Front Image</span></label></div></div><div class="col-xl-12 col-md-12"><div class="body-title">Back Image</div><div class="wrap-custom-file"><input type="file" name="back_kyc_credential" id="3" accept=".gif, .jpg, .png" required><label for="3"><img class="upload-icon" src="/images/upload.svg" alt=""><span>Select Back Image</span></label></div></div><div class="col-xl-12 col-md-12"><div class="body-title">Selfie Image</div><div class="wrap-custom-file"><input type="file" name="selfie_kyc_credential" id="4" accept=".gif, .jpg, .png" required><label for="4"><img class="upload-icon" src="/images/upload.svg" alt=""><span>Select Selfie Image</span></label></div></div>'}
            var data = kycdata[id];
                $('.kycData').append(data);
                imagePreview();
        });
    </script>
</body>
</html>

