17 public static function getData(array $arr_usr_ids = array(), array
$options = array())
22 if (count($arr_usr_ids) == 0) {
59 FROM ' . $DIC->database()->quoteIdentifier(
'usr_data') .
61 self::createWhereStatement($arr_usr_ids,
$options[
'filters']);
64 $result = $DIC->database()->query($select);
66 return $DIC->database()->numRows(
$result);
70 $select .=
" ORDER BY " .
$options[
'sort'][
'field'] .
" " .
$options[
'sort'][
'direction'];
74 $select .=
" LIMIT " .
$options[
'limit'][
'start'] .
"," .
$options[
'limit'][
'end'];
77 $result = $DIC->database()->query($select);
82 $list_user->setUsrId(
$user[
'usr_id']);
83 $list_user->setGender(
$user[
'gender']);
84 $list_user->setTitle(
$user[
'title']);
85 $list_user->setInstitution(
$user[
'institution']);
86 $list_user->setDepartment(
$user[
'department']);
87 $list_user->setStreet(
$user[
'street']);
88 $list_user->setZipcode(
$user[
'zipcode']);
89 $list_user->setCity(
$user[
'city']);
90 $list_user->setCountry(
$user[
'country']);
91 $list_user->setSelCountry(
$user[
'sel_country']);
92 $list_user->setHobby(
$user[
'hobby']);
93 $list_user->setMatriculation(
$user[
'matriculation']);
94 $list_user->setActive(
$user[
'active']);
95 $list_user->setTimeLimitOwner(
$user[
'time_limit_owner']);
96 $list_user->setLogin(
$user[
'login']);
97 $list_user->setFirstname(
$user[
'firstname']);
98 $list_user->setLastname(
$user[
'lastname']);
99 $list_user->setEmail(
$user[
'email']);
100 $list_user->setPhone(
$user[
'phone_office']);
101 $list_user->setMobilePhone(
$user[
'phone_mobile']);
103 $user_data[] = $list_user;
124 $where[] = $DIC->database()->in(
'usr_data.usr_id', $arr_usr_ids,
false,
'integer');
126 if (!empty($arr_filter[
'user'])) {
127 $where[] =
"(" . $DIC->database()->like(
"usr_data.login",
"text",
"%" . $arr_filter[
'user'] .
"%") .
" " .
"OR " . $DIC->database()
128 ->like(
"usr_data.firstname",
"text",
"%" . $arr_filter[
'user'] .
"%") .
" " .
"OR " . $DIC->database()
129 ->like(
"usr_data.lastname",
"text",
"%" . $arr_filter[
'user'] .
"%") .
" " .
"OR " . $DIC->database()
130 ->like(
"usr_data.email",
"text",
"%" . $arr_filter[
'user'] .
"%") .
") ";
133 if (!empty($arr_filter[
'org_unit'])) {
134 $where[] =
'usr_data.usr_id IN (SELECT user_id FROM il_orgu_ua WHERE orgu_id = ' . $DIC->database()
135 ->quote($arr_filter[
'org_unit'],
'integer') .
')';
138 if (!empty($arr_filter[
'lastname'])) {
139 $where[] =
'(lastname LIKE ' . $DIC->database()->quote(
'%' . str_replace(
'*',
'%', $arr_filter[
'lastname']) .
'%',
'text') .
')';
142 if (!empty($arr_filter[
'firstname'])) {
143 $where[] =
'(firstname LIKE ' . $DIC->database()->quote(
'%' . str_replace(
'*',
'%', $arr_filter[
'firstname']) .
'%',
'text') .
')';
146 if (!empty($arr_filter[
'email'])) {
147 $where[] =
'(email LIKE ' . $DIC->database()->quote(
'%' . str_replace(
'*',
'%', $arr_filter[
'email']) .
'%',
'text') .
')';
150 if (!empty($arr_filter[
'title'])) {
151 $where[] =
'(title LIKE ' . $DIC->database()->quote(
'%' . str_replace(
'*',
'%', $arr_filter[
'title']) .
'%',
'text') .
')';
154 if ($arr_filter[
'activation']) {
155 if ($arr_filter[
'activation'] ==
'active') {
156 $where[] =
'(active = "1")';
158 if ($arr_filter[
'activation'] ==
'inactive') {
159 $where[] =
'(active = "0")';
163 if (!empty($where)) {
164 return ' WHERE ' . implode(
' AND ', $where) .
' ';
static createWhereStatement(array $arr_usr_ids, array $arr_filter)
Returns the WHERE Part for the Queries using parameter $user_ids AND local variable $filters...
static getData(array $arr_usr_ids=array(), array $options=array())