<?php $__env->startSection('content'); ?>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"
        integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="
        crossorigin="anonymous" referrerpolicy="no-referrer"></script>


    <style>
        .shop_lists1 {
            width: 92%;
            margin: 1rem 4%;
        }

        .shop_lists1 ul {
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
        }

        .shop_lists1 li {
            width: 48%;
            padding: 3rem 1rem 1rem 1rem;
            box-sizing: border-box;
            background: #fff;
            position: relative;
            border-radius: 0.25rem;
            margin-bottom: 1rem;
        }

        .shop_lists1 li img {
            width: 6.25rem;
            height: 6.25rem;
            display: block;
            margin: 0 auto;
        }

        .shop_lists1 li .tag {
            height: 1.25rem;
            line-height: 1.15rem;
            background: linear-gradient(to right, #76B900, #76B900);
            color: #fff;
            display: inline-block;
            padding: 0 0.75rem;
            font-size: 12px;
            border-radius: 2.5rem;
            position: absolute;
            top: 1rem;
            left: 1rem;
        }

        .shop_lists1 li h4 {
            width: 100%;
            text-align: center;
            margin-top: 0.5rem;
            font-size: 14px;
            color: #333;
        }

        .shop_lists1 li p {
            width: 100%;
            height: 1.5rem;
            background: linear-gradient(to right, #76B900, #76B900);
            margin-top: 0.75rem;
            border-radius: 3rem;
            padding: 0 1px;
            box-sizing: border-box;
            text-align: center;
            justify-content: space-between;
        }

        .shop_lists1 li p span {
            width: 50%;
            height: 22px;
            margin-top: 1px;
            line-height: 22px;
            font-weight: bold;
            color: #fff;
            font-size: 12px;
            text-align: center;
        }

        .shop_lists1 li p span.action {
            background: #fff;
            color: #333;
        }

        .device_body {
            width: 100%;
            margin: 1rem 0%;
            background: #232323;
            background-size: cover;
            padding: 0.5rem;
            box-sizing: border-box;
            border: none;
            height: 5.5rem;
            border-radius: 0;
        }

        .shop_money {
            background: #232323;
            border-radius: 0;
            border: none;
        }

        .shop_money .left {
            padding: 0;
        }

        .shop_money .left p {
            width: 100%;
            font-size: 14px;
            color: #888;
            text-align: center;
        }

        .shop_money .left h1 {
            font-size: 22px;
            color: #FFF;
            margin: auto;
        }

        .shop_money a {
            height: 2rem;
            display: inline-block;
            line-height: 2rem;
            font-size: 13px;
            /*background: linear-gradient(0deg, #feaf1e 0%, #FFFDFD 100%);*/
            margin: auto;
            padding: 0.1rem 14%;
            border-radius: 20px;
            color: #FFF;
            font-weight: bold;
            margin-top: 0.5rem;
            background: linear-gradient(to right, #76B900, #76B900)
        }

        .produce {
            width: 60%;
            text-align: center;
            line-height: 2rem;
            font-size: 14px;
            border-radius: 2.5rem;
            height: 2rem;
            color: rgb(255, 255, 255);
            background: linear-gradient(to right, #76B900, #76B900);
            display: block;
            float: right;
            margin-right: 1rem;
        }

        .goods_lists li span.money {
            height: 1.5rem;
            background: none;
            font-weight: bold;
            color: #FFF;
            line-height: 1.5rem;
            position: absolute;
            /* right: 1rem; */
            font-size: 14px;
            padding: 0 1rem;
            border-radius: 2rem;
            /*top: 9.2rem;*/
            left: 0;
            width: 10rem;
        }

        .pay_center h4 {
            color: #FFF;
        }

        .pay_center p {
            color: #b1b1b1;
        }

        .van-progress__portion {
            position: absolute;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--van-progress-color);
            border-radius: inherit;
            transform-origin: 0;
            transition: all var(--van-animation-duration-base) var(--van-animation-timing-function-enter);
        }
    </style>
    <style type="text/css" media="screen and (min-width: 640px)">

    </style>
    </head>








    <form action="" method="post">

        <style>
            .pay_center h4 {
                color: #FFF;
            }
        </style>

        <body>

            <!--<div class="bg"><img src="/static/themes/img/indexbg2.jpg"></div>-->

            <header style="background: #090909;">
                <img src="<?php echo e(asset('core/img/re.png')); ?>" onclick="javascript:history.back(-1);">
                <p style="color: #fff;">withdraw</p>
                
            </header>
            <div class="header"></div>

            <div class="pay_center">
                <form action="" method="post" id="login-form">
                    <?php echo csrf_field(); ?>
                    <div class="pay_center_to">
                        <!--<h4>Depozito tutarı (depozito 200.00 TL)</h4>-->
                        <ul>

                        </ul>

                        <?php if(auth()->user()->bankAccount): ?>
                            <div class="box">

                                
                                <div class="inputs">
                                    <input type="text" value="<?php echo e(auth()->user()->bankAccount->account_name); ?>" readonly>
                                </div>
                                <div class="inputs">
                                    <input type="text" value="<?php echo e(auth()->user()->bankAccount->account_number); ?>"
                                        readonly>
                                </div>

                                <div class="inputs">
                                    <input type="text" value="<?php echo e(auth()->user()->bankAccount->bank_name); ?>" readonly>
                                </div>

                            </div>
                            <a style="padding: 10px 10px; background: red; border-radius:30px; margin-top:30px; display:block; width:30%; color:white; text-align:center;" href="<?php echo e(url('user/bank/delete')); ?>">
                                Delete Bank Account
                            </a>
                        <?php else: ?>
                            <h4 style="margin-top: 1rem;">Bank</h4>
                            <select class="chose_pay pay_lis " name="bank_code" id="bank_name" required>
                                <option value="">Select One</option>
                                <?php $__currentLoopData = $banks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $bank): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($bank['bank_code']); ?>"><?php echo e($bank['name']); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>

                            <div class="inputs">
                                <input type="number" name="account_number" id="account"
                                    placeholder="please enter bank account" required>
                            </div>

                            <span style="color:
                        red;" class="text-danger text-error block"></span>
                            <input type="hidden" name="bank_name" id="bank_code">

                            <div class="inputs">
                                <input type="text" name="account_name" id="account_name"
                                    placeholder="please enter holder name" required="" readonly>
                            </div>


                            <button id="reg" disabled type="submit">Submit</button>
                        <?php endif; ?>
                    </div>



                    <!-- 			<div class="pay_center_tips">-->
                    <!-- 				<h4>Recharge Help</h4>-->
                    <!-- 				<ul class="recharge-video">-->
                    <!--	<li>-->
                    <!--		<video muted preload="auto" loop controls style="-->
               <!-- width: 45%;-->
               <!-- height: auto;-->
               <!-- border-radius: 5px;">-->
                    <!--			<source src="/czbz.mov" type="video/mp4">-->

                    <!--		</video>-->
                    <!--		<video muted preload="auto" loop controls style="-->
               <!-- width: 45%;-->
               <!-- height: auto;-->
               <!-- border-radius: 5px;">-->
                    <!--			<source src="/czbz1.mov" type="video/mp4">-->

                    <!--		</video>-->
                    <!--	</li>-->
                    <!--<li>-->
                    <!--	<video muted preload="auto" loop controls>-->
                    <!--		<source src="/czbz1.mov" type="video/mp4">-->
                    <!--	</video>-->
                    <!--	<h6>Recharge Help</h6>-->
                    <!--</li>-->

                    
                    <footer>
                        <ul>
                            <li class="action" onclick="location='<?php echo e(route('user.home')); ?>'">
                                <img src="<?php echo e(asset('core/img/f1.png')); ?>">
                                <p>Home</p>
                            </li>
                            <li onclick="location='<?php echo e(route('user.deposit')); ?>'">
                                <img src="<?php echo e(asset('core/img/f2.png')); ?>">
                                <p>Recharge</p>
                            </li>
                            <li onclick="location='<?php echo e(route('user.referrals')); ?>'">
                                <img src="<?php echo e(asset('core/img/f3.png')); ?>">
                                <p>Invite</p>
                            </li>
                            <li onclick="location='<?php echo e(route('user.investment.log')); ?>'">
                                <img src="<?php echo e(asset('core/img/f4.png')); ?>">
                                <p>Device</p>
                            </li>
                            <li onclick="location='<?php echo e(route('user.profile.setting')); ?>'">
                                <img src="<?php echo e(asset('core/img/f5.png')); ?>">
                                <p>Mine</p>
                            </li>
                        </ul>
                    </footer>

        </body>
    <?php $__env->stopSection(); ?>

    <?php $__env->startPush('script-lib'); ?>
        <textarea style="display: none;" id="all_banks"><?php echo $all_banks; ?></textarea>

        <script>
            let all_banks = JSON.parse($("#all_banks").val());
            //console.info(all_banks);
            (function($) {
                "use strict";

                function getByValue(value) {

                    let arr = all_banks;
                    for (var i = 0, iLen = arr.length; i < iLen; i++) {
                        //console.log(arr[i]);
                        if (arr[i].bank_code == value) return arr[i].name;
                    }
                }


                $("#bank_name").change(function(e) {
                    //alert($(this).val());
                    //let code = $("#bank_name").val(); //getByValue().bank_code;
                    //let account = $("#account").val();

                    //console.log(t, code);


                    let code = $("#bank_name").val(); //getByValue().bank_code;
                    let account = $("#account").val();

                    //console.log(code, account);

                    let t = getByValue(code);

                    //console.log(t);

                    $("#bank_code").val(t);
                    if (account != "" && code != "") {

                        get_account_info(code, account);

                        //console.log(account, code);
                    }

                });

                $("#account").change(function() {

                    let code = $("#bank_name").val(); // getByValue($("#bank_name").val()).bank_code;
                    let account = $("#account").val();
                    if (account == "" || code == "") {
                        $("#reg").prop('disabled', true);
                        $("#account_name").val("");
                        $(".text-error").text("Your bank name and account number are required, please try again");
                        return;
                    }

                    get_account_info(code, account);

                    //console.log(account, code);


                });





                function get_account_info(code, account) {

                    $(".preloaders").show();
                    $(".text-error").text("Fetching account details");

                    $.ajax({
                        url: "<?php echo e(route('account.fetch')); ?>",
                        type: 'get',
                        dataType: 'json',
                        data: {
                            'bank-verification': '',
                            'code': code,
                            'account': account
                        },
                        success: function(response) {
                            if (response.status == "error") {
                                $("#account_name").val("");
                                $(".preloaders").hide();
                                $(".text-error").text(
                                    "Could not resolve account name, please check your account number or bank name and try again"
                                );
                                $("#reg").prop('disabled', true);
                                return;
                            }

                            $(".text-error").text("");
                            $("#reg").removeAttr('disabled');
                            $(".preloaders").hide();
                            console.log(response.data);
                            $("#account_name").val(response.data.account_name);

                            //console.log(response);
                        },

                        error: function(err) {
                            console.log(err.responseText);
                            $(".preloaders").hide();
                        }
                    });
                }

                $('.withdraw-thumbnail').hide();
                $('.clickBtn').on('click', function() {
                    var classNmae = $('.fileinput').attr('class');
                    if (classNmae != 'fileinput fileinput-exists') {
                        $('.withdraw-thumbnail').hide();
                    } else {
                        $('.fileinput-preview img').css({
                            "width": "100%",
                            "height": "300px",
                            "object-fit": "contain"
                        });

                        $('.withdraw-thumbnail').show();
                    }

                });

            })(jQuery);
        </script>

        <script>
            // Get the select element
            const bankSelect = document.getElementById('bank_name');
            // Get the input element
            const selectedBank = document.getElementById('bank_code');

            // Add event listener to the select element
            bankSelect.addEventListener('change', function() {
                // Get the selected option value
                const selectedOption = bankSelect.options[bankSelect.selectedIndex].text;
                // Update the value of the input field with the selected option value
                selectedBank.value = selectedOption;
            });
        </script>
    <?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.users', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Applications/AMPPS/www/nvidia/core/resources/views/templates/basic/user/bank-setup.blade.php ENDPATH**/ ?>