Get completion list.
{
include_once './Services/JSON/classes/class.ilJsonUtil.php';
$result = new stdClass();
$result->response = new stdClass();
$result->response->results = array();
if (strlen($a_str) < 3)
{
}
include_once './Services/User/classes/class.ilUserAccountSettings.php';
{
include_once './Services/User/classes/class.ilUserFilter.php';
$query =
"SELECT login, firstname, lastname FROM usr_data ".
"WHERE (".
$ilDB->like("login", "text", $a_str."%")." OR ".
$ilDB->like("firstname", "text", $a_str."%")." OR ".
$ilDB->like("lastname", "text", $a_str."%").
"ORDER BY login ";
}
else
{
$set = $ilDB->query("SELECT login, firstname, lastname FROM usr_data WHERE ".
$ilDB->like("login", "text", $a_str."%")." OR ".
$ilDB->like("firstname", "text", $a_str."%")." OR ".
$ilDB->like("lastname", "text", $a_str."%").
" ORDER BY login");
}
$max = 20;
$cnt = 0;
while (($rec = $ilDB->fetchAssoc($set)) && $cnt < $max)
{
$result->response->results[$cnt] = new stdClass();
$result->response->results[$cnt]->login = $rec["login"];
$result->response->results[$cnt]->firstname = $rec["firstname"];
$result->response->results[$cnt]->lastname = $rec["lastname"];
$cnt++;
}
}