<?php $this->load->view('top');
$adminRes = get_site_email();  ?>

<div class="page_breadcrumbs">
		<div class="container">
			<ul>
      <li><a href="<?=site_url();?>" title="Home">Home</a>
            </li>
            <li>Forgot Password</li>
			</ul>
		</div>
	</div>
 <style>   
#sty2{display: none} 
#sty3{display: none} 
</style> 

<div class="container"> 
    

    <div class="row justify-content-md-center innerRegter registerform-style">
      
      <div class="col p-4 p-lg-5 login-form">

        <div class="col-lg-4 col-md-4">
          <div class="panel-lite">
          <div class="thumbur">
          <i class="fa fa-user"></i>
          </div>
          	<h4 id="forget_heading">Forgot Passwords ?</h4>
          <?php
            echo form_open_multipart('users/forgotten_password/', 'id="data_form"');
               
            ?>
                 <br/>
              <p class="text-center" id="forgetstatus"></p>
              <div id="sty1">
                <div class="form-group">
                    <label>Email Id/Mobile Number</label>
                    <input class="form-control" name="email" id="username" type="text" required="" value="<?php echo set_value('email'); ?>" autocomplete="off">
                </div>
          <button type="submit" class="login_btn_1" id="forget_pass">Submit</button>
              </div>
              <div id="sty2">
                      <div class="form-group">
                <div class="divOuter_otp">
                <div class="divInner_otp">
                    <input type="text" class="chk_otp" id="otp" name="otp"  maxlength="6" minlength="6" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');">
              </div>
          </div>
                     </div>
                     <input type="submit" class="login_btn_1 btn btn-modal-style" id="otp_auth_verify" value="Verify OTP">
                     <a href="#" id="resendotp_for">RESEND OTP</a> 
              </div>
              <div id="sty3">
                   <div class="form-group">
                    <label>Enter New Password</label>
                    <input class="form-control" name="forgetpassword" id="forgetpassword" type="password" required="" autocomplete="off">
                </div>
                <button type="submit" class="login_btn_1" id="newforget_pass">Submit</button>
              </div>
        
          <?php echo form_close();?>
          </div>
          </div>
      </div>  
    </div>
  </div>

<script src="https://code.jquery.com/jquery-3.3.1.js" ></script>
<script>
     $('#resendotp_for').click(function(e) {
        e.preventDefault();
            $.ajax({
            url: "<?=site_url();?>users/forget_resendotp",
            type: "POST",
            success: function(data) {
                if (data == 'success') {
    
                     $('#forgetstatus').html('<div class="alert alert-success"> Please Type the Resend Verification Code sent to <?=$this->session->userdata('mobnumber');?></div>');
                    
                } 
            }

        });
    });
    
</script>
<?php $this->load->view('bottom'); ?>