You are here

function patron_email_autocomplete in Library 6

Same name and namespace in other branches
  1. 5.2 patron/patron.module \patron_email_autocomplete()

Retrieve a pipe delimited string of autocomplete suggestions for existing patron

1 string reference to 'patron_email_autocomplete'
patron_menu in patron/patron.module
Implementation of hook_menu()

File

patron/patron.module, line 367

Code

function patron_email_autocomplete($string) {
  $matches = array();
  $result = db_query_range("SELECT mail from {users} where status = 1 AND LOWER(mail) LIKE LOWER('%s%%')", check_plain($string), 0, 10);
  while ($patron = db_fetch_object($result)) {
    $matches[$patron->mail] = check_plain($patron->mail);
  }
  print drupal_to_js($matches);
  exit;
}