0) { foreach ($idChecked as $userId) { SessionManager::unSubscribeUserFromCourseSession($userId, $courseId, $id_session); } } else { SessionManager::unSubscribeUserFromCourseSession($idChecked, $courseId, $id_session); } header('Location: '.api_get_self() .'?id_session='.$id_session.'&course_code='.urlencode($course_code).'&sort='.$sort); exit(); break; case 'add': SessionManager::subscribe_users_to_session_course($idChecked, $id_session, $course_code); header('Location: '.api_get_self() .'?id_session='.$id_session.'&course_code='.urlencode($course_code).'&sort='.$sort); exit; break; } $limit = 20; $from = $page * $limit; $is_western_name_order = api_is_western_name_order(); $sql = " SELECT DISTINCT u.user_id," .($is_western_name_order ? 'u.firstname, u.lastname' : 'u.lastname, u.firstname') .", u.username, scru.user_id as is_subscribed FROM $tbl_session_rel_user s INNER JOIN $tbl_user u ON (u.user_id=s.user_id) LEFT JOIN $tbl_session_rel_course_rel_user scru ON (s.session_id = scru.session_id AND s.user_id = scru.user_id AND scru.c_id = $courseId) WHERE s.session_id = $id_session ORDER BY $sort $direction LIMIT $from,".($limit + 1); if ($direction == 'desc') { $direction = 'asc'; } else { $direction = 'desc'; } $result = Database::query($sql); $users = Database::store_result($result); $nbr_results = sizeof($users); $tool_name = get_lang('Session').': '.$session_name.' - '.get_lang('Course').': '.$course_title; $interbreadcrumb[] = ['url' => 'session_list.php', 'name' => get_lang('Session list')]; $interbreadcrumb[] = [ 'url' => "resume_session.php?id_session=".$id_session, 'name' => get_lang('Session overview'), ]; Display::display_header($tool_name); echo Display::page_header($tool_name); ?>