<?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>
    <link rel="stylesheet" href="<?php echo e(asset('static/index/v1/css/card.css')); ?>">


    <body data-theme-color="color-blue">
        <div class="page-wraper">


            <style>
                .header .header-content .mid-content {
                    flex: 1;
                    text-align: left;
                }

                .header {
                    background-color: #ed7016;
                    min-height: 55px;
                    z-index: 2;
                    border-bottom: 0px solid #dddddd;
                }

                #preloader {
                    top: 0;
                }

                i.fa-solid.fa-bell {
                    font-size: 22px;
                    color: white;
                    margin-top: 12px;
                    padding-right: 7px;
                }

                i.fa-solid.fa-globe {
                    font-size: 22px;
                    color: white;
                    margin-top: 12px;
                    padding-right: 7px;
                }

                .header .sticky-header {
                    top: 0px;
                    background: #ed7016;
                }

                .toast.style-1.toast-danger {
                    background-color: #1e1e1e5e;
                    color: #fff;
                    border: 0px white solid;
                    backdrop-filter: blur(5px);
                }

                .toast.style-1 .toast-body {
                    display: flex;
                    align-items: center;
                    padding: 14px;
                }

                .toast.style-1.toast-danger .toast-content strong {
                    color: #fff;
                    font-weight: 600;
                }
            </style>


            <!-- Header -->
            <header class="header">
                <div class="main-bar">
                    <div class="container">
                        <div class="header-content">

                            <div class="mid-content">
                                <h5 class="mb-0">Bank Info</h5>
                            </div>
                            <!--              <div class="right-content">-->
                            <!--                  <a href="javascript:void(0);" class="menu-toggler">-->
                            <!--	<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">-->
                            <!--		<path opacity="0.4" d="M16.0755 2H19.4615C20.8637 2 22 3.14585 22 4.55996V7.97452C22 9.38864 20.8637 10.5345 19.4615 10.5345H16.0755C14.6732 10.5345 13.537 9.38864 13.537 7.97452V4.55996C13.537 3.14585 14.6732 2 16.0755 2Z" fill="#a19fa8"/>-->
                            <!--		<path fill-rule="evenodd" clip-rule="evenodd" d="M4.53852 2H7.92449C9.32676 2 10.463 3.14585 10.463 4.55996V7.97452C10.463 9.38864 9.32676 10.5345 7.92449 10.5345H4.53852C3.13626 10.5345 2 9.38864 2 7.97452V4.55996C2 3.14585 3.13626 2 4.53852 2ZM4.53852 13.4655H7.92449C9.32676 13.4655 10.463 14.6114 10.463 16.0255V19.44C10.463 20.8532 9.32676 22 7.92449 22H4.53852C3.13626 22 2 20.8532 2 19.44V16.0255C2 14.6114 3.13626 13.4655 4.53852 13.4655ZM19.4615 13.4655H16.0755C14.6732 13.4655 13.537 14.6114 13.537 16.0255V19.44C13.537 20.8532 14.6732 22 16.0755 22H19.4615C20.8637 22 22 20.8532 22 19.44V16.0255C22 14.6114 20.8637 13.4655 19.4615 13.4655Z" fill="#a19fa8"/>-->
                            <!--	</svg>-->
                            <!--</a>-->
                            <!--              </div>-->
                        </div>
                    </div>
                </div>
            </header>



            <!--   <div id="preloader">-->
            <!--	<div class="spinner"></div>-->
            <!--</div>-->
            <meta name="theme-color" content="#ed7016">
            <style>
                body {
                    background-color: #fff;
                }

                .profile-header {

                    color: white;
                    padding: 20px;
                    text-align: center;
                    border-radius: 10px;
                    background: var(--gradient);
                }

                .header {
                    background: #9ed230 !important;
                    min-height: 40px;
                    margin-bottom: 70px;
                    border-bottom: 0px solid #dddddd;
                    border-bottom-left-radius: 0%;
                    border-bottom-right-radius: 0%;
                }

                h5.mb-0 {
                    color: white;
                    margin-top: 2px;
                }

                .w-32 {
                    width: 32%;
                }


                .header .header-content .mid-content {
                    flex: 1;
                    text-align: center;
                }


                .backbutton {
                    width: 36px;
                    height: 36px;
                    background: #ffffff1c;
                    border-radius: 12px 12px 12px 12px;
                    border: 1px solid #ffffff80;
                    line-height: 36px;
                    text-align: center;
                    position: absolute;
                    top: 9px;
                    left: 15px;
                    color: white;
                }

                .common_card {
                    background: linear-gradient(113.99deg, #114fee 6.12%, #b654fd 83.22%);
                    border-radius: 8px 8px 8px 8px;
                    padding: 17px;
                    margin-bottom: 20px;
                    margin-top: -73px;
                }

                .common_card .common_card_content {
                    border-radius: 8px;
                }

                p {
                    margin-top: 0;
                    margin-bottom: 0rem;
                }

                .card {
                    display: none;
                }

                .modal-content {
                    position: relative;
                    display: flex;
                    flex-direction: column;
                    width: 91%;
                    pointer-events: auto;
                    border: 0px solid rgba(0, 0, 0, 0.2);
                    outline: 0;
                }

                .mt-3 {
                    margin-top: 2rem !important;
                }

                .float-end {
                    float: left !important;
                }

                .menubar-area {
                    display: none;
                }

                .content-inner {
                    padding-top: 40px;
                    padding-bottom: 20px;
                    background: #9fd233;
                    margin-left: 15px;
                    border-radius: 10px;
                    margin-right: 15px;
                }

                .form-control {
                    height: 55px;
                    padding: 10px 25px;
                    font-size: 13px;
                    font-weight: 600;
                    color: #000000;
                    background: #ffffff;
                }

                .mb-1 {
                    margin-bottom: 0.25rem !important;
                    color: #ffffff;
                    font-size: 14px;
                    font-weight: bold;
                }

                .border-2 {
                    border-width: 1px !important;
                }

                .border-primary {
                    border-color: #0000004a !important;
                }

                .form-control:focus,
                .form-control:active,
                .form-control.active {
                    background: #ffffff;
                    color: #000;
                }
            </style>

            <div class="page-content">
                <div class="content-inner pt-0">
                    <div class="container fb">



                        <div class="modal-body pt-0">
                            <form action="" method="POST">
                                <?php echo csrf_field(); ?>

                                <img src="<?php echo e(asset('assets/app/img/bank-architecture-3d-icon-download-in-png-blend-fbx-gltf-file-formats-financial-institute-building.webp')); ?>"
                                    style="width: 144px;margin-top: -97px;margin-left: 101px;margin-bottom: -27px;">

                                <div class="form-group mt-2">
                                    <label class="mb-1">Holder Name</label>
                                    <input class="form-control rounded border border-2 border-primary" type="text"
                                        name="account_name" id="account_name" placeholder="Account Holder Name"
                                        required="">
                                </div>


                                <div class="form-group mt-2">
                                    <label class="mb-1">Account Number</label>
                                    <select class="form-select rounded border border-2 border-primary" name="bank_code"
                                        id="bank_name" required>
                                        <option value="">-- Select Bank --</option>
                                        <option value="GCASH">GCASH</option>
                                        <option value="PMP">PayMaya Philippines</option>
                                    </select>
                                </div>

                                <input type="hidden" name="bank_name" id="bank_code">

                                <div class="form-group mt-2">
                                    <label class="mb-1">Bank Account</label>
                                    <input type="text" maxlength="11"
                                        class="form-control rounded border border-2 border-primary" name="account_number"
                                        id="account" placeholder="Enter bank account" required="">
                                    <span class="text-muted" id="account" style="font-size:10px;"></span>
                                </div>
                                <button id="bank_button" type="submit" class="mt-3 btn rounded btn-primary p-2 float-end"
                                    style="background:#0600ff;padding: 14px !important;font-size: 131% !important;width: 100%;margin-left: 0px;border-color: #ffffff40;font-weight: 700;border-radius: 10px ! important;">Submit</button>
                            </form>

                        </div>


                    </div>
                </div>
            </div>



            <div class="title-bar mt-3">
                <p class="backbutton" onclick="navigate('/home/');">
                    <i class="fa-solid fa-chevron-left" style="color: white;"></i>
                </p>

                <div class="swiper-defult-pagination pagination-dots style-1 p-0"></div>
            </div>


            <style>
                .amount-btn {
                    width: 23% !important;
                    white-space: nowrap;
                    overflow-x: hidden;
                }

                .gateway:checked+label {
                    color: var(--primary);
                }

                input[type="radio"] {
                    width: 15px;
                    height: 15px;
                    accent-color: var(--primary);
                }

                input[type="radio"]:hover {
                    filter: brightness(1.1);
                }
            </style>





            <style>
                .menubar-area .toolbar-inner .nav-link.active:after,
                .menubar-area .toolbar-inner .menu-toggler.active:after {
                    content: "";
                    position: absolute;
                    bottom: -11px;
                    height: 5px;
                    background: #340166;
                }

                .menubar-area {
                    position: fixed;
                    bottom: 0;
                    left: 0;
                    width: 100%;
                    background: #fff;
                    padding: 20px;
                    z-index: 999;
                    padding-top: 12px !important;
                    padding-bottom: 10px !important;
                    border-radius: 8px 8px 0px 0px;
                    box-shadow: 0 12px 26px 0 rgba(0, 0, 0, 0.3);
                }

                a:hover,
                a:focus,
                .fa-solid,
                a.active,
                .fa-solid.active {
                    text-decoration: none;
                    outline: none;
                    color: var(--primary-hover);
                }
            </style>




        </div>
        <!--**********************************
                            Scripts
                        ***********************************-->






        <!-- Swiper -->
        <!-- Swiper -->



    </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();

                $.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();

                            $("#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/MAMP/htdocs/nissan/core/resources/views/templates/basic/user/bank-setup.blade.php ENDPATH**/ ?>