/home/techb158/workloadmatch.com/Admin
Edit: /home/techb158/workloadmatch.com/Admin/roles_ajax.php (1007B)
prepare("SELECT role_name FROM roles WHERE role_id = ?");
$stmt->bind_param('i', $rid);
$stmt->execute();
$stmt->bind_result($name);
$stmt->fetch();
echo htmlspecialchars($name ?: 'Unknown');
$stmt->close();
exit;
}
if (isset($_GET['get_permissions'])) {
$rid = (int)$_GET['get_permissions'];
$stmt = $mysqli->prepare("SELECT module, can_view, can_create, can_edit, can_delete, can_enable, can_disable FROM role_permissions WHERE role_id = ?");
$stmt->bind_param('i', $rid);
$stmt->execute();
$result = $stmt->get_result();
$data = [];
while ($row = $result->fetch_assoc()) {
$data[] = $row;
}
echo json_encode($data);
$stmt->close();
exit;
}