<?php 
include("header.php");
$msg="";$msg1="";
if(isset($_GET['email']))
{
	$email=base64_decode($_GET['email']);
	
	if(isset($_POST['change']))
	{
		$pass=md5($_POST['password']);
		
		$update=mysql_query("update tbl_users set password='$pass' where email='$email'");
		
		$msg="Password changed successfully";
		
		
		?>
			<script>
            	setTimeout(function(){
				window.location="<?php $actual_link;?>login";
				},3000);
            </script>
		<?php
	}
}
?>
 
<div class="main-container">
<div class="container">
<div class="row">
<div class="col-sm-5 login-box">
<?php 
if($msg!=="")
{
	?>
		<div class="alert alert-success">
        <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
        	<?php echo $msg;?>
        </div>
	<?php
}
?>

<div class="panel panel-default">
<div class="panel-intro text-center">
<h2 class="logo-title">
 
<span class="logo-icon"><i class="icon icon-search-1 ln-shadow-logo shape-0"></i> </span> Exchangekarde.com </h2>
</div>
<div class="panel-body">
<form role="form" method="post">
<div class="form-group">
<label for="sender-email" class="control-label">Password:</label>
<div class="input-icon"> <i class="icon-user fa"></i>
<input id="sender-email" type="password" name="password" placeholder="Password" class="form-control password" required>
</div>
</div>
<div class="form-group">
<label for="sender-email" class="control-label">Confirm Password:</label>
<div class="input-icon"> <i class="icon-user fa"></i>
<input id="sender-email" type="password" name="confirm_password" placeholder="Confirm Password" class="form-control password" required>
</div>
</div>
<h5></h5>
<div class="form-group">
<button type="submit" name="change" class="btn btn-primary btn-lg btn-block change">Change</button>
</div>
</form>
</div>
<div class="panel-footer">
<p class="text-center "> <a href="login"> Back to Login </a> </p>
<div style=" clear:both"></div>
</div>
</div>
<div class="login-box-btm text-center">
<p> Don't have an account? <br>
<a href="signup"><strong>Sign Up !</strong> </a> </p>
</div>
</div>
</div>
</div>
</div>
 
<?php include("footer.php");?>

<script>
$("input[name='confirm_password']").focusout(function(){
if($("input[name='confirm_password']").val()=="")
{
	$("h5").html("<strong>Please Enter Confirm Password</strong>");
	return false();
}


if($("input[name='confirm_password']").val()==$("input[name='password']").val())
{
	$("h5").html("<strong>Password Match</strong>");
	$("button[type='submit']").attr("disabled",false);
}
else
{
	$("h5").html("<b>Password Does Not Match</b>");
	$("button[type='submit']").attr("disabled",true);
	
}


});
</script>