diff --git a/admin_role.php b/admin_role.php index db315d07..d59c2c4e 100644 --- a/admin_role.php +++ b/admin_role.php @@ -21,7 +21,7 @@ $sql = mysqli_query( $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); ?> -
Roles are still in development. Permissions may not be fully enforced.
+
Roles are still in development. Permissions may not be fully enforced.
@@ -54,22 +54,15 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - Name - - - - - Description + Role + Members Admin - - User count - Action @@ -87,16 +80,32 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); $sql_role_user_count = mysqli_query($mysqli, "SELECT COUNT(users.user_id) FROM users LEFT JOIN user_settings on users.user_id = user_settings.user_id WHERE user_role = $role_id AND user_archived_at IS NULL"); $role_user_count = mysqli_fetch_row($sql_role_user_count)[0]; + $sql_users = mysqli_query($mysqli, "SELECT * FROM users LEFT JOIN user_settings on users.user_id = user_settings.user_id WHERE user_role = $role_id AND user_archived_at IS NULL"); + // Initialize an empty array to hold user names + $user_names = []; + + // Fetch each row and store the user_name in the array + while($row = mysqli_fetch_assoc($sql_users)) { + $user_names[] = nullable_htmlentities($row['user_name']); + } + + // Convert the array of user names to a comma-separated string + $user_names_string = implode(",", $user_names) ; + + if (empty($user_names_string)) { + $user_names_string = "-"; + } + ?> - -
+
+ +
- + -