<?php
session_start();
$activePage = 'User';
$acesslevel = $_SESSION['acesslevel'];

if (isset($_SESSION['token'])) {
    include("../elements/login_function.php");

    // Check for combined access levels first
    if ($acesslevel == "User Manager" && $acesslevel == "Node Manager") {
        include("../elements/user_node_master.php");
    } else {
        switch ($acesslevel) {
            case "ALL":
                include("../elements/master.php");
                break;
            case "NONE":
                include("index.php");
                break;
            case "User Manager":
                include("../elements/user_manager_master.php");
                break;
            case "Node Manager":
                include("../elements/node_master.php");
                break;
            default:
                echo 'hello';
                break;
        }
    }
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Create User</title>
    <link rel="stylesheet" href="../css/style.css" type="text/css">
    <link rel="stylesheet" href="../css/create_password.css" type="text/css">
    <link rel="stylesheet" href="../css/create_user.css" class="text/css">
</head>
<body>
<div class="user_container">
<maincontent>
<div class="usertable">
      <h3>Change Password</h3>

  <div class="userdetails">
     <form action="change_password_function.php" class="form" id="createUserForm" method="POST">
    <div>
        <div class="col-10">
        <label>USER ID</label>
        </div>
        <div class="col-40">
        <input type="text" name="pid" placeholder="#" value="<?php echo $_SESSION['username']; ?>" required  disabled/>
        </div>
        <div class="col-10">
        <label>C PASSWORD</label>
        </div>
        <div class="col-40">
        <input type="text" name="pid" placeholder="#" value="<?php echo $_SESSION['password']; ?>" required  disabled/>
        </div>
    </div>

    <div>
        <div class="col-10">
        <label>PASSWORD</label>
        </div>
        <div class="col-40">
        <input type="text" name="password" placeholder="Enter User Password"  required />
        </div>
        <div class="col-10">
        <label>PASSWORD</label>
        </div>
        <div class="col-40">
        <input type="text" name="password_two" placeholder="Re-Enter Password" required />
        </div>
    </div>


        <div class="col-10-submit">
        <input type="submit" name="submit" id="submit3" value="submit" />
        </div>
       
      
      </form>
      </div>

</div>
    </maincontent>
</div>

<?php
if(!isset($_SESSION['token'])) {
    include('token_exp.php');
}
?>
<script src="../js/bell.js"></script>

</body>
</html>