<?php require 'lock.php' ?>
<?php
$error="";

if(isset($_REQUEST['usergetadd']))
{
$new_password = mysqli_real_escape_string($con, $_POST['new_password']);
$new_passwordupdate = md5($new_password);
$updatesql ="UPDATE `user_master` SET `user_password`='$new_passwordupdate' WHERE user_id='$user_id'";	
mysqli_query($con, $updatesql);	

$error="Your password has been changed successfully.";
}
?>
<!DOCTYPE html>
<html lang="en">
<?php require 'head.php'; ?>
<body>
    <!-- Loader starts-->
    <div class="loader-wrapper">
      <div class="theme-loader">    
        <div class="loader-p"></div>
      </div>
    </div>
    <!-- Loader ends-->
    <!-- page-wrapper Start-->
    <div class="page-wrapper" id="pageWrapper">
      <?php include 'top.php'; ?>
      <!-- Page Header Ends                              -->
      <!-- Page Body Start-->
      <div class="page-body-wrapper horizontal-menu">
        <?php include 'header.php'; ?>
        <!-- Page Sidebar Ends-->
        <div class="page-body">
          <div class="container-fluid">
            <div class="page-header">
              <div class="row">
                <div class="col-sm-6">
                  <h3> Change Password </h3>
                  <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="index">Home</a></li>
                    <li class="breadcrumb-item active"> Change Password </li>
                  </ol>
                </div>
                <div class="col-sm-6">
                </div>
              </div>
            </div>
          </div>
          <!-- Container-fluid starts-->
           <div class="container-fluid">
            <div class="edit-profile">
              <div class="row">
			  
			   <div class="col-md-12 project-list">
                <div class="card">
                  <div class="row">
                    <div class="col-md-8 p-0">
                    </div>
                    
                  </div>
                </div>
              </div>
                
                <div class="col-xl-12">
                  <form class="card" method="post" >
                    <div class="card-body">
                      <div class="row">
      
						<div class="col-sm-6 col-md-6">
                          <div class="mb-3">
                            <label class="form-label">New Password <sup class="text-danger">*</sup></label>
                            <input class="form-control" type="password" placeholder="******" name="new_password" required>
                          </div>
                        </div>
						
                      </div>
                    </div>
                    <div class="card-footer text-end">
                      <button class="btn btn-primary" name="usergetadd" type="submit"> Submit </button>
                    </div>
                    
                    	<?php
				if($error)
				{
				?>
				<div class="m-t-2"><p class="text-danger"><?php echo $error; ?></p></div>
				<?php
				}
				?>
				
				
                  </form>
                </div>
              </div>
            </div>
          </div>
          <!-- Container-fluid Ends-->
        </div>
        
		<?php include 'footer.php'; ?>
  </body>
</html>