- $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);
+ $q = new ContactQuery;
+ $contacts = $q->filterByAddressId($address_ids)->orderByForename()->orderBySurname()->orderById('desc')->paginate($first_page, $per_page);
+ echo "<p>Contacts in address '" . htmlspecialchars($search) . "':";
+ if (count($contacts)) {
+ foreach ($contacts as $contact) show_contact_summary($contact);
+ show_pagination($contacts);
+ }