Replace Database :: get_main_table with Database::get_main_table

pull/2487/head
jmontoyaa 9 years ago
parent c7589501f0
commit 244a19d4c7
  1. 2
      index.php
  2. 2
      main/admin/access_url_add_usergroup_to_url.php
  3. 2
      main/admin/access_url_add_users_to_url.php
  4. 6
      main/admin/access_url_edit_courses_to_url.php
  5. 4
      main/admin/access_url_edit_users_to_url.php
  6. 4
      main/admin/course_add.php
  7. 6
      main/admin/course_edit.php
  8. 6
      main/admin/course_list.php
  9. 2
      main/admin/course_request_accepted.php
  10. 2
      main/admin/course_request_rejected.php
  11. 4
      main/admin/course_request_review.php
  12. 2
      main/admin/course_user_import.php
  13. 2
      main/admin/course_user_import_by_email.php
  14. 4
      main/admin/languages.php
  15. 14
      main/admin/settings.lib.php
  16. 2
      main/admin/settings.php
  17. 4
      main/admin/subscribe_user2course.php
  18. 4
      main/admin/user_information.php
  19. 2
      main/admin/user_list.php
  20. 2
      main/admin/usergroup_user_import.php
  21. 4
      main/auth/profile.php
  22. 2
      main/course_info/infocours.php
  23. 4
      main/coursecopy/copy_course.php
  24. 2
      main/exercise/exercise.class.php
  25. 2
      main/exercise/exercise.php
  26. 6
      main/exercise/exercise_report.php
  27. 2
      main/exercise/exercise_submit.php
  28. 4
      main/exercise/hotpotatoes_exercise_report.php
  29. 2
      main/forum/editpost.php
  30. 2
      main/forum/editthread.php
  31. 2
      main/forum/forumconfig.inc.php
  32. 26
      main/forum/forumfunction.inc.php
  33. 2
      main/gradebook/gradebook_edit_link.php
  34. 4
      main/gradebook/gradebook_showlog_eval.php
  35. 2
      main/gradebook/index.php
  36. 2
      main/gradebook/lib/be/attendancelink.class.php
  37. 2
      main/inc/ajax/admin.ajax.php
  38. 4
      main/inc/ajax/course.ajax.php
  39. 2
      main/inc/ajax/model.ajax.php
  40. 2
      main/inc/ajax/user_manager.ajax.php
  41. 2
      main/inc/global.inc.php
  42. 22
      main/inc/lib/api.lib.php
  43. 2
      main/inc/lib/online.inc.php
  44. 8
      main/inc/lib/specific_fields_manager.lib.php
  45. 2
      main/inc/lib/zombie/zombie_manager.class.php
  46. 6
      main/inc/local.inc.php
  47. 2
      main/install/install.lib.php
  48. 2
      main/lp/lp_ajax_save_item.php
  49. 12
      main/mySpace/admin.php
  50. 16
      main/mySpace/coaches.php
  51. 4
      main/mySpace/myStudents.php
  52. 10
      main/mySpace/progression.php
  53. 2
      main/mySpace/user_import.php
  54. 2
      main/session/session_course_user.php
  55. 2
      main/social/home.php
  56. 2
      main/social/profile.php
  57. 6
      main/survey/create_new_survey.php
  58. 2
      main/survey/fillsurvey.php
  59. 6
      main/ticket/report.php
  60. 2
      main/user/subscribe_user.php
  61. 2
      main/user/user.php
  62. 2
      main/webservices/cm_webservice_user.php
  63. 18
      main/webservices/registration.soap.php
  64. 2
      main/webservices/user_import/import.lib.php
  65. 6
      whoisonlinesession.php

@ -77,7 +77,7 @@ if (!api_get_user_id() && CustomPages::enabled()) {
if (!empty($_POST['submitAuth'])) {
// The user has been already authenticated, we are now to find the last login of the user.
if (isset ($_user['user_id'])) {
$track_login_table = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$track_login_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql = "SELECT UNIX_TIMESTAMP(login_date)
FROM $track_login_table
WHERE login_user_id = '".$_user['user_id']."'

@ -23,7 +23,7 @@ $firstLetterUserGroup = null;
$courses = array();
$url_list = array();
$tbl_access_url_rel_course = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$tbl_access_url_rel_course = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$tbl_access_url = Database:: get_main_table(TABLE_MAIN_ACCESS_URL);
$tbl_user = Database:: get_main_table(TABLE_MAIN_USER);
$tbl_course = Database:: get_main_table(TABLE_MAIN_COURSE);

@ -24,7 +24,7 @@ $courses = array();
$url_list = array();
$users = array();
$tbl_access_url_rel_user = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$tbl_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$tbl_access_url = Database:: get_main_table(TABLE_MAIN_ACCESS_URL);
$tbl_user = Database:: get_main_table(TABLE_MAIN_USER);

@ -25,9 +25,9 @@ if (!api_get_multiple_access_url()) {
}
// Database Table Definitions
$tbl_access_url_rel_course = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_access_url = Database :: get_main_table(TABLE_MAIN_ACCESS_URL);
$tbl_access_url_rel_course = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL);
// setting breadcrumbs
$tool_name = get_lang('EditCoursesToURL');

@ -24,8 +24,8 @@ if (!api_get_multiple_access_url()) {
// Database Table Definitions
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_access_url_rel_user = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$tbl_access_url = Database :: get_main_table(TABLE_MAIN_ACCESS_URL);
$tbl_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$tbl_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL);
// setting breadcrumbs
$tool_name = get_lang('EditUsersToURL');

@ -17,13 +17,13 @@ $interbreadcrumb[] = array('url' => 'course_list.php', 'name' => get_lang('Cours
// Get all possible teachers.
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT user_id,lastname,firstname
FROM $table_user
WHERE status=1".$order_clause;
// Filtering teachers when creating a course.
if (api_is_multiple_url_enabled()) {
$access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql = "SELECT u.user_id,lastname,firstname
FROM $table_user as u
INNER JOIN $access_url_rel_user_table url_rel_user

@ -30,12 +30,12 @@ $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdm
$interbreadcrumb[] = array("url" => "course_list.php", "name" => get_lang('CourseList'));
// Get all course categories
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$course_code = $courseInfo['code'];
$courseId = $courseInfo['real_id'];
// Get course teachers
$table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
$sql = "SELECT user.user_id,lastname,firstname
FROM $table_user as user,$table_course_user as course_user
@ -52,7 +52,7 @@ while ($obj = Database::fetch_object($res)) {
// Get all possible teachers without the course teachers
if (api_is_multiple_url_enabled()) {
$access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql = "SELECT u.user_id,lastname,firstname
FROM $table_user as u
INNER JOIN $access_url_rel_user_table url_rel_user

@ -19,13 +19,13 @@ $sessionId = isset($_GET['session_id']) ? $_GET['session_id'] : null;
*/
function get_number_of_courses()
{
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT COUNT(code) AS total_number_of_items FROM $course_table c";
if ((api_is_platform_admin() || api_is_session_admin()) &&
api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1
) {
$access_url_rel_course_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$access_url_rel_course_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$sql .= " INNER JOIN $access_url_rel_course_table url_rel_course
ON (c.id = url_rel_course.c_id)";
}
@ -100,7 +100,7 @@ function get_course_data($from, $number_of_items, $column, $direction)
if ((api_is_platform_admin() || api_is_session_admin()) &&
api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1
) {
$access_url_rel_course_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$access_url_rel_course_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$sql .= " INNER JOIN $access_url_rel_course_table url_rel_course
ON (course.id = url_rel_course.c_id)";
}

@ -78,7 +78,7 @@ function get_number_of_requests()
function get_request_data($from, $number_of_items, $column, $direction)
{
$keyword = isset($_GET['keyword']) ? Database::escape_string(trim($_GET['keyword'])) : null;
$course_request_table = Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST);
$course_request_table = Database::get_main_table(TABLE_MAIN_COURSE_REQUEST);
$from = intval($from);
$number_of_items = intval($number_of_items);

@ -109,7 +109,7 @@ function get_number_of_requests()
function get_request_data($from, $number_of_items, $column, $direction)
{
$keyword = isset($_GET['keyword']) ? Database::escape_string(trim($_GET['keyword'])) : '';
$course_request_table = Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST);
$course_request_table = Database::get_main_table(TABLE_MAIN_COURSE_REQUEST);
$from = intval($from);
$number_of_items = intval($number_of_items);

@ -126,7 +126,7 @@ function get_number_of_requests()
function get_request_data($from, $number_of_items, $column, $direction)
{
global $keyword;
$course_request_table = Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST);
$course_request_table = Database::get_main_table(TABLE_MAIN_COURSE_REQUEST);
if (DELETE_ACTION_ENABLED) {
$sql = "SELECT id AS col0,
@ -175,7 +175,7 @@ function get_request_data($from, $number_of_items, $column, $direction)
*/
function email_filter($teacher)
{
$sql = "SELECT user_id FROM ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." WHERE tutor_name LIKE '".$teacher."'";
$sql = "SELECT user_id FROM ".Database::get_main_table(TABLE_MAIN_COURSE_REQUEST)." WHERE tutor_name LIKE '".$teacher."'";
$res = Database::query($sql);
$info = Database::fetch_array($res);
return '<a href="./user_information.php?user_id='.$info[0].'">'.$teacher.'</a>';

@ -30,7 +30,7 @@ function validate_data($users_courses)
// 2.1 Check whethher code has been allready used by this CVS-file.
if (!isset($coursecodes[$user_course['CourseCode']])) {
// 2.1.1 Check whether course with this code exists in the system.
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT * FROM $course_table
WHERE code = '".Database::escape_string($user_course['CourseCode'])."'";
$res = Database::query($sql);

@ -29,7 +29,7 @@ function validate_data($users_courses)
// 2.1 Check whethher code has been allready used by this CVS-file.
if (!isset($coursecodes[$user_course['CourseCode']])) {
// 2.1.1 Check whether course with this code exists in the system.
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT * FROM $course_table
WHERE code = '".Database::escape_string($user_course['CourseCode'])."'";
$res = Database::query($sql);

@ -148,8 +148,8 @@ $htmlHeadXtra[] = '<script>
unset($_SESSION['disabled_languages']);
// setting the table that is needed for the styles management (there is a check if it exists later in this code)
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$tbl_settings_current = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
$tbl_settings_current = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
// we change the availability
if ($action == 'makeunavailable') {

@ -908,7 +908,7 @@ function displayTemplates()
function getNumberOfTemplates()
{
// Database table definition.
$table_system_template = Database :: get_main_table('system_template');
$table_system_template = Database::get_main_table('system_template');
// The sql statement.
$sql = "SELECT COUNT(id) AS total FROM $table_system_template";
@ -935,7 +935,7 @@ function getNumberOfTemplates()
function getTemplateData($from, $number_of_items, $column, $direction)
{
// Database table definition.
$table_system_template = Database :: get_main_table('system_template');
$table_system_template = Database::get_main_table('system_template');
// The sql statement.
$sql = "SELECT image as col0, title as col1, id as col2 FROM $table_system_template";
@ -1023,7 +1023,7 @@ function addEditTemplate()
// Getting all the information of the template when editing a template.
if ($_GET['action'] == 'edit') {
// Database table definition.
$table_system_template = Database :: get_main_table('system_template');
$table_system_template = Database::get_main_table('system_template');
$sql = "SELECT * FROM $table_system_template WHERE id = ".intval($_GET['id'])."";
$result = Database::query($sql);
$row = Database::fetch_array($result);
@ -1092,7 +1092,7 @@ function addEditTemplate()
}
// Store the information in the database (as insert or as update).
$table_system_template = Database :: get_main_table('system_template');
$table_system_template = Database::get_main_table('system_template');
if ($_GET['action'] == 'add') {
$content_template = Security::remove_XSS($values['template_text'], COURSEMANAGERLOWSECURITY);
$params = [
@ -1141,7 +1141,7 @@ function addEditTemplate()
function deleteTemplate($id)
{
// First we remove the image.
$table_system_template = Database :: get_main_table('system_template');
$table_system_template = Database::get_main_table('system_template');
$sql = "SELECT * FROM $table_system_template WHERE id = ".intval($id)."";
$result = Database::query($sql);
$row = Database::fetch_array($result);
@ -1215,7 +1215,7 @@ function generateSettingsForm($settings, $settings_by_access_list)
{
global $_configuration, $settings_to_avoid, $convert_byte_to_mega_list;
$em = Database::getManager();
$table_settings_current = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$table_settings_current = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$form = new FormValidator('settings', 'post', 'settings.php?category='.Security::remove_XSS($_GET['category']));
@ -1554,7 +1554,7 @@ function searchSetting($search)
if (empty($search)) {
return array();
}
$table_settings_current = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$table_settings_current = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$sql = "SELECT * FROM $table_settings_current
WHERE category <> 'Plugins' ORDER BY id ASC ";
$result = Database::store_result(Database::query($sql), 'ASSOC');

@ -51,7 +51,7 @@ if (isset($_POST['style'])) {
}
// Database table definitions.
$table_settings_current = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$table_settings_current = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
// Setting breadcrumbs.
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));

@ -25,8 +25,8 @@ $first_letter_course = '';
$courses = array();
$users = array();
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
/* Header */
$tool_name = get_lang('AddUsersToACourse');

@ -38,8 +38,8 @@ $interbreadcrumb[] = array("url" => 'user_list.php', "name" => get_lang('UserLis
$userId = $user['user_id'];
$tool_name = $user['complete_name'].(empty($user['official_code'])?'':' ('.$user['official_code'].')');
$table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
// only allow platform admins to login_as, or session admins only for students (not teachers nor other admins)
$login_as_icon = '';

@ -203,7 +203,7 @@ function prepare_user_sql_query($is_count)
// adding the filter to see the user's only of the current access_url
if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) {
$access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql.= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.id=url_rel_user.user_id)";
}

@ -72,7 +72,7 @@ function save_data($users_classes, $deleteUsersNotInList = false) {
global $purification_option_for_usernames;
// Table definitions.
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$usergroup = new UserGroup();

@ -91,7 +91,7 @@ EOF;
}
$tool_name = is_profile_editable() ? get_lang('ModifProfile') : get_lang('ViewProfile');
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
/*
* Get initial values for all fields.
@ -427,7 +427,7 @@ function check_user_email($email)
if ($user_id != strval(intval($user_id)) || empty($email)) {
return false;
}
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$email = Database::escape_string($email);
$sql = "SELECT * FROM $table_user
WHERE user_id='".$user_id."' AND email='".$email."'";

@ -745,7 +745,7 @@ if ($form->validate() && is_settings_editable()) {
);
$activeLegal = isset($updateValues['activate_legal']) ? $updateValues['activate_legal'] : 0;
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
$params = [
'title' => $updateValues['title'],

@ -81,8 +81,8 @@ if (Security::check_token('post') && (
$hiddenFields['sec_token'] = Security::get_token();
CourseSelectForm::display_form($course, $hiddenFields, true);
} else {
$table_c = Database :: get_main_table(TABLE_MAIN_COURSE);
$table_cu = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$table_c = Database::get_main_table(TABLE_MAIN_COURSE);
$table_cu = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$user_info = api_get_user_info();
$course_info = api_get_course_info();

@ -2740,7 +2740,7 @@ class Exercise
$lp_item_view_id = 0,
$status = 'incomplete'
) {
$track_exercises = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$track_exercises = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
if (empty($lp_id)) {
$lp_id = 0;
}

@ -45,7 +45,7 @@ $TBL_DOCUMENT = Database :: get_course_table(TABLE_DOCUMENT);
$TBL_ITEM_PROPERTY = Database :: get_course_table(TABLE_ITEM_PROPERTY);
$TBL_EXERCISE_QUESTION = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCISES = Database :: get_course_table(TABLE_QUIZ_TEST);
$TBL_TRACK_EXERCISES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
// document path
$documentPath = api_get_path(SYS_COURSE_PATH).$courseInfo['path']."/document";

@ -36,9 +36,9 @@ $path = isset($_GET['path']) ? Security::remove_XSS($_GET['path']) : null;
$is_allowedToEdit = api_is_allowed_to_edit(null, true) || api_is_drh() || api_is_student_boss();
$is_tutor = api_is_allowed_to_edit(true);
$TBL_TRACK_EXERCISES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_ATTEMPT = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$TBL_TRACK_ATTEMPT_RECORDING = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
$TBL_TRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_ATTEMPT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$TBL_TRACK_ATTEMPT_RECORDING = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
$TBL_LP_ITEM_VIEW = Database :: get_course_table(TABLE_LP_ITEM_VIEW);
$allowCoachFeedbackExercises = api_get_setting('allow_coach_feedback_exercises') === 'true';

@ -98,7 +98,7 @@ $endExercise = isset($_REQUEST['end_exercise']) && $_REQUEST['end_exercise'] ==
$error = '';
//Table calls
$exercise_attempt_table = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$exercise_attempt_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
/* Teacher takes an exam and want to see a preview,
we delete the objExercise from the session in order to get the latest

@ -31,8 +31,8 @@ $is_allowedToEdit = api_is_allowed_to_edit(null, true) || api_is_drh();
$is_tutor = api_is_allowed_to_edit(true);
$TBL_QUESTIONS = Database :: get_course_table(TABLE_QUIZ_QUESTION);
$TBL_TRACK_EXERCISES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_HOTPOTATOES_EXERCISES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$TBL_TRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_HOTPOTATOES_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$TBL_LP_ITEM_VIEW = Database :: get_course_table(TABLE_LP_ITEM_VIEW);
$course_id = api_get_course_int_id();

@ -109,7 +109,7 @@ if ($origin == 'group') {
$interbreadcrumb[] = array('url' => 'javascript: void (0);', 'name' => get_lang('EditPost'));
}
$table_link = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$table_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
/* Header */
$htmlHeadXtra[] = <<<JS

@ -112,7 +112,7 @@ if (!empty($groupId)) {
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditThread'));
}
$tableLink = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$tableLink = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
/* Header */

@ -27,7 +27,7 @@ $table_threads_qualify_historical = Database :: get_course_table(
$forum_table_attachment = Database :: get_course_table(TABLE_FORUM_ATTACHMENT);
$table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
$table_users = Database :: get_main_table(TABLE_MAIN_USER);
$table_users = Database::get_main_table(TABLE_MAIN_USER);
/*
Some configuration settings

@ -1713,7 +1713,7 @@ function get_last_post_information($forum_id, $show_invisibles = false, $course_
$table_posts = Database :: get_course_table(TABLE_FORUM_POST);
$table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
$table_users = Database :: get_main_table(TABLE_MAIN_USER);
$table_users = Database::get_main_table(TABLE_MAIN_USER);
$table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
$forum_id = intval($forum_id);
@ -1812,7 +1812,7 @@ function get_threads($forum_id, $courseId = null, $sessionId = null)
$sessionId = $sessionId !== null ? intval($sessionId) : api_get_session_id();
$table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
$table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
$table_users = Database :: get_main_table(TABLE_MAIN_USER);
$table_users = Database::get_main_table(TABLE_MAIN_USER);
$courseId = $courseId !== null ? intval($courseId) : api_get_course_int_id();
$groupInfo = GroupManager::get_group_properties($groupId);
@ -2069,7 +2069,7 @@ function getPosts(
function get_post_information($post_id)
{
$table_posts = Database :: get_course_table(TABLE_FORUM_POST);
$table_users = Database :: get_main_table(TABLE_MAIN_USER);
$table_users = Database::get_main_table(TABLE_MAIN_USER);
$course_id = api_get_course_int_id();
$sql = "SELECT posts.*, email FROM ".$table_posts." posts, ".$table_users." users
@ -2135,9 +2135,9 @@ function get_thread_information($forumId, $thread_id, $sessionId = null)
function get_thread_users_details($thread_id)
{
$t_posts = Database :: get_course_table(TABLE_FORUM_POST);
$t_users = Database :: get_main_table(TABLE_MAIN_USER);
$t_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$t_session_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$t_users = Database::get_main_table(TABLE_MAIN_USER);
$t_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$t_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$course_id = api_get_course_int_id();
@ -2190,9 +2190,9 @@ function get_thread_users_qualify($thread_id)
{
$t_posts = Database :: get_course_table(TABLE_FORUM_POST);
$t_qualify = Database :: get_course_table(TABLE_FORUM_THREAD_QUALIFY);
$t_users = Database :: get_main_table(TABLE_MAIN_USER);
$t_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$t_session_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$t_users = Database::get_main_table(TABLE_MAIN_USER);
$t_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$t_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$course_id = api_get_course_int_id();
$sessionId = api_get_session_id();
@ -2258,9 +2258,9 @@ function get_thread_users_not_qualify($thread_id)
{
$t_posts = Database :: get_course_table(TABLE_FORUM_POST);
$t_qualify = Database :: get_course_table(TABLE_FORUM_THREAD_QUALIFY);
$t_users = Database :: get_main_table(TABLE_MAIN_USER);
$t_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$t_session_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$t_users = Database::get_main_table(TABLE_MAIN_USER);
$t_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$t_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$is_western_name_order = api_is_western_name_order();
if ($is_western_name_order) {
@ -4056,7 +4056,7 @@ function handle_mail_cue($content, $id)
$table_forums = Database :: get_course_table(TABLE_FORUM);
$table_threads = Database :: get_course_table(TABLE_FORUM_THREAD);
$table_posts = Database :: get_course_table(TABLE_FORUM_POST);
$table_users = Database :: get_main_table(TABLE_MAIN_USER);
$table_users = Database::get_main_table(TABLE_MAIN_USER);
$course_id = api_get_course_int_id();

@ -9,7 +9,7 @@ require_once __DIR__.'/../inc/global.inc.php';
api_block_anonymous_users();
GradebookUtils::block_students();
$tbl_grade_links = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
//selected name of database
$course_id = GradebookUtils::get_course_id_by_link_id($_GET['editlink']);
$tbl_forum_thread = Database:: get_course_table(TABLE_FORUM_THREAD);

@ -28,8 +28,8 @@ Display :: display_header('');
echo Display::page_header(get_lang('GradebookQualifyLog'));
$t_linkeval_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
$t_user = Database :: get_main_table(TABLE_MAIN_USER);
$t_linkeval_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
$t_user = Database::get_main_table(TABLE_MAIN_USER);
$visible_log=Security::remove_XSS($_GET['visiblelog']);
$evaledit = Evaluation :: load($visible_log);

@ -87,7 +87,7 @@ function confirmation() {
$tbl_forum_thread = Database :: get_course_table(TABLE_FORUM_THREAD);
$tbl_attendance = Database :: get_course_table(TABLE_ATTENDANCE);
$tbl_grade_links = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$filter_confirm_msg = true;
$filter_warning_msg = true;
$courseInfo = api_get_course_info();

@ -47,7 +47,7 @@ class AttendanceLink extends AbstractLink
if (empty($this->course_code)) {
die('Error in get_not_created_links() : course code not set');
}
$tbl_grade_links = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$sql = 'SELECT att.id, att.name, att.attendance_qualify_title
FROM '.$this->get_attendance_table().' att

@ -80,7 +80,7 @@ switch ($action) {
*/
function version_check()
{
$tbl_settings = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$tbl_settings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$sql = 'SELECT selected_value FROM '.$tbl_settings.' WHERE variable = "registered" ';
$result = Database::query($sql);
$row = Database::fetch_array($result, 'ASSOC');

@ -175,8 +175,8 @@ switch ($action) {
break;
case 'search_user_by_course':
if (api_is_platform_admin()) {
$user = Database :: get_main_table(TABLE_MAIN_USER);
$session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$user = Database::get_main_table(TABLE_MAIN_USER);
$session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$course = api_get_course_info_by_id($_GET['course_id']);
$json = [

@ -945,6 +945,8 @@ switch ($action) {
'title',
'qualification',
'sent_date',
'status',
'has_correction',
'correction',
'actions'
);

@ -123,7 +123,7 @@ switch ($action) {
$status = intval($_GET['status']);
if (!empty($user_id)) {
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql = "UPDATE $user_table
SET active='".$status."'
WHERE user_id='".$user_id."'";

@ -543,7 +543,7 @@ if (!$x = strpos($_SERVER['PHP_SELF'], 'whoisonline.php')) {
if (!isset($_SESSION['login_as']) && isset($_user)) {
// if $_SESSION['login_as'] is set, then the user is an admin logged as the user
$tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$tbl_track_login = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql = "SELECT login_id, login_date
FROM $tbl_track_login
WHERE

@ -1567,7 +1567,7 @@ function api_get_user_info_from_username($username = '')
}
$username = trim($username);
$sql = "SELECT * FROM ".Database :: get_main_table(TABLE_MAIN_USER)."
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_USER)."
WHERE username='".Database::escape_string($username)."'";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
@ -1587,7 +1587,7 @@ function api_get_user_info_from_email($email = '')
if (empty($email)) {
return false;
}
$sql = "SELECT * FROM ".Database :: get_main_table(TABLE_MAIN_USER)."
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_USER)."
WHERE email ='".Database::escape_string($email)."' LIMIT 1";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
@ -5009,7 +5009,7 @@ function api_get_status_langvars() {
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
*/
function api_get_settings_options($var) {
$table_settings_options = Database :: get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
$table_settings_options = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
$var = Database::escape_string($var);
$sql = "SELECT * FROM $table_settings_options
WHERE variable = '$var'
@ -5491,7 +5491,7 @@ function api_is_course_visible_for_user($userid = null, $cid = null) {
return true;
}
$tbl_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$sql = "SELECT
is_tutor, status
@ -5561,7 +5561,7 @@ function api_is_course_visible_for_user($userid = null, $cid = null) {
$is_courseCoach = true;
$is_sessionAdmin = false;
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT status FROM $tbl_user
WHERE user_id = $userid
@ -5703,7 +5703,7 @@ function api_request_uri() {
* @return int access_url_id of the current Chamilo Installation
*/
function api_get_current_access_url_id() {
$access_url_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL);
$access_url_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL);
$path = Database::escape_string(api_get_path(WEB_PATH));
$sql = "SELECT id FROM $access_url_table WHERE url = '".$path."'";
$result = Database::query($sql);
@ -5725,8 +5725,8 @@ function api_get_current_access_url_id() {
*/
function api_get_access_url_from_user($user_id) {
$user_id = intval($user_id);
$table_url_rel_user = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$table_url = Database :: get_main_table(TABLE_MAIN_ACCESS_URL);
$table_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$table_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL);
$sql = "SELECT access_url_id
FROM $table_url_rel_user url_rel_user
INNER JOIN $table_url u
@ -5748,7 +5748,7 @@ function api_get_access_url_from_user($user_id) {
*/
function api_get_status_of_user_in_course($user_id, $courseId)
{
$tbl_rel_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_rel_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
if (!empty($user_id) && !empty($courseId)) {
$user_id = intval($user_id);
$courseId = intval($courseId);
@ -7188,7 +7188,7 @@ function api_get_user_info_from_official_code($officialCode)
if (empty($officialCode)) {
return false;
}
$sql = "SELECT * FROM ".Database :: get_main_table(TABLE_MAIN_USER)."
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_USER)."
WHERE official_code ='".Database::escape_string($officialCode)."'";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
@ -7627,7 +7627,7 @@ function api_get_supported_image_extensions($supportVectors = true)
* @todo the $_settings should be reloaded here. => write api function for this and use this in global.inc.php also.
*/
function api_register_campus($listCampus = true) {
$tbl_settings = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$tbl_settings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$sql = "UPDATE $tbl_settings SET selected_value='true' WHERE variable='registered'";
Database::query($sql);

@ -98,7 +98,7 @@ function online_logout($user_id = null, $logout_redirect = false)
global $extAuthSource;
// Database table definition
$tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$tbl_track_login = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
if (empty($user_id)) {
$user_id = isset($_GET['uid']) ? intval($_GET['uid']) : 0;

@ -5,8 +5,8 @@
*/
// Database table definitions
$table_sf = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
$table_sf_val = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
$table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
$table_sf_val = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
/**
* Add a specific field
@ -223,7 +223,7 @@ function add_specific_field_value(
* @param int $ref_id intern id inside specific tool table
*/
function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id) {
$table_sf_values = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
$table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
$sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s AND field_id = %s';
$sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);
Database::query($sql);
@ -237,7 +237,7 @@ function delete_all_specific_field_value($course_id, $id_specific_field, $tool_i
* @param int Internal ID used in specific tool table
*/
function delete_all_values_for_item($course_id, $tool_id, $ref_id) {
$table_sf_values = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
$table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
$sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
$sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);
Database::query($sql);

@ -50,7 +50,7 @@ class ZombieManager
access.login_date';
if (api_is_multiple_url_enabled()) {
$access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$current_url_id = api_get_current_access_url_id();
$sql .= " FROM $user_table as user, $login_table as access, $access_url_rel_user_table as url

@ -1200,9 +1200,9 @@ if ((isset($uidReset) && $uidReset) || (isset($cidReset) && $cidReset)) {
// This user has no status related to this course
// The user is subscribed in a session? The user is a Session coach a Session admin ?
$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
$tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
// Session coach, session admin or course coach admin
$sql = "SELECT session.id_coach, session_admin_id, session_rcru.user_id

@ -3018,7 +3018,7 @@ function get_group_picture_path_by_id($id, $type = 'web', $preview = false, $ano
$id = intval($id);
//$group_table = Database :: get_main_table(TABLE_MAIN_GROUP);
//$group_table = Database::get_main_table(TABLE_MAIN_GROUP);
$group_table = 'groups';
$sql = "SELECT picture_uri FROM $group_table WHERE id=".$id;
$res = Database::query($sql);

@ -437,7 +437,7 @@ function save_item(
if (!isset($_SESSION['login_as'])) {
// If $_SESSION['login_as'] is set, then the user is an admin logged as the user.
$tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$tbl_track_login = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql = "SELECT login_id, login_date
FROM $tbl_track_login

@ -21,12 +21,12 @@ 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);
$tbl_admin = Database :: get_main_table(TABLE_MAIN_ADMIN);
$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);
$tbl_admin = Database::get_main_table(TABLE_MAIN_ADMIN);
if (isset($_POST['export'])) {
$order_clause = api_is_western_name_order(PERSON_NAME_DATA_EXPORT) ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';

@ -27,14 +27,14 @@ Display :: display_header($nameTools);
api_display_tool_title($nameTools);
// Database Table Definitions
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_rel_course_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_track_login = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
/**
* MAIN PART

@ -181,8 +181,8 @@ if (isset($_GET['details'])) {
}
// Database Table Definitions
$tbl_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_stats_exercices = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_stats_exercices = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
if (isset($_GET['user_id']) && $_GET['user_id'] != "") {
$user_id = intval($_GET['user_id']);

@ -20,11 +20,11 @@ $interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace'));
Display :: display_header($nameTools);
// Database Table Definitions
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
$tbl_track_exercice = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_track_exercice = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
/*
MAIN CODE

@ -31,7 +31,7 @@ if (api_get_setting('add_users_by_coach') === 'true') {
if (!api_is_platform_admin()) {
if (isset($_REQUEST['id_session'])) {
$id_session = intval($_REQUEST['id_session']);
$sql = 'SELECT id_coach FROM '.Database :: get_main_table(TABLE_MAIN_SESSION).'
$sql = 'SELECT id_coach FROM '.Database::get_main_table(TABLE_MAIN_SESSION).'
WHERE id='.$id_session;
$rs = Database::query($sql);
if (Database::result($rs, 0, 0) != $_user['user_id']) {

@ -40,7 +40,7 @@ if (empty($id_user) || empty($id_session)) {
if (!api_is_platform_admin()) {
$sql = 'SELECT session_admin_id
FROM '.Database :: get_main_table(TABLE_MAIN_SESSION).'
FROM '.Database::get_main_table(TABLE_MAIN_SESSION).'
WHERE id='.$id_session;
$rs = Database::query($sql);
if (Database::result($rs,0,0)!=$_user['user_id']) {

@ -63,7 +63,7 @@ if (api_get_setting('profile', 'picture') == 'true') {
$_FILES['picture']['name'],
$_FILES['picture']['tmp_name']
)) {
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$sql = "UPDATE $table_user
SET

@ -319,7 +319,7 @@ $social_right_content = '';
$listInvitations = '';
if ($show_full_profile) {
$t_ufo = Database :: get_main_table(TABLE_EXTRA_FIELD_OPTIONS);
$t_ufo = Database::get_main_table(TABLE_EXTRA_FIELD_OPTIONS);
$extra_user_data = UserManager::get_extra_user_data($user_id, false, true);
$extra_information = '';

@ -19,9 +19,9 @@ $this_section = SECTION_COURSES;
// Database table definitions
$table_survey = Database :: get_course_table(TABLE_SURVEY);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$table_gradebook_link = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
$table_gradebook_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
/** @todo this has to be moved to a more appropriate place (after the display_header of the code) */
// If user is not teacher or if he's a coach trying to access an element out of his session

@ -34,7 +34,7 @@ $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER);
$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
$table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
$table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
// Check if user is anonymous or not
if (api_is_anonymous(api_get_user_id(), true)) {

@ -141,10 +141,10 @@ function show_form()
*/
function get_number_of_users()
{
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT COUNT(u.user_id) AS total_number_of_items FROM $user_table u";
if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) {
$access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql .= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.user_id=url_rel_user.user_id)";
}
if (isset($_GET['keyword'])) {
@ -172,7 +172,7 @@ function get_number_of_users()
*/
function get_user_data($from, $number_of_items, $column, $direction)
{
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
if (api_is_western_name_order()) {
$col34 = "u.firstname AS col3,

@ -751,7 +751,7 @@ function active_filter($active, $url_params, $row)
function search_additional_profile_fields($keyword)
{
// database table definitions
$table_user_field_options = Database :: get_main_table(TABLE_EXTRA_FIELD_OPTIONS);
$table_user_field_options = Database::get_main_table(TABLE_EXTRA_FIELD_OPTIONS);
$table_user_field_values = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES);
$tableExtraField = Database::get_main_table(TABLE_EXTRA_FIELD);
$table_user = Database::get_main_table(TABLE_MAIN_USER);

@ -287,7 +287,7 @@ if (api_is_allowed_to_edit(null, true)) {
if ($sessionId == 0) {
// users directly subscribed to the course
$table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$sql = "SELECT DISTINCT
user.user_id, ".($is_western_name_order ? "user.firstname, user.lastname" : "user.lastname, user.firstname").",
user.username,

@ -142,7 +142,7 @@ class WSCMUser extends WSCM {
*/
private static function get_user_list_like_start($conditions = array(), $order_by = array())
{
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$return_array = array();
$sql_query = "SELECT * FROM $user_table";
if (count($conditions) > 0) {

@ -1517,7 +1517,7 @@ function WSEditUserCredentials($params)
$userRepository = UserManager::getRepository();
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$original_user_id_value = $params['original_user_id_value'];
$original_user_id_name = $params['original_user_id_name'];
@ -1618,7 +1618,7 @@ function WSEditUsers($params)
$userManager = UserManager::getManager();
$userRepository = UserManager::getRepository();
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$users_params = $params['users'];
$results = array();
@ -1811,7 +1811,7 @@ function WSEditUser($params)
$userManager = UserManager::getManager();
$userRepository = UserManager::getRepository();
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$original_user_id_value = $params['original_user_id_value'];
$original_user_id_name = $params['original_user_id_name'];
@ -1985,7 +1985,7 @@ function WSEditUserWithPicture($params)
$userManager = UserManager::getManager();
$userRepository = UserManager::getRepository();
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$original_user_id_value = $params['original_user_id_value'];
$original_user_id_name = $params['original_user_id_name'];
@ -2205,7 +2205,7 @@ function WSEditUsersPasswordCrypted($params) {
}
// get user id from id of remote system
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$users_params = $params['users'];
$results = array();
@ -2813,7 +2813,7 @@ function WSCreateCourse($params)
if (!WSHelperVerifyKey($params)) {
return returnError(WS_ERROR_SECRET_KEY);
}
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
$courses_params = $params['courses'];
$results = array();
@ -3327,7 +3327,7 @@ function WSEditCourse($params){
$course_code = $courseInfo['code'];
$courseId = $courseInfo['real_id'];
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT concat(lastname,'',firstname) as tutor_name
FROM $table_user WHERE status='1' AND user_id = '$tutor_id'
ORDER BY lastname,firstname";
@ -3751,7 +3751,7 @@ function WSDeleteCourse($params)
return returnError(WS_ERROR_SECRET_KEY);
}
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
$courses_params = $params['courses'];
$results = array();
$orig_course_id_value = array();
@ -4856,7 +4856,7 @@ function WSUnsubscribeUserFromCourse($params)
}
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$userscourses_params = $params['userscourses'];
$results = array();

@ -82,7 +82,7 @@ function complete_missing_data($user) {
* Save the imported data
*/
function save_data($users) {
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
if(is_array($users)) {
foreach ($users as $index => $user) {
$user = complete_missing_data($user);

@ -8,9 +8,9 @@
include_once './main/inc/global.inc.php';
api_block_anonymous_users();
$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
$tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
/**
* Header

Loading…
Cancel
Save