@@ -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 = "-";
+ }
+
?>