<link rel="stylesheet" href="../css/sweet-alert.css" /> 


<?php
require ("../connection.php");
require ("../user.php");
$us=$_REQUEST['user_id'];

//$user=$_SESSION['id'];
$username=$_SESSION['user_name'];




	$password1=$_POST["password1"];
	$date=date("Y-m-d h:i:s");	
	$password=md5($password1);
		
	$n=mysqli_query($con,"update user_master set password='$password' where user_id='$us'");

//echo "update user_master set password='$password' where user_id='$us'";

if($n)
	{
	?>
	<script>
    setTimeout(function() {
		swal({
            title: "Successfully",
            text: "Password Reseted",
            type: "success"
        }, function() {
		
         window.location = "../master/user_master.php";
        });
    }, 100);
</script>  
    <?php
	}	
	else
	{
	?>
	<script>
    setTimeout(function() {
        swal({
            title: "Not",
            text: "Password Reseted",
            type: "error"
        }, function() {
			
          window.location = "../change_password/reset_password.php";
        });
    }, 100);
</script> 	  
	<?Php
}
?>
     <script src="../js/sweet-alert.js"></script>
   
       