"index.php", "name" => get_lang('MySpace')); Display :: display_header($nameTools); api_display_tool_title($nameTools); // Database Table Definitions $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); $tbl_user = Database :: get_main_table(TABLE_MAIN_USER); $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE); $tbl_session_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_USER); /* =============================================================================== FUNCTION =============================================================================== */ function exportCsv($a_header,$a_data) { global $archiveDirName; $fileName = 'teachers.csv'; $archivePath = api_get_path(SYS_PATH).$archiveDirName.'/'; $archiveURL = api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='; if(!$open = fopen($archivePath.$fileName,'w+')) { $message = get_lang('noOpen'); } else { $info = ''; foreach($a_header as $header) { $info .= $header.';'; } $info .= "\r\n"; foreach($a_data as $data) { foreach($data as $infos) { $info .= $infos.';'; } $info .= "\r\n"; } fwrite($open,$info); fclose($open); $perm = api_get_setting('permissions_for_new_files'); $perm = octdec(!empty($perm)?$perm:'0660'); chmod($fileName,$perm); header("Location:".$archiveURL.$fileName); } return $message; } /** * MAIN PART */ if(isset($_GET["teacher_id"]) && $_GET["teacher_id"]!=0){ $i_teacher_id=$_GET["teacher_id"]; $sqlFormateurs = " SELECT user_id,lastname,firstname,email FROM $tbl_user WHERE user_id='$i_teacher_id' ORDER BY lastname ASC "; } else{ $sqlFormateurs = " SELECT user_id,lastname,firstname,email FROM $tbl_user WHERE status = 1 ORDER BY lastname ASC "; } $resultFormateurs = api_sql_query($sqlFormateurs); echo '
'.get_lang('FirstName').' | '.get_lang('LastName').' | '.get_lang('Email').' | '.get_lang('AdminCourses').' | '.get_lang('Students').' |
---|---|---|---|---|
'.get_lang('FirstName').' | '.get_lang('LastName').' | '.get_lang('Email').' | '.get_lang('AdminCourses').' | '.get_lang('Students').' |
'.$s_firstname.' | '.$s_lastname.' | '.$s_email.' | -> | -> |
'.get_lang("NoResults").' |