diff --git a/main/session/add_teachers_to_session.php b/main/session/add_teachers_to_session.php index bc019a4e7e..928bf2ae02 100644 --- a/main/session/add_teachers_to_session.php +++ b/main/session/add_teachers_to_session.php @@ -18,14 +18,9 @@ $interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('Sessi // Setting the name of the tool $tool_name = get_lang('EnrollTrainersFromExistingSessions'); -$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 = intval($_GET['id']); SessionManager::protectSession($id); @@ -34,7 +29,8 @@ $htmlResult = null; if (isset($_POST['form_sent']) && $_POST['form_sent']) { $form_sent = $_POST['form_sent']; - if ($form_sent == 1) { + + if ($form_sent == 1 && isset($_POST['sessions']) && isset($_POST['courses'])) { $sessions = $_POST['sessions']; $courses = $_POST['courses']; @@ -56,130 +52,57 @@ foreach ($courseList as $course) { Display::display_header($tool_name); ?> -
-