ILIAS
release_4-4 Revision
◀ ilDoc Overview
class.ilMailAddressbook.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
9
class
ilMailAddressbook
10
{
11
private
$user_id
= null;
12
13
public
function
__construct
()
14
{
15
global
$ilUser
;
16
17
$this->user_id = $ilUser->getId();
18
}
19
20
public
function
getAddressbookAsync
($search)
21
{
22
global $ilDB;
23
24
$ilDB->setLimit(0,20);
25
26
$query
=
27
'SELECT DISTINCT
28
abook.login login,
29
abook.firstname firstname,
30
abook.lastname lastname
31
FROM addressbook abook
32
WHERE abook.user_id = '
.$ilDB->quote($this->user_id,
'integer'
).
'
33
AND ( '
. $ilDB->like(
'abook.login'
,
'text'
, $search).
'
34
OR '
. $ilDB->like(
'abook.firstname'
,
'text'
, $search).
'
35
OR '
. $ilDB->like(
'abook.lastname'
,
'text'
, $search).
'
36
)'
;
37
38
$query_res = $ilDB->query(
$query
);
39
40
$result
= array();
41
42
while
(
$row
= $query_res->fetchRow(
DB_FETCHMODE_OBJECT
))
43
{
44
$tmp =
new
stdClass();
45
$tmp->value =
$row
->login;
46
47
$label =
$row
->login;
48
if
(
$row
->firstname &&
$row
->lastname)
49
{
50
$label .=
" ["
.
$row
->lastname .
", "
.
$row
->firstname .
"]"
;
51
}
52
$tmp->label = $label;
53
54
$result
[] = $tmp;
55
}
56
57
return
$result
;
58
}
59
}
60
?>
$result
$result
Definition:
CleanUpTest.php:407
ilMailAddressbook
Definition:
class.ilMailAddressbook.php:9
ilMailAddressbook\getAddressbookAsync
getAddressbookAsync($search)
Definition:
class.ilMailAddressbook.php:20
$query
$query
Definition:
examplelayouts.sql.php:24
DB_FETCHMODE_OBJECT
const DB_FETCHMODE_OBJECT
Definition:
class.ilDB.php:11
$row
$row
Definition:
examplelayouts.sql.php:26
ilMailAddressbook\$user_id
$user_id
Definition:
class.ilMailAddressbook.php:11
ilMailAddressbook\__construct
__construct()
Definition:
class.ilMailAddressbook.php:13
$ilUser
global $ilUser
Definition:
imgupload.php:15
Services
Contact
classes
class.ilMailAddressbook.php
Generated on Mon Dec 21 2020 19:01:11 for ILIAS by
1.8.13 (using
Doxyfile
)