<?php
   include('session.php');
   include('header1.php');
   include('ietpartial.php');

// start role specific 
$user_role = $_SESSION['role'];

if ($_SERVER["REQUEST_METHOD"] == "GET") {

  $userid = $_GET['userid'];

  $sqlGetUser = "SELECT * FROM users WHERE userid = $userid";

  $resultUser = mysqli_query($db,$sqlGetUser);

  $countUser = mysqli_num_rows($resultUser);

  echo "<main role=\"main\" class=\"col-md-9 ml-sm-auto col-lg-10 px-4\">";

  echo "<div class=\"d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom\">";

  if ($countUser !== 0) { 

  	while ($rowUser = mysqli_fetch_array($resultUser)) {

    	echo "<h1 class=\"h2\">Change Password - " . $rowUser['username'] . "</h1>";
      echo "<a href=\"usersmanagement.php\" class=\"btn btn-sm btn-outline-secondary\" role=\"button\">Back</a>";
    
    	echo "</div>";

    	echo "<form method = \"POST\" action=\"changePassword1.php\">";

    	echo "<input type = \"hidden\" value = \"" . $userid . "\" name = \"userid\">";

          echo "<p>New Password*
                <input type=\"password\" name=\"password\" required class=\"form-control\"> 
              </p>";

    }

    echo "<input type=\"submit\"> </form>";

   }

} 


include('footer1.php');
?>