Phone Systems > a system's domains - link one to a client, or to another one. The * client it looks like is picked to start with. Saved by link_phone_domain (admin/post/phone.php), * which matches its calls again. */ require_once '../../includes/modal_header.php'; $row = phoneDomainRow($_GET['id'] ?? 0); if (!$row) { echo json_encode(['error' => 'That domain is gone.']); exit; } $phone_domain_id = intval($row['phone_domain_id']); $current = intval($row['phone_domain_client_id']); $picked = $current ?: (phoneDomainSuggestions(intval($row['phone_system_id']))[$phone_domain_id] ?? 0); $own = intval($config_internal_client_id ?? 0); $clients = mysqli_query($mysqli, "SELECT client_id, client_name, client_abbreviation FROM clients WHERE (client_archived_at IS NULL OR client_id = $current)" . clientNotLeadSql($current) . " ORDER BY client_name ASC"); ob_start(); ?>