@include('layout.header')
<div class="recharge">
    <!-- HEADER -->
    <nav class="top_nav">
        <div class="left">
            <a href="{{ url('/user/bankCard') }}"><img src="{{ asset('assets/img/back_arrow.png') }}" alt="" />
            </a>
            <span>Edit Bank Card</span>
        </div>
    </nav>
    <!-- HEADER -->

    <form action="{{ url('/user/update/bankCard') }}" method="post">
        @csrf
        <input type="hidden" name="id" value="{{ $card->id }}">
        <div class="input_card">
            <ul class="card_ul list-unstyled">
                <li>
                    <p>Actual Name</p>
                    <input type="text" name="name" required value="{{ $card->name }}" />
                </li>
                <li>
                    <p>UPI Id</p>
                    <input type="text" name="upi" required value="{{ $card->upi }}" />
                </li>
                <li>
                    <p>IFSC Code</p>
                    <input type="text" name="ifsc" required value="{{ $card->ifsc }}" />
                </li>
                <li>
                    <p>Bank Name</p>
                    <input type="text" name="bank_name" required value="{{ $card->bank_name }}" />
                </li>
                <li>
                    <p>Bank Account</p>
                    <input type="text" name="account" required value="{{ $card->account }}" />
                </li>
                <li>
                    <p>State/Territory</p>
                    <input type="text" name="state" required value="{{ $card->state }}" />
                </li>
                <li>
                    <p>City</p>
                    <input type="text" name="city" required value="{{ $card->city }}" />
                </li>
                <li>
                    <p>Address</p>
                    <input type="text" name="address" required value="{{ $card->address }}" />
                </li>
                <li>
                    <p>Mobile Number</p>
                    <div>
                        <span>+91</span><input type="text" name="mobile_number" required
                            value="{{ $card->mobile }}" />
                    </div>
                </li>
                <li>
                    <p>Email</p>
                    <input type="text" name="email" required value="{{ $card->email }}" />
                </li>
                @if (env('ENABLE_OTP'))
                    <li>
                        <p>Code</p>
                        <div style="display: flex">
                            <input type="text" id="login_otp" onkeyup="checkBankAccountOtp(this.value)"
                                onchange="checkBankAccountOtp(this.value)" oninput="checkBankAccountOtp(this.value)"
                                disabled placeholder="Verification Code" style="flex: 1 1 0%" />
                            <input class="gocode m-t-12 m-b-12" type="button" onclick="sendBankAccountOtp()"
                                id="reg_otp" value="OTP" />
                        </div>
                        <div>
                            <span id="otp_error" class="error"></span>
                        </div>
                    </li>
                @endif
            </ul>

            <div class="container-fluid pb-5 pt-4">
                <div class="row">
                    <div class="col-10 col-md-8 col-lg-6 mx-auto">
                        <input type="submit" id="submit" class="w-100 btn btn-primary"
                            @if (env('ENABLE_OTP')) disabled="disabled" @endif value="Continue" />
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>


<script>
    let mobile = "{{ Auth::user()->mobile }}";
</script>

@include('layout.footer')
