0) { array_map('intval', $idChecked); $idChecked = implode(',', $idChecked); } if (!empty($idChecked)) { $sql = "DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id='$id_session' AND c_id='".$courseId."' AND user_id IN($idChecked)"; $result = Database::query($sql); $nbr_affected_rows = Database::affected_rows($result); $sql = "UPDATE $tbl_session_rel_course SET nbr_users=nbr_users-$nbr_affected_rows WHERE session_id='$id_session' AND c_id='".$courseId."'"; Database::query($sql); } 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[] = array("url" => "index.php","name" => get_lang('PlatformAdmin')); $interbreadcrumb[] = array("url" => "session_list.php", "name" => get_lang('SessionList')); $interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session, "name" => get_lang('SessionOverview')); Display::display_header($tool_name); echo Display::page_header($tool_name); ?>