<?php 
include 'config/config.php';
include 'config/function.php';
?>
<html lang="en">

<head>

	<title>Forgot Password : <?php echo get_company(); ?></title>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="description" content="" />
	<meta name="keywords" content="">
	<meta name="author" content="Phoenixcoded" />
	<!-- Favicon icon -->
	<link rel="icon" href="assets/images/icon.ico" type="image/x-icon">

	<!-- vendor css -->
	<link rel="stylesheet" href="assets/css/style.css">
	
	


</head>

<!-- [ auth-signin ] start -->
<div class="auth-wrapper">
	<div class="auth-content text-center">
		<img src="assets/images/logo.png" alt="" class="img-fluid mb-4">
		<div class="card borderless">
			<div class="row align-items-center ">
				<div class="col-md-12">
					<div class="card-body">
						<h4 class="mb-3 f-w-400">Reset Password </h4>
						<hr>
						<div class="form-group ">
						     <label class="floating-label" for="associateId">Associate Id</label>
							<input type="text" class="form-control" id="associateId" name="associateId" placeholder="Associate Id" maxLength="10" style="text-transform: uppercase;">
						</div>
						<div class="form-group mb-4">
						      <label class="floating-label" for="associateId">Contact No</label>
							<input type="text" class="form-control" id="contactNo" placeholder="Contact No" maxLength="10" onkeydown="return ( event.ctrlKey || event.altKey || (47<event.keyCode &amp;&amp; event.keyCode<58 &amp;&amp; event.shiftKey==false) || (95<event.keyCode &amp;&amp; event.keyCode<106) || (event.keyCode==8) || (event.keyCode==9) || (event.keyCode>34 &amp;&amp; event.keyCode<40) || (event.keyCode==46) )">
						</div>
						
						<button class="btn btn-block btn-primary mb-4 btnpass" type="button" onClick="ResetPassword();" >Submit</button>
						<hr>
						<p class="mb-2 text-muted">Have and Accounr? <a href="Login" class="f-w-400">Login</a></p>

					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- [ auth-signin ] end -->

<!-- Required Js -->
<script src="assets/js/vendor-all.min.js"></script>
<script src="assets/js/plugins/bootstrap.min.js"></script>

<script src="assets/js/pcoded.min.js"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script>
    function ResetPassword()
    {
        var associateId=$.trim($("#associateId").val());
        var contactNo=$.trim($("#contactNo").val());
        if(associateId.length!=10)
        {
            swal("Invalid Associate Id");
            return;
        }
        else if(contactNo.length!=10)
        {
            swal("Invalid Contact No");
            return;
        }
        else
        {
            $(".btnpass").attr("disabled", true);
            $(".btnpass").html("Processing...<i class='fa fa-refresh fa-spin'></i>");
            var dataString = 'associateId='+ associateId+'&contactNo='+contactNo;
    		$.ajax
    		({
    			type: "POST",
    			url: "ResetPassword.php",
    			data: dataString,
    			cache: false,
    			success: function(data)
    			{
    			    console.log(data);
    				swal(data);
    				
    			} 
    		});
        }
    }
</script>
</body>

</html>
