}
else echo "none";
echo "</p>\n";
+
+ $address_ids = array();
+ $q = new AddressQuery;
+ $addresses = $q->filterByLine("%$search%")->find();
+ foreach ($addresses as $address) $address_ids[] = $address->getId();
+ $q = new AddressQuery;
+ $addresses = $q->filterByPostcode("%$search%")->find();
+ foreach ($addresses as $address) $address_ids[] = $address->getId();
+
+ $q = new ContactQuery;
+ $contacts = $q->filterByAddressId($address_ids)->find();
+ echo "<p>Contacts in address '" . htmlspecialchars($search) . "':";
+ if (count($contacts)) {
+ foreach ($contacts as $contact) show_contact_summary($contact);
+ }
+ else echo "none";
+ echo "</p>\n";
}
function show_city_contacts($offset, $per_page, $city_name, $city_id = null) {