BeezNest 2011
* @package chamilo.admin
*/
use Chamilo\CoreBundle\Framework\Container;
// name of the language file that needs to be included
$language_file = array ('registration','admin');
$cidReset = true;
global $_configuration;
$current_access_url_id = api_get_current_access_url_id();
// Blocks the possibility to delete a user
$delete_user_available = true;
if (isset($_configuration['deny_delete_users']) && $_configuration['deny_delete_users']) {
$delete_user_available = false;
}
$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=get_user_courses';
$urlSession = api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=get_user_sessions';
$htmlHeadXtra[] = '';
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(true);
/**
* Get the total number of users on the platform
* @see SortableTable#get_total_number_of_items()
*/
function get_number_of_users()
{
$total_rows = get_user_data(null, null, null, null, true);
return $total_rows;
}
/**
* Get the users to display on the current page (fill the sortable-table)
* @param int offset of first user to recover
* @param int Number of users to get
* @param int Column to sort on
* @param string Order (ASC,DESC)
* @param bool
* @see SortableTable#get_table_data($from)
*/
function get_user_data($from, $number_of_items, $column, $direction, $get_count = false)
{
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$admin_table = Database :: get_main_table(TABLE_MAIN_ADMIN);
$select = "SELECT
u.user_id AS col0,
u.official_code AS col2,
".(api_is_western_name_order()
? "u.firstname AS col3,
u.lastname AS col4,"
: "u.lastname AS col3,
u.firstname AS col4,")."
u.username AS col5,
u.email AS col6,
u.status AS col7,
u.active AS col8,
u.user_id AS col9,
u.registration_date AS col10,
u.expiration_date AS exp,
u.password
";
if ($get_count) {
$select = "SELECT count(u.user_id) as total_rows";
}
$sql = "$select FROM $user_table u ";
// adding the filter to see the user's only of the current access_url
if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) {
$access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql.= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.user_id=url_rel_user.user_id)";
}
if (isset($_GET['keyword_extra_data'])) {
$keyword_extra_data = Database::escape_string($_GET['keyword_extra_data']);
if (!empty($keyword_extra_data)) {
$extra_info = UserManager::get_extra_field_information_by_name($keyword_extra_data);
$field_id = $extra_info['id'];
$sql.= " INNER JOIN user_field_values ufv ON u.user_id=ufv.user_id AND ufv.field_id=$field_id ";
}
}
if (isset ($_GET['keyword'])) {
$keyword = Database::escape_string(trim($_GET['keyword']));
$sql .= " WHERE (u.firstname LIKE '%".$keyword."%' OR u.lastname LIKE '%".$keyword."%' OR concat(u.firstname,' ',u.lastname) LIKE '%".$keyword."%' OR concat(u.lastname,' ',u.firstname) LIKE '%".$keyword."%' OR u.username LIKE '%".$keyword."%' OR u.official_code LIKE '%".$keyword."%' OR u.email LIKE '%".$keyword."%' )";
} elseif (isset ($_GET['keyword_firstname'])) {
$keyword_firstname = Database::escape_string($_GET['keyword_firstname']);
$keyword_lastname = Database::escape_string($_GET['keyword_lastname']);
$keyword_email = Database::escape_string($_GET['keyword_email']);
$keyword_officialcode = Database::escape_string($_GET['keyword_officialcode']);
$keyword_username = Database::escape_string($_GET['keyword_username']);
$keyword_status = Database::escape_string($_GET['keyword_status']);
$query_admin_table = '';
$and_conditions = array();
if ($keyword_status == SESSIONADMIN) {
$keyword_status = '%';
$query_admin_table = " , $admin_table a ";
$and_conditions[] = ' a.user_id = u.user_id ';
}
if (isset($_GET['keyword_extra_data'])) {
if (!empty($_GET['keyword_extra_data']) && !empty($_GET['keyword_extra_data_text'])) {
$keyword_extra_data_text = Database::escape_string($_GET['keyword_extra_data_text']);
$and_conditions[] = " ufv.field_value LIKE '%".trim($keyword_extra_data_text)."%' ";
}
}
$keyword_active = isset($_GET['keyword_active']);
$keyword_inactive = isset($_GET['keyword_inactive']);
$sql .= $query_admin_table." WHERE ( ";
if (!empty($keyword_firstname)) {
$and_conditions[] = "u.firstname LIKE '%".$keyword_firstname."%' ";
}
if (!empty($keyword_lastname)) {
$and_conditions[] = "u.lastname LIKE '%".$keyword_lastname."%' ";
}
if (!empty($keyword_username)) {
$and_conditions[] = "u.username LIKE '%".$keyword_username."%' ";
}
if (!empty($keyword_email)) {
$and_conditions[] = "u.email LIKE '%".$keyword_email."%' ";
}
if (!empty($keyword_officialcode)) {
$and_conditions[] = "u.official_code LIKE '%".$keyword_officialcode."%' ";
}
if (!empty($keyword_status)) {
$and_conditions[] = "u.status LIKE '".$keyword_status."' ";
}
if ($keyword_active && !$keyword_inactive) {
$and_conditions[] = " u.active='1' ";
} elseif($keyword_inactive && !$keyword_active) {
$and_conditions[] = " u.active='0' ";
}
if (!empty($and_conditions)) {
$sql .= implode(' AND ', $and_conditions);
}
$sql .= " ) ";
}
// adding the filter to see the user's only of the current access_url
if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) {
$sql.= " AND url_rel_user.access_url_id=".api_get_current_access_url_id();
}
$checkPassStrength = isset($_GET['check_easy_passwords']) && $_GET['check_easy_passwords'] == 1 ? true : false;
if ($checkPassStrength) {
$easyPasswordList = api_get_easy_password_list();
$easyPasswordList = array_map('api_get_encrypted_password', $easyPasswordList);
$easyPasswordList = array_map(array('Database', 'escape_string'), $easyPasswordList);
$easyPassword = implode("' OR password LIKE '", $easyPasswordList);
$sql .= "AND password LIKE '$easyPassword' ";
}
if (!in_array($direction, array('ASC','DESC'))) {
$direction = 'ASC';
}
$column = intval($column);
$from = intval($from);
$number_of_items = intval($number_of_items);
// Returns counts and exits function.
if ($get_count) {
$res = Database::query($sql);
$user = Database::fetch_array($res);
return $user['total_rows'];
}
$sql .= " ORDER BY col$column $direction ";
$sql .= " LIMIT $from,$number_of_items";
$res = Database::query($sql);
$users = array();
$t = time();
$adminList = Container::getEntityManager()->getRepository('ChamiloUserBundle:Group')->getAdmins();
$adminListArray = array();
foreach ($adminList as $admin) {
$adminListArray[] = $admin->getId();
}
$statusName = api_get_status_langvars();
while ($user = Database::fetch_row($res)) {
$userId = $user[0];
$userInfo = api_get_user_info($userId);
$userEntity = Container::getEntityManager()->getRepository('ChamiloUserBundle:User')->find($userId);
$image_path = UserManager::get_user_picture_path_by_id($userId, 'web', false, true);
$user_profile = UserManager::get_picture_user($userId, $image_path['file'], 22, USER_IMAGE_SIZE_SMALL, ' width="22" height="22" ');
if (!api_is_anonymous()) {
$photo = '
';
} else {
$photo = '';
}
if ($user[7] == 1 && $user[10] != '0000-00-00 00:00:00') {
// check expiration date
$expiration_time = api_convert_sql_date($user[10]);
// if expiration date is passed, store a special value for active field
if ($expiration_time < $t) {
$user[7] = '-1';
}
}
$current_user_status_label = $user[7];
$user_is_anonymous = false;
if ($current_user_status_label == $statusName[ANONYMOUS]) {
$user_is_anonymous =true;
}
//$userEntity->getGroups()->containsKey()
// forget about the expiration date field
$users[] = array(
$userId,
$photo,
$user[1],
Display::url($user[2], $userInfo['profile_url']),
Display::url($user[3], $userInfo['profile_url']),
$user[4],
$user[5],
$user[6],
$user[7],
api_get_local_time($user[9]),
$userId,
'is_admin' => in_array($userId, $adminListArray),
'is_anonymous' => $user_is_anonymous,
'groups' => $userEntity->getGroups()
);
}
return $users;
}
/**
* Returns a mailto-link
* @param string $email An email-address
* @return string HTML-code with a mailto-link
*/
function email_filter($email) {
return Display :: encrypted_mailto_link($email, $email);
}
/**
* Build the modify-column of the table
* @param int The user id
* @param string URL params to add to table links
* @param array Row of elements to alter
* @return string Some HTML-code with modify-buttons
*/
function modify_filter($user_id, $url_params, $row) {
global $delete_user_available;
$userId = api_get_user_id();
$is_admin = $row['is_admin'];
$user_is_anonymous = $row['is_anonymous'];
$result = '';
if (!$user_is_anonymous) {
$icon = Display::return_icon('course.png', get_lang('Courses'), array('onmouseout' => 'clear_course_list (\'div_'.$user_id.'\')'));
$result .= '
'.$icon.'
';
$icon = Display::return_icon('session.png', get_lang('Sessions'), array('onmouseout' => 'clear_session_list (\'div_s_'.$user_id.'\')'));
$result .= '
'.$icon.'
';
} else {
$result .= Display::return_icon('course_na.png',get_lang('Courses')).' ';
$result .= Display::return_icon('course_na.png',get_lang('Sessions')).' ';
}
if (api_is_platform_admin()) {
if (!$user_is_anonymous) {
$result .= ''.Display::return_icon('synthese_view.gif', get_lang('Info')).' ';
} else {
$result .= Display::return_icon('synthese_view_na.gif', get_lang('Info')).' ';
}
}
//only allow platform admins to login_as, or session admins only for
// students (not teachers nor other admins), and only if all options
// match to say this user has the permission to do so
// $_configuration['login_as_forbidden_globally'], defined in
// configuration.php, is the master key to these conditions
if (Container::getSecurity()->isGranted('ROLE_GLOBAL_ADMIN')) {
// everything looks good, show "login as" link
if ($user_id != $userId) {
$result .= ''.Display::return_icon('login_as.gif', get_lang('LoginAs')).' ';
} else {
$result .= Display::return_icon('login_as_na.gif', get_lang('LoginAs')).' ';
}
} else {
// if this user in particular can't be edited, show disabled
$result .= Display::return_icon('login_as_na.gif', get_lang('LoginAs')).' ';
}
if (api_is_platform_admin(true)) {
if (!$user_is_anonymous && api_global_admin_can_edit_admin($user_id, null, true)) {
$result .= ''.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).' ';
} else {
$result .= Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).' ';
}
}
if ($is_admin) {
$result .= Display::return_icon('admin_star.png', get_lang('IsAdministrator'),array('width'=> ICON_SIZE_SMALL, 'heigth'=> ICON_SIZE_SMALL));
} else {
$result .= Display::return_icon('admin_star_na.png', get_lang('IsNotAdministrator'));
}
// actions for assigning sessions, courses or users
if (api_is_session_admin()) {
/*if ($row[0] == api_get_user_id()) {
$result .= ''.Display::return_icon('view_more_stats.gif', get_lang('AssignSessions')).' ';
}*/
}
//var_dump($row['groups']);
if (api_is_platform_admin()) {
if ($row['groups']->containsKey('drh') || $is_admin) {
$result .= ''.Display::return_icon('user_subscribe_course.png', get_lang('AssignUsers'),'',ICON_SIZE_SMALL).'';
$result .= ''.Display::return_icon('course_add.gif', get_lang('AssignCourses')).' ';
$result .= ''.Display::return_icon('view_more_stats.gif', get_lang('AssignSessions')).' ';
} else if ($row['groups']->containsKey('session_admin')) {
$result .= ''.Display::return_icon('view_more_stats.gif', get_lang('AssignSessions')).' ';
}
}
if (api_is_platform_admin()) {
$result .= ' '.Display::return_icon('month.png', get_lang('FreeBusyCalendar'), array(), ICON_SIZE_SMALL).'';
if ($delete_user_available) {
if ($user_id != api_get_user_id() && !$user_is_anonymous && api_global_admin_can_edit_admin($user_id)) {
// you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.
$result .= ' '.Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'';
} else {
$result .= Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
}
}
}
return $result;
}
/**
* Build the active-column of the table to lock or unlock a certain user
* lock = the user can no longer use this account
* @author Patrick Cool , Ghent University
* @param int $active the current state of the account
* @param int $user_id The user id
* @param string $url_params
* @return string Some HTML-code with the lock/unlock button
*/
function active_filter($active, $url_params, $row) {
global $_user;
if ($active=='1') {
$action='Lock';
$image='accept';
} elseif ($active=='-1') {
$action='edit';
$image='warning';
} elseif ($active=='0') {
$action='Unlock';
$image='error';
}
$result = '';
if ($action=='edit') {
$result = Display::return_icon($image.'.png', get_lang('AccountExpired'), array(), 16);
} elseif ($row['0']<>$_user['user_id']) {
// you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.
$result = Display::return_icon($image.'.png', get_lang(ucfirst($action)), array('onclick'=>'active_user(this);', 'id'=>'img_'.$row['0']), 16).'';
}
return $result;
}
/**
* Instead of displaying the integer of the status, we give a translation for the status
*
* @param integer $status
* @return string translation
*
* @version march 2008
* @author Patrick Cool , Ghent University, Belgium
*/
function status_filter($status) {
if (empty($status)) {
return null;
}
$statusname = api_get_status_langvars();
return $statusname[$status];
}
$action = isset($_REQUEST["action"]) ? $_REQUEST["action"] : null;
if (isset($_GET['keyword']) || isset($_GET['keyword_firstname'])) {
$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array ("url" => 'user_list.php', "name" => get_lang('UserList'));
$tool_name = get_lang('SearchUsers');
} else {
$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
$tool_name = get_lang('UserList');
}
$message = '';
if (!empty($action)) {
$check = Security::check_token('get');
if ($check) {
switch ($action) {
case 'add_user_to_my_url':
$user_id = $_REQUEST["user_id"];
$result = UrlManager::add_user_to_url($user_id, $current_access_url_id);
if ($result ) {
$user_info = api_get_user_info($user_id);
$message = get_lang('UserAdded').' '.$user_info['firstname'].' '.$user_info['lastname'].' ('.$user_info['username'].')';
$message = Display::return_message($message, 'confirmation');
}
break;
case 'login_as':
$login_as_user_id = $_GET["user_id"];
if (isset ($login_as_user_id)) {
login_user($login_as_user_id);
}
break;
case 'show_message' :
if (!empty($_GET['warn'])) {
// to prevent too long messages
if ($_GET['warn'] == 'session_message'){
$_GET['warn'] = $_SESSION['session_message_import_users'];
}
$message = Display::return_message(urldecode($_GET['warn']),'warning', false);
}
if (!empty($_GET['message'])) {
$message = Display :: return_message(stripslashes($_GET['message']), 'confirmation');
}
break;
case 'delete_user' :
if (api_is_platform_admin()) {
$user_to_delete = $_GET['user_id'];
$current_user_id = api_get_user_id();
if ($delete_user_available && api_global_admin_can_edit_admin($_GET['user_id'])) {
if ($user_to_delete != $current_user_id && UserManager :: delete_user($_GET['user_id'])) {
$message = Display :: return_message(get_lang('UserDeleted'), 'confirmation');
} else {
$message = Display :: return_message(get_lang('CannotDeleteUserBecauseOwnsCourse'), 'error');
}
} else {
$message = Display :: return_message(get_lang('CannotDeleteUser'),'error');
}
}
break;
case 'delete' :
if (api_is_platform_admin()) {
$number_of_selected_users = count($_POST['id']);
$number_of_deleted_users = 0;
if (is_array($_POST['id'])) {
foreach ($_POST['id'] as $index => $user_id) {
if($user_id != $_user['user_id']) {
if(UserManager :: delete_user($user_id)) {
$number_of_deleted_users++;
}
}
}
}
if ($number_of_selected_users == $number_of_deleted_users) {
$message = Display :: return_message(get_lang('SelectedUsersDeleted'), 'confirmation');
} else {
$message = Display :: return_message(get_lang('SomeUsersNotDeleted'), 'error');
}
}
break;
}
Security::clear_token();
}
}
// Create a search-box
$form = new FormValidator('search_simple','get', '', '', array('class' => 'form-search'),false);
/*$renderer =& $form->defaultRenderer();
$renderer->setElementTemplate('{element} ');*/
$form->addElement('text', 'keyword', get_lang('keyword'));
$form->addElement('button', 'submit' ,get_lang('Search'));
$form->addElement('advanced_settings', 'user_list_filter', get_lang('AdvancedSearch'));
$actions = '';
if (api_is_platform_admin()) {
$actions .= ''.
Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).'';
}
$actions .= $form->return_form();
if (isset ($_GET['keyword'])) {
$parameters = array ('keyword' => Security::remove_XSS($_GET['keyword']));
} elseif (isset ($_GET['keyword_firstname'])) {
$parameters['keyword_firstname'] = Security::remove_XSS($_GET['keyword_firstname']);
$parameters['keyword_lastname'] = Security::remove_XSS($_GET['keyword_lastname']);
$parameters['keyword_username'] = Security::remove_XSS($_GET['keyword_username']);
$parameters['keyword_email'] = Security::remove_XSS($_GET['keyword_email']);
$parameters['keyword_officialcode'] = Security::remove_XSS($_GET['keyword_officialcode']);
$parameters['keyword_status'] = Security::remove_XSS($_GET['keyword_status']);
$parameters['keyword_active'] = Security::remove_XSS($_GET['keyword_active']);
$parameters['keyword_inactive'] = Security::remove_XSS($_GET['keyword_inactive']);
}
// Create a sortable table with user-data
$parameters['sec_token'] = Security::get_token();
// display advanced search form
$form = new FormValidator('advanced_search','get');
$form->addElement('html','');
$form->addElement('header', get_lang('AdvancedSearch'));
$form->addElement('html', '
');
$form->addElement('html', '');
$form->add_textfield('keyword_firstname',get_lang('FirstName'),false,array('style'=>'margin-left:17px'));
$form->addElement('html', ' | ');
$form->add_textfield('keyword_lastname',get_lang('LastName'),false,array('style'=>'margin-left:17px'));
$form->addElement('html', ' |
');
$form->addElement('html', '');
$form->add_textfield('keyword_username',get_lang('LoginName'),false,array('style'=>'margin-left:17px'));
$form->addElement('html', ' | ');
$form->addElement('html', '');
$form->add_textfield('keyword_email',get_lang('Email'),false,array('style'=>'margin-left:17px'));
$form->addElement('html', ' |
');
$form->addElement('html', '');
$form->add_textfield('keyword_officialcode',get_lang('OfficialCode'),false,array('style'=>'margin-left:17px'));
$form->addElement('html', ' | ');
$status_options = array();
$status_options['%'] = get_lang('All');
$status_options[STUDENT] = get_lang('Student');
$status_options[COURSEMANAGER] = get_lang('Teacher');
$status_options[DRH] = get_lang('Drh');
$status_options[SESSIONADMIN] = get_lang('Administrator');
$form->addElement('select','keyword_status',get_lang('Profile'),$status_options, array('style'=>'margin-left:17px'));
$form->addElement('html', ' |
');
$form->addElement('html', '');
$active_group = array();
$active_group[] = $form->createElement('checkbox','keyword_active','', get_lang('Active'));
$active_group[] = $form->createElement('checkbox','keyword_inactive','', get_lang('Inactive'));
$form->addGroup($active_group,'',get_lang('ActiveAccount'),' ',false);
$form->addElement('html', ' | ');
$form->addElement('checkbox', 'check_easy_passwords', null, get_lang('CheckEasyPasswords'));
$form->addElement('html', ' |
');
$form->addElement('html', '');
$form->addElement('button', 'submit',get_lang('SearchUsers'));
$form->addElement('html', ' |
');
$form->addElement('html', '
');
$defaults = array();
$defaults['keyword_active'] = 1;
$defaults['keyword_inactive'] = 1;
$form->setDefaults($defaults);
$form->addElement('html','
');
$form = $form->return_form();
$table = new SortableTable('users', 'get_number_of_users', 'get_user_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2);
$table->set_additional_parameters($parameters);
$table->set_header(0, '', false);
$table->set_header(1, get_lang('Photo'), false);
$table->set_header(2, get_lang('OfficialCode'));
if (api_is_western_name_order()) {
$table->set_header(3, get_lang('FirstName'));
$table->set_header(4, get_lang('LastName'));
} else {
$table->set_header(3, get_lang('LastName'));
$table->set_header(4, get_lang('FirstName'));
}
$table->set_header(5, get_lang('LoginName'));
$table->set_header(6, get_lang('Email'));
$table->set_header(7, get_lang('Profile'));
$table->set_header(8, get_lang('Active'), true);
$table->set_header(9, get_lang('RegistrationDate'), true);
$table->set_header(10, get_lang('Action'), false);
$table->set_column_filter(6, 'email_filter');
$table->set_column_filter(7, 'status_filter');
$table->set_column_filter(8, 'active_filter');
$table->set_column_filter(10, 'modify_filter');
if (api_is_platform_admin()) {
$table->set_form_actions(array ('delete' => get_lang('DeleteFromPlatform')));
}
$table_result = $table->return_table();
$extra_search_options = '';
//Try to search the user everywhere
if ($table->get_total_number_of_items() == 0) {
if (api_get_multiple_access_url() && isset($_REQUEST['keyword'])) {
$keyword = Database::escape_string($_REQUEST['keyword']);
//$conditions = array('firstname' => $keyword, 'lastname' => $keyword, 'username' => $keyword);
$conditions = array('username' => $keyword);
$user_list = UserManager::get_user_list($conditions, array(), false, ' OR ');
if (!empty($user_list)) {
$extra_search_options = Display::page_subheader(get_lang('UsersFoundInOtherPortals'));
$table = new HTML_Table(array('class' => 'data_table'));
$column = 0;
$row = 0;
$headers = array(get_lang('User'), 'URL', get_lang('Actions'));
foreach ($headers as $header) {
$table->setHeaderContents($row, $column, $header);
$column++;
}
$row++;
foreach ($user_list as $user) {
$column = 0;
$access_info = UrlManager::get_access_url_from_user($user['user_id']);
$access_info_to_string = '';
$add_user = true;
if (!empty($access_info)) {
foreach ($access_info as $url_info) {
if ($current_access_url_id == $url_info['access_url_id']) {
$add_user = false;
}
$access_info_to_string .= $url_info['url'].'
';
}
}
if ($add_user) {
$row_table = array();
$row_table[] = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') ';
$row_table[] = $access_info_to_string;
$url = api_get_self().'?action=add_user_to_my_url&user_id='.$user['user_id'].'&sec_token='.Security::getCurrentToken();
$row_table[] = Display::url(get_lang('AddUserToMyURL'), $url, array('class' => 'btn'));
foreach ($row_table as $cell) {
$table->setCellContents($row, $column, $cell);
$table->updateCellAttributes($row, $column, 'align="center"');
$column++;
}
$table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true);
$row++;
}
}
$extra_search_options .= $table->toHtml();
$table_result = '';
}
}
}
echo $message;
echo $actions;
echo $form.$table_result.$extra_search_options;
/*var_dump(Container::getSettingsManager()->getSetting('platform
.administrator_name'));
$sender_name = api_get_person_name(
api_get_setting('platform.administrator_name'),
api_get_setting('platform.administrator_surname'),
null,
PERSON_NAME_EMAIL_ADDRESS
); var_dump($sender_name);*/