<?php
session_start();
$activePage = 'configuration';
$activeSubPage = 'roles';
include("../configuration/role_list.php");
include("../configuration/role_delete.php");
include("../configuration/role_function.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>roles</title>
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/roles.css">
</head>
<body>
    <div class="role_container">
    <div class="button">
        <button type="submit"> <a href="create_role.php">Create new role</a></button>
    </div>
    </div>
<div class="user_container">

<!-- Main content -->
<maincontent>
  <div class="usertable">
      <h3>Role List</h3>
      <div class="userdetails">
<table id="user_table">
                <thead>
                    <tr>
                        <th data-column="pid" data-order="desc" class="sortable">Name</th>
                        <th data-column="notes" data-order="desc" class="sortable">Description</th>
                        <th data-column="parent_id" data-order="desc" class="sortable">Parent Role</th>
                        <th data-column="max_nodes_per_pid" data-order="desc" class="sortable">Max nodes per user</th>
                        <th>Modify</th>
                        <th>Delete</th>
                    </tr>
                </thead>
                <tbody>
                    <?php  displayRoles($user_list);?>
                </tbody>
    </table>
    <form id="pid_form" action="./role_edit.php" method="POST" style="display: none;">
                <input type="hidden" name="id" id="pid_input">
     </form>
      </div>
  </div>
</maincontent>
</div>
<div id="popup" class="popup">
  <div class="popup-content">
    <p id="popup-message"></p>
    <button id="confirm-button" class="confirm-button">Yes</button>
    <button id="cancel-button" class="confirm-button">No</button>
  </div>
</div>
<script src="../js/role_delete.js"></script>
</body>
</html>