X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=lib%2Fcontact.php;h=051f291b3daf017cdb63958909dd542bbf49c15d;hb=refs%2Ftags%2Fuat-2013-10-15;hp=25aab5883a817b4499cad0e846f4edf1bfef12e1;hpb=56f5e034aebe1b00dbd1cc976fd165d03420c632;p=readifood.git diff --git a/lib/contact.php b/lib/contact.php index 25aab58..051f291 100644 --- a/lib/contact.php +++ b/lib/contact.php @@ -85,6 +85,23 @@ } else echo "none"; echo "
\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 "Contacts in address '" . htmlspecialchars($search) . "':"; + if (count($contacts)) { + foreach ($contacts as $contact) show_contact_summary($contact); + } + else echo "none"; + echo "
\n"; } function show_city_contacts($offset, $per_page, $city_name, $city_id = null) { @@ -263,7 +280,13 @@ /* Postcode. */ echo "