'index.php', "name" => get_lang('PlatformAdmin')); Display :: display_header($tool_name); //api_display_tool_title($tool_name); if ($_POST['formSent']) { $form_sent = $_POST['formSent']; $classes = is_array($_POST['ClassList']) ? $_POST['ClassList'] : array(); $courses = is_array($_POST['CourseList']) ? $_POST['CourseList'] : array(); $first_letter_class = $_POST['firstLetterClass']; $first_letter_course = $_POST['firstLetterCourse']; if ($form_sent == 1) { if (count($classes) == 0 || count($courses) == 0) { Display::display_error_message(get_lang('AtLeastOneClassAndOneCourse')); } elseif (api_substr($_POST['formSubmit'], -2) == '>>') // add classes to courses { foreach ($courses as $course_code) { foreach ($classes as $class_id) { ClassManager :: subscribe_to_course($class_id, $course_code); } } Display::display_normal_message(get_lang('ClassesSubscribed')); } else {// remove classes from courses foreach ($courses as $course_code) { foreach ($classes as $class_id) { ClassManager :: unsubscribe_from_course($class_id, $course_code); } } Display::display_normal_message(get_lang('ClassesUnSubscribed')); } } } $sql = "SELECT id,name FROM $tbl_class WHERE name LIKE '".$first_letter_class."%' ORDER BY ". (count($classes) > 0 ? "(id IN('".implode("','", $classes)."')) DESC," : "")." name"; $result = Database::query($sql); $db_classes = Database::store_result($result); $sql = "SELECT code,visual_code,title FROM $tbl_course WHERE visual_code LIKE '".$first_letter_course."%' ORDER BY ". (count($courses) > 0 ? "(code IN('".implode("','", $courses)."')) DESC," : "")." visual_code"; $result = Database::query($sql); $db_courses = Database::store_result($result); if (!empty ($error_message)) { Display :: display_normal_message($error_message); } ?>


:
  :

: