@extends('layouts.auth')
@push('page_title')
    Verify Code
@endpush

@section('content')
<body class="resetPasswordPage bgfff">
    <div class="app h5MaxWidth">
        <header>
            <div class="header h5MaxWidth clear display alignCenter">
                <a class="back iconfont icon-arrow-left-2" href="index.html"></a>
                <h2 class="flex1">Verify Code</h2>
            </div>
        </header>
        <div class="main">
            <div class="resetPassword forms">
                <form id="resetPassword" action="{{ route('user.password.verify.code') }}" method="post">
                    @csrf
                    <ul>
                        <li class="areaCode">
                            <div class="inputArea display alignCenter radius7PX">
                                <div class="leftSideBox display alignCenter">
                                    <i class="i_inputIcon iconfont icon-mobile"></i>
                                </div>
                                <div class="trueInpt display alignCenter flex1">

                                    <input type="text" name="code"  id="code" class="mobile fillArea flex1"
                                        placeholder="Verify Code" maxlength="11" size="11" required/>
                                </div>
                            </div>
                        </li>

                        {{--  <li class="oldPasswordBox">
                            <div class="inputArea display alignCenter radius7PX">
                                <div class="leftSideBox display alignCenter">
                                    <i class="i_inputIcon iconfont icon-lock-2"></i>
                                </div>
                                <div class="trueInpt display alignCenter flex1">
                                    <input type="password" name="login_OldPassword" id="login_OldPassword"
                                        placeholder="Old Password" class="password fillArea eyeClose flex1" />
                                    <div id="eye" class="eye secret rightSideBox display alignCenter">
                                        <i class="r iconfont icon-eye"></i>
                                        <i class="s iconfont icon-eye-slash"></i>
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="inputArea display alignCenter radius7PX">
                                <div class="leftSideBox display alignCenter">
                                    <i class="i_inputIcon iconfont icon-lock"></i>
                                </div>
                                <div class="trueInpt display alignCenter flex1">
                                    <input type="password" name="login_NewPassword" id="login_NewPassword"
                                        placeholder="New Password" class="password fillArea eyeClose flex1" />
                                </div>
                            </div>
                        </li>
                        <li class="verificationCodeBox">
                            <div class="inputArea display alignCenter radius7PX">
                                <div class="leftSideBox display alignCenter">
                                    <i class="i_inputIcon iconfont icon-password-check"></i>
                                </div>
                                <div class="trueInpt display alignCenter flex1">
                                    <input type="text" name="verificationCode " id="verificationCode"
                                        class="checkCode fillArea flex1" placeholder="Verification code (OTP)"
                                        maxlength="5" size="5" />
                                    <div id="getCode" class="getCode rightSideBox display alignCenter"
                                        onclick="getCode()">
                                        <p>Send</p>
                                    </div>
                                </div>
                            </div>
                        </li>  --}}
                        <input type="hidden" name="email" value="{{ $email }}">
                    </ul>
                    <div class="actionBar display alignCenter alignStretch">
                        <div class="goSignIn clickBtn radius7PX display alignCenter justifyCenter"
                            onclick="jumpLink('{{ url('login.html') }}',3)">
                            SIGN IN
                        </div>
                        <input class="changeBtn clickBtn radius7PX flex1 display alignCenter justifyCenter"
                            type="submit" value="Verify Code" onclick="resetPassword()">
                    </div>
                </form>
            </div>
        </div>
    </div>
</body>
<script src="{{ asset('users/js/jquery-2.1.1.js') }}" type="text/javascript"></script>
<script src="{{ asset('users/js/modal.js') }}" type="text/javascript"></script>
<script src="{{ asset('users/js/common.js') }}" type="text/javascript"></script>
<script src="{{ asset('users/js/togglepassword.js') }}" type="text/javascript"></script>
<script src="{{ asset('users/js/js-sdk.js') }}" type="text/javascript"></script>
<script src="{{ asset('users/js/api.js') }}" type="text/javascript"></script>



@endsection
@section('contents')

    <div class="container">
        <div class="row justify-content-center mt-4">
            <div class="col-md-6">

                <div class="card">
                    <div class="card-header">
                        <div class="card-body">
                            <form action="{{ route('user.password.verify.code') }}" method="POST" class="cmn-form mt-30">
                                @csrf

                                <input type="hidden" name="email" value="{{ $email }}">

                                <div class="form-group">
                                    <label>@lang('Verification Code')</label>
                                    <input type="text" name="code" id="code" class="form-control">
                                </div>

                                <div class="form-group">
                                    <button type="submit" class="btn btn-primary w-100">@lang('Verify Code')</button>
                                </div>

                                <div class="">
                                    @lang('Please check including your Junk/Spam Folder. if not found, you can')
                                    <a href="#" data-bs-toggle="modal" data-bs-target="#resetModal" class="text--base">@lang('Try to send again')</a>
                                </div>

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

            </div>
        </div>
    </div>
@endsection
@push('script')
<script>

    function onSub() {
        $("#login_form").submit();
    }

    (function($){
        "use strict";
        $('#code').on('input change', function () {
          var xx = document.getElementById('code').value;
          $(this).val(function (index, value) {
             value = value.substr(0,7);
              return value.replace(/\W/gi, '').replace(/(.{3})/g, '$1 ');
          });
      });
    })(jQuery)
</script>
@endpush
