RMM Providers > a provider's clients - link one of them to an ITFlow client, or to * another one. The client of the same name is picked to start with. Saved by link_rmm_client * (admin/post/rmm.php), which brings its devices in straight away. */ require_once '../../includes/modal_header.php'; $row = rmmClientRow($_GET['id'] ?? 0); if (!$row) { echo json_encode(['error' => 'That RMM client is gone - sync again.']); exit; } $name = rmmProviderName($row); $rmm_client_id = intval($row['rmm_client_id']); $current = intval($row['rmm_client_client_id']); $picked = $current ?: (rmmClientSuggestions(intval($row['rmm_client_provider_id']))[$rmm_client_id] ?? 0); // Every other client of this provider linked to each ITFlow client, so the picker can say so $linked_to = []; $sql = mysqli_query($mysqli, "SELECT rmm_client_client_id, rmm_client_name FROM rmm_clients WHERE rmm_client_provider_id = " . intval($row['rmm_client_provider_id']) . " AND rmm_client_client_id > 0 AND rmm_client_id <> $rmm_client_id AND rmm_client_removed_at IS NULL"); while ($linked = mysqli_fetch_assoc($sql)) { $linked_to[intval($linked['rmm_client_client_id'])][] = $linked['rmm_client_name']; } $clients = mysqli_query($mysqli, "SELECT client_id, client_name, client_abbreviation FROM clients WHERE client_archived_at IS NULL OR client_id = $current ORDER BY client_name ASC"); $devices = intval($row['rmm_client_devices']); ob_start(); ?>