From a97507071046139c4060c84c4da2a41adcf2b8e9 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 27 May 2021 15:23:08 +0200 Subject: [PATCH] Remove unused file --- .../add_courses_to_session_functions.lib.php | 131 ------------------ 1 file changed, 131 deletions(-) delete mode 100644 public/main/inc/lib/add_courses_to_session_functions.lib.php diff --git a/public/main/inc/lib/add_courses_to_session_functions.lib.php b/public/main/inc/lib/add_courses_to_session_functions.lib.php deleted file mode 100644 index a02253fd3c..0000000000 --- a/public/main/inc/lib/add_courses_to_session_functions.lib.php +++ /dev/null @@ -1,131 +0,0 @@ - 0) { - while ($row = Database::fetch_row($res)) { - $course_codes .= '\''.$row[0].'\','; - } - $course_codes = substr($course_codes, 0, (strlen($course_codes) - 1)); - $cond_course_code = ' AND course.id NOT IN('.$course_codes.') '; - } - } - - if ('single' == $type) { - // search users where username or firstname or lastname begins likes $needle - $sql = 'SELECT - course.id, - course.visual_code, - course.title, - session_rel_course.session_id - FROM '.$tbl_course.' course - LEFT JOIN '.$tbl_session_rel_course.' session_rel_course - ON course.id = session_rel_course.c_id - AND session_rel_course.session_id = '.intval($id_session).' - WHERE - course.visual_code LIKE "'.$needle.'%" OR - course.title LIKE "'.$needle.'%"'; - } else { - $sql = 'SELECT course.id, course.visual_code, course.title - FROM '.$tbl_course.' course - WHERE - course.visual_code LIKE "'.$needle.'%" '.$cond_course_code.' - ORDER BY course.code '; - } - - if (api_is_multiple_url_enabled()) { - $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); - $access_url_id = api_get_current_access_url_id(); - if (-1 != $access_url_id) { - if ('single' == $type) { - $sql = 'SELECT - course.id, - course.visual_code, - course.title, - session_rel_course.session_id - FROM '.$tbl_course.' course - LEFT JOIN '.$tbl_session_rel_course.' session_rel_course - ON course.id = session_rel_course.c_id - AND session_rel_course.session_id = '.intval($id_session).' - INNER JOIN '.$tbl_course_rel_access_url.' url_course - ON (url_course.c_id = course.id) - WHERE - access_url_id = '.$access_url_id.' AND - (course.visual_code LIKE "'.$needle.'%" OR - course.title LIKE "'.$needle.'%" )'; - } else { - $sql = 'SELECT course.id, course.visual_code, course.title - FROM '.$tbl_course.' course, '.$tbl_course_rel_access_url.' url_course - WHERE - url_course.c_id = course.id AND - access_url_id = '.$access_url_id.' AND - course.visual_code LIKE "'.$needle.'%" '.$cond_course_code.' - ORDER BY course.code '; - } - } - } - - $rs = Database::query($sql); - $course_list = []; - if ('single' == $type) { - while ($course = Database::fetch_array($rs)) { - $course_list[] = $course['id']; - $course_title = str_replace("'", "\'", $course_title); - $return .= ''.$course['title'].' ('.$course['visual_code'].')
'; - } - $xajax_response->addAssign('ajax_list_courses_single', 'innerHTML', api_utf8_encode($return)); - } else { - $return .= ''; - $xajax_response->addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return)); - } - } - Session::write('course_list', $course_list); - - return $xajax_response; - } -}