'That license no longer exists.']); exit; } $client_id = intval($row['software_client_id']); enforceClientAccess(); $seats_total = intval($row['software_seats']); $holders = softwareSeatHolders($software_id); $asset_ids = array_map('intval', array_column($holders['assets'], 'asset_id')); $contact_ids = array_map('intval', array_column($holders['contacts'], 'contact_id')); $asset_options = []; $sql = mysqli_query($mysqli, "SELECT asset_id, asset_name, asset_type, asset_make, asset_model, contact_name FROM assets LEFT JOIN contacts ON contact_id = asset_contact_id WHERE asset_client_id = $client_id AND asset_archived_at IS NULL ORDER BY asset_name ASC"); while ($option = mysqli_fetch_assoc($sql)) { $asset_options[] = $option; } $contact_options = []; $sql = mysqli_query($mysqli, "SELECT contact_id, contact_name, contact_title, contact_photo, contact_client_id FROM contacts WHERE contact_client_id = $client_id AND contact_archived_at IS NULL ORDER BY contact_name ASC"); while ($option = mysqli_fetch_assoc($sql)) { $contact_options[] = $option; } // Start on users for a per-user license, devices otherwise $users_first = in_array($row['software_license_type'], ['User', 'Subscription', 'Concurrent'], true); ob_start(); ?>