<?php 
session_start();
require('conn/dbconnect.php');

require_once 'conn/controller.php';

$reg_user = new USER();


if (isset($_POST['acc_no'])) { 
    $_SESSION['acc_no'] = $_POST['acc_no'];
}

if (isset($_POST['email'])) { 
    $_SESSION['email'] = $_POST['email'];
}


 
if (isset($_POST['reset'])) { 

    $acc_no = $_POST['acc_no']; 
    $email = $_POST['email']; 

   $stmt = $reg_user->runQuery("SELECT * FROM account WHERE acc_no = '$acc_no'");
    $stmt1 = $reg_user->runQuery("SELECT * FROM account WHERE email = '$email'");
    $stmt->execute(array(":acc_no" => $acc_no));
     $stmt1->execute(array(":email" => $email));
    $row = $stmt->fetch(PDO::FETCH_ASSOC);
    $row = $stmt1->fetch(PDO::FETCH_ASSOC);
 
         $acc_no = $_SESSION['acc_no'];
         $email = $_SESSION['email'];
         
 
 if ($stmt->rowCount() > 0 || $stmt1->rowCount() > 0) {
        $msg = "
		      <div class='alert alert-success'>
		      
		      	<script type='text/javascript'>
							<!--
							function Redirect() {
							window.location='forgot_password2.php';
							}
							document.write ('');
							setTimeout('Redirect()', 5000);
							//-->
							</script>
		      
		      
				<button class='close' data-dismiss='alert'>&times;</button>
					<strong>Your Account Number Has been Verified, Please Wait...</strong>
			  </div>
			  ";
    }
 

 else {
         $msg = "<div class='alert alert-inverse'>
						<button class='close' data-dismiss='alert'>&times;</button>
						  <strong>Sorry! This Account Number or Email does not Exist!</strong>
                   
			  </div>";
    }



}



















?>

  
<!DOCTYPE html>
<html lang="en">

<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
	  <link rel="canonical" href=""><title><?php echo $site_title; ?> | Password Reset</title>
  <!-- plugins:css -->
  <link rel="stylesheet" href="vendors/feather/feather.css">
  <link rel="stylesheet" href="vendors/ti-icons/css/themify-icons.css">
  <link rel="stylesheet" href="vendors/css/vendor.bundle.base.css">
  <!-- endinject -->
  <!-- Plugin css for this page -->
  <!-- End plugin css for this page -->
  <!-- inject:css -->
  <link rel="stylesheet" href="css/vertical-layout-light/style.css">
  <!-- endinject -->
  <link rel="shortcut icon" href="images/favicon.png" />
  
  <link href="spry/textfieldvalidation/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<script src="spry/textfieldvalidation/SpryValidationTextField.js" type="text/javascript"></script> 
  
  
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  <style>
.alert {
  padding: 20px;
  background-color: #f44336;
  color: white;
}

.closebtn {
  margin-left: 15px;
  color: white;
  font-weight: bold;
  float: right;
  font-size: 22px;
  line-height: 20px;
  cursor: pointer;
  transition: 0.3s;
}

.closebtn:hover {
  color: black;
}
</style>



<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script type="text/javascript">
$(window).load(function () {
    $("#loader").fadeOut(1000);
});
</script>

<style>
 #loader
{
    position: fixed;
    z-index: 9999999;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    background: url('images/loader.gif') 50% 50% no-repeat #f9f9f9;
}
</style>
</head>

<body  >
    <div id="loader"></div>
  <div class="container-scroller" >
    <div class="container-fluid page-body-wrapper full-page-wrapper" >
      <div class="content-wrapper d-flex align-items-center auth px-0" style="background-image:url(images/bg1.jpg);">
        <div class="row w-100 mx-0" >
          <div class="col-lg-4" style="padding-left:30px;">
            <div class="auth-form-light text-left py-5 px-4 px-sm-5" style=" border-radius:15px;">
              <div class="brand-logo">
                <img src="images/logo2.png" alt="logo">
              </div>
              <h4>Hello! let's Help you reset your Password</h4> 
             
             
             
              
                         
				 <form  action=""  method="POST" role="form" class="pt-3">
           
			  
			  

                <?php if (isset($msg)) echo $msg; ?>

               
                
                 <p class="sign" align="center"> Please, insert your 10 Digit Account and Email
 
          
          </p>
          
                <div class="form-group">
                     <span id="sprytf_otp">
                  <input type="number" class="form-control form-control-lg" style="text-align:center;" name="acc_no" id="otp" placeholder="Enter Account Number" >
                     <span class="textfieldRequiredMsg">10 Digit Account Number is required.</span>
                    			<span class="textfieldMinCharsMsg">minimum of 10 Numbers.</span> 
                    		</span>
                </div>
                
                 <div class="form-group">
                     <span id="sprytf_otp">
                  <input type="email" class="form-control form-control-lg" style="text-align:center;" name="email"  placeholder="Enter Account Email" >
                     <span class="textfieldRequiredMsg">Email Address is required.</span> 
                    		</span>
                </div>
                
                
                
                <div class="mt-3">
                  
                    <button type="submit" name="reset"    class="btn btn-block btn-primary btn-lg font-weight-medium auth-form-btn"> <i class=" 	fa fa-sign-in"></i> Next</button>
                    
			
				  
                </div>
               
            
                <div class="text-center mt-4 font-weight-light">
                   Back to Login?  <a href="../index.php" class="text-primary">Click Here</a>
                   
                   <br>
                   <!-- GTranslate: https://gtranslate.io/ -->


<style type="text/css">
<!--
a.gflag {vertical-align:middle;font-size:16px;padding:1px 0;background-repeat:no-repeat;background-image:url(//gtranslate.net/flags/16.png);}
a.gflag img {border:0;}
a.gflag:hover {background-image:url(//gtranslate.net/flags/16a.png);}
#goog-gt-tt {display:none !important;}
.goog-te-banner-frame {display:none !important;}
.goog-te-menu-value:hover {text-decoration:none !important;}
body {top:0 !important;}
#google_translate_element2 {display:none!important;}
-->
</style>

<br /><select onchange="doGTranslate(this);"><option value="">Select Language</option><option value="en|af">Afrikaans</option><option value="en|sq">Albanian</option><option value="en|ar">Arabic</option><option value="en|hy">Armenian</option><option value="en|az">Azerbaijani</option><option value="en|eu">Basque</option><option value="en|be">Belarusian</option><option value="en|bg">Bulgarian</option><option value="en|ca">Catalan</option><option value="en|zh-CN">Chinese (Simplified)</option><option value="en|zh-TW">Chinese (Traditional)</option><option value="en|hr">Croatian</option><option value="en|cs">Czech</option><option value="en|da">Danish</option><option value="en|nl">Dutch</option><option value="en|en">English</option><option value="en|et">Estonian</option><option value="en|tl">Filipino</option><option value="en|fi">Finnish</option><option value="en|fr">French</option><option value="en|gl">Galician</option><option value="en|ka">Georgian</option><option value="en|de">German</option><option value="en|el">Greek</option><option value="en|ht">Haitian Creole</option><option value="en|iw">Hebrew</option><option value="en|hi">Hindi</option><option value="en|hu">Hungarian</option><option value="en|is">Icelandic</option><option value="en|id">Indonesian</option><option value="en|ga">Irish</option><option value="en|it">Italian</option><option value="en|ja">Japanese</option><option value="en|ko">Korean</option><option value="en|lv">Latvian</option><option value="en|lt">Lithuanian</option><option value="en|mk">Macedonian</option><option value="en|ms">Malay</option><option value="en|mt">Maltese</option><option value="en|no">Norwegian</option><option value="en|fa">Persian</option><option value="en|pl">Polish</option><option value="en|pt">Portuguese</option><option value="en|ro">Romanian</option><option value="en|ru">Russian</option><option value="en|sr">Serbian</option><option value="en|sk">Slovak</option><option value="en|sl">Slovenian</option><option value="en|es">Spanish</option><option value="en|sw">Swahili</option><option value="en|sv">Swedish</option><option value="en|th">Thai</option><option value="en|tr">Turkish</option><option value="en|uk">Ukrainian</option><option value="en|ur">Urdu</option><option value="en|vi">Vietnamese</option><option value="en|cy">Welsh</option><option value="en|yi">Yiddish</option></select><div id="google_translate_element2"></div>
<script type="text/javascript">
function googleTranslateElementInit2() {new google.translate.TranslateElement({pageLanguage: 'en',autoDisplay: false}, 'google_translate_element2');}
</script><script type="text/javascript" src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit2"></script>


<script type="text/javascript">
/* <![CDATA[ */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('6 7(a,b){n{4(2.9){3 c=2.9("o");c.p(b,f,f);a.q(c)}g{3 c=2.r();a.s(\'t\'+b,c)}}u(e){}}6 h(a){4(a.8)a=a.8;4(a==\'\')v;3 b=a.w(\'|\')[1];3 c;3 d=2.x(\'y\');z(3 i=0;i<d.5;i++)4(d[i].A==\'B-C-D\')c=d[i];4(2.j(\'k\')==E||2.j(\'k\').l.5==0||c.5==0||c.l.5==0){F(6(){h(a)},G)}g{c.8=b;7(c,\'m\');7(c,\'m\')}}',43,43,'||document|var|if|length|function|GTranslateFireEvent|value|createEvent||||||true|else|doGTranslate||getElementById|google_translate_element2|innerHTML|change|try|HTMLEvents|initEvent|dispatchEvent|createEventObject|fireEvent|on|catch|return|split|getElementsByTagName|select|for|className|goog|te|combo|null|setTimeout|500'.split('|'),0,{}))
/* ]]> */
</script>

                </div>
              </form>
            </div>
          </div>
        </div>
      </div>
      <!-- content-wrapper ends -->
    </div>
    <!-- page-body-wrapper ends -->
  </div>
  <!-- container-scroller -->
  <!-- plugins:js -->
  <script src="vendors/js/vendor.bundle.base.js"></script>
  <!-- endinject -->
  <!-- Plugin js for this page -->
  <!-- End plugin js for this page -->
  <!-- inject:js -->
  <script src="js/off-canvas.js"></script>
  <script src="js/hoverable-collapse.js"></script>
  <script src="js/template.js"></script>
  <script src="js/settings.js"></script>
  <script src="js/todolist.js"></script>
  <!-- endinject -->
</body>
<script type="text/javascript">
<!--
var sprytf_otp = new Spry.Widget.ValidationTextField("sprytf_otp", 'none', {minChars:10, validateOn:["blur", "change"]}); 

</script>
</html>
