'session_list.php', 'name' => get_lang('SessionList')); // Setting the name of the tool $tool_name = get_lang('SubscribeStudentsToSession'); $add_type = 'multiple'; if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { $add_type = Security::remove_XSS($_REQUEST['add_type']); } $form_sent = 0; $errorMsg = ''; $users = $sessions = array(); $id = isset($_GET['id']) ? intval($_GET['id']) : null; SessionManager::protectSession($id); $htmlResult = null; if (isset($_POST['form_sent']) && $_POST['form_sent']) { $form_sent = $_POST['form_sent']; if ($form_sent == 1) { $sessionSourceList = $_POST['sessions']; $sessionDestinationList = $_POST['sessions_destination']; $result = SessionManager::copyStudentsFromSession($sessionSourceList, $sessionDestinationList); foreach ($result as $message) { $htmlResult .= $message; } } } $session_list = SessionManager::get_sessions_list(array(), array('name')); $sessionList = array(); foreach ($session_list as $session) { $sessionList[$session['id']] = $session['name']; } Display::display_header($tool_name); ?>