'index.php', 'name' => get_lang('PlatformAdmin')); set_time_limit(0); Display :: display_header($tool_name); $archivePath = api_get_path(SYS_ARCHIVE_PATH); $archiveURL = api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='; $course_list = CourseManager::get_courses_list(); if($_POST['formSent']) { $formSent =$_POST['formSent']; $select_type=intval($_POST['select_type']); $file_type = 'csv'; $courses = $selected_courses = array(); if ($select_type == 2) { // Get selected courses from courses list in form sent $selected_courses = $_POST['course_code']; if (is_array($selected_courses)) { foreach ($course_list as $course) { if (!in_array($course['code'],$selected_courses)) continue; $courses[] = $course; } } } else { // Get all courses $courses = $course_list; } if (!empty($courses)) { if (!file_exists($archivePath)) { mkdir($archivePath, api_get_permissions_for_new_directories(), true); } $archiveFile = 'export_courses_list_'.date('Y-m-d_H-i-s').'.'.$file_type; $fp = fopen($archivePath.$archiveFile,'w'); if ($file_type == 'csv') { $add = "Code;Title;CourseCategory;Teacher;Language;".PHP_EOL; foreach($courses as $course) { $course['code'] = str_replace(';',',',$course['code']); $course['title'] = str_replace(';',',',$course['title']); $course['category_code'] = str_replace(';',',',$course['category_code']); $course['tutor_name'] = str_replace(';',',',$course['tutor_name']); $course['course_language'] = str_replace(';',',',$course['course_language']); $add.= $course['code'].';'.$course['title'].';'.$course['category_code'].';'.$course['tutor_name'].';'.$course['course_language'].';'.PHP_EOL; } fputs($fp, $add); } fclose($fp); $msg = get_lang('CoursesListHasBeenExported').'
'.get_lang('ClickHereToDownloadTheFile').''; } else { $msg = get_lang('ThereAreNotSelectedCoursesOrCoursesListIsEmpty'); } } if (!empty($msg)) { Display::display_normal_message($msg, false); } ?>

onclick="javascript: if(this.checked){document.getElementById('div-course-list').style.display='none';}"/>
onclick="javascript: if(this.checked){document.getElementById('div-course-list').style.display='block';}"/>

: