[svn r10190] first run of cleanup of the table names

http://www.dokeos.com/forum/viewtopic.php?t=7982
skala
Patrick Cool 19 years ago
parent 7e55c0724a
commit 43833b9ae9
  1. 6
      index.php
  2. 2
      main/admin/add_courses_to_session.php
  3. 19
      main/admin/add_users_to_session.php
  4. 6
      main/admin/class_list.php
  5. 10
      main/admin/class_user_import.php
  6. 2
      main/admin/configure_extensions.php
  7. 6
      main/admin/course_add.php
  8. 4
      main/admin/course_category.php
  9. 4
      main/admin/course_edit.php
  10. 5
      main/admin/course_import.php
  11. 12
      main/admin/course_information.php
  12. 6
      main/admin/course_list.php
  13. 4
      main/admin/course_user_import.php
  14. 6
      main/admin/index.php
  15. 23
      main/admin/resume_session.php
  16. 2
      main/admin/session_add.php
  17. 5
      main/admin/session_course_edit.php
  18. 2
      main/admin/session_course_list.php
  19. 5
      main/admin/session_course_user_list.php
  20. 3
      main/admin/session_edit.php
  21. 14
      main/admin/session_export.php
  22. 13
      main/admin/session_import.php
  23. 14
      main/admin/statistics/statistics.lib.php
  24. 6
      main/admin/subscribe_class2course.php
  25. 7
      main/admin/subscribe_user2class.php
  26. 7
      main/admin/subscribe_user2course.php
  27. 21
      main/admin/user_add.php
  28. 6
      main/admin/user_edit.php
  29. 9
      main/admin/user_export.php
  30. 4
      main/admin/user_import.php
  31. 6
      main/admin/user_information.php
  32. 12
      main/admin/user_list.php
  33. 6
      main/announcements/announcements.php
  34. 16
      main/auth/courses.php
  35. 8
      main/auth/inscription.php
  36. 4
      main/auth/inscription_second.php
  37. 4
      main/auth/lostPassword.php
  38. 4
      main/auth/lost_password.lib.php
  39. 27
      main/auth/my_progress.php
  40. 6
      main/auth/profile.php
  41. 16
      main/calendar/agenda.php
  42. 2
      main/calendar/myagenda.php
  43. 4
      main/course_home/course_home.php
  44. 6
      main/course_info/infocours.php
  45. 4
      main/course_info/postpone.php
  46. 10
      main/coursecopy/classes/CourseBuilder.class.php
  47. 8
      main/coursecopy/classes/CourseRecycler.class.php
  48. 14
      main/coursecopy/classes/CourseRestorer.class.php
  49. 4
      main/coursecopy/copy_course.php
  50. 2
      main/dropbox/dropbox_functions.inc.php
  51. 5
      main/exercice/addlimits.php
  52. 5
      main/exercice/exercice.php
  53. 26
      main/exercice/exercise_result.php
  54. 17
      main/exercice/exercise_show.php
  55. 2
      main/forum/forumconfig.inc.php
  56. 4
      main/inc/lib/add_course.lib.inc.php
  57. 28
      main/inc/lib/blog.lib.php
  58. 18
      main/inc/lib/classmanager.lib.php
  59. 48
      main/inc/lib/course.lib.php
  60. 24
      main/inc/lib/database.lib.php
  61. 2
      main/inc/lib/document.lib.php
  62. 4
      main/inc/lib/formvalidator/Rule/UsernameAvailable.php
  63. 29
      main/inc/lib/groupmanager.lib.php
  64. 2
      main/inc/lib/main_api.lib.php
  65. 6
      main/inc/lib/online.inc.php
  66. 8
      main/inc/lib/surveymanager.lib.php
  67. 18
      main/inc/lib/usermanager.lib.php
  68. 10
      main/inc/local.inc.php
  69. 4
      main/install/update_db.inc.php
  70. 6
      main/mySpace/admin.php
  71. 4
      main/mySpace/coaches.php
  72. 4
      main/mySpace/cours.php
  73. 225
      main/mySpace/index.php
  74. 4
      main/mySpace/myStudents.php
  75. 4
      main/mySpace/progression.php
  76. 4
      main/mySpace/reussite.php
  77. 2
      main/mySpace/session.php
  78. 10
      main/mySpace/student.php
  79. 4
      main/mySpace/teachers.php
  80. 2
      main/newscorm/aicc.class.php
  81. 4
      main/newscorm/learnpath.class.php
  82. 2
      main/newscorm/learnpath_functions.inc.php
  83. 20
      main/newscorm/resourcelinker.inc.php
  84. 8
      main/newscorm/resourcelinker.php
  85. 4
      main/newscorm/scorm.class.php
  86. 2
      main/newscorm/scorm_migrate_clean_db.php
  87. 2
      main/newscorm/scorm_migrate_clean_tracking_time.php
  88. 4
      main/newscorm/scorm_migrate_db.php
  89. 4
      main/newscorm/scorm_migrate_db_one_course.php
  90. 2
      main/newscorm/scorm_migrate_hometools.php
  91. 2
      main/newscorm/scorm_migrate_hometools_reverse.php
  92. 2
      main/online/online_chat.php
  93. 2
      main/online/online_hidden1.php
  94. 2
      main/online/online_hidden2.php
  95. 2
      main/online/online_htmlarea.php
  96. 4
      main/online/online_links.php
  97. 4
      main/online/online_master.php
  98. 4
      main/online/online_message.php
  99. 4
      main/online/online_streaming.php
  100. 4
      main/online/online_whoisonline.php
  101. Some files were not shown because too many files have changed in this diff Show More

@ -121,7 +121,7 @@ if ($_GET['logout'])
Table definitions
-----------------------------------------------------------
*/
$main_course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$main_course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$main_category_table = Database :: get_main_table(MAIN_CATEGORY_TABLE);
$track_login_table = Database :: get_statistic_table(STATISTIC_TRACK_E_LOGIN_TABLE);
/*
@ -430,7 +430,7 @@ function display_anonymous_course_list()
//init
$web_course_path = api_get_path(WEB_COURSE_PATH);
$category = $_GET["category"];
$main_course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$main_course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$main_category_table = Database :: get_main_table(MAIN_CATEGORY_TABLE);
$platformLanguage = api_get_setting('platformLanguage');
@ -545,7 +545,7 @@ function display_anonymous_course_list()
function category_has_open_courses($category)
{
$main_course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$main_course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql_query = "SELECT * FROM $main_course_table WHERE category_code='$category'";
$sql_result = api_sql_query($sql_query, __FILE__, __LINE__);
while ($course = mysql_fetch_array($sql_result))

@ -45,7 +45,7 @@ $tbl_session_rel_course_rel_user=Database::get_main_table(MAIN_SESSION_COURSE_US
$tbl_session=Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_session_rel_user=Database::get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_session_rel_course=Database::get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_course=Database::get_main_table(MAIN_COURSE_TABLE);
$tbl_course=Database::get_main_table(TABLE_MAIN_COURSE);
$noPHP_SELF=true;

@ -42,15 +42,16 @@ $errorMsg=$firstLetterUser=$firstLetterSession='';
$UserList=$SessionList=array();
$users=$sessions=array();
$tbl_session=Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_session_rel_class=Database::get_main_table(MAIN_SESSION_CLASS_TABLE);
$tbl_session_rel_course=Database::get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_rel_course_rel_user=Database::get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_course=Database::get_main_table(MAIN_COURSE_TABLE);
$tbl_user=Database::get_main_table(MAIN_USER_TABLE);
$tbl_session_rel_user=Database::get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_class=Database::get_main_table(MAIN_CLASS_TABLE);
$tbl_class_user=Database::get_main_table(MAIN_CLASS_USER_TABLE);
// Table Definitions
$tbl_session = Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_session_rel_class = Database::get_main_table(MAIN_SESSION_CLASS_TABLE);
$tbl_session_rel_course = Database::get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_rel_course_rel_user = Database::get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_rel_user = Database::get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_class = Database::get_main_table(TABLE_MAIN_CLASS);
$tbl_class_user = Database::get_main_table(MAIN_CLASS_USER_TABLE);
$noPHP_SELF=true;

@ -1,5 +1,5 @@
<?php
// $Id: class_list.php 9406 2006-10-10 11:28:36Z bmol $
// $Id: class_list.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -37,7 +37,7 @@ $this_section = SECTION_PLATFORM_ADMIN;
*/
function get_number_of_classes()
{
$tbl_class = Database :: get_main_table(MAIN_CLASS_TABLE);
$tbl_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$sql = "SELECT COUNT(*) AS number_of_classes FROM $tbl_class";
if (isset ($_GET['keyword']))
{
@ -56,7 +56,7 @@ function get_number_of_classes()
function get_class_data($from, $number_of_items, $column, $direction)
{
$tbl_class_user = Database :: get_main_table(MAIN_CLASS_USER_TABLE);
$tbl_class = Database :: get_main_table(MAIN_CLASS_TABLE);
$tbl_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$sql = "SELECT id AS col0,
name AS col1,
COUNT(user_id) AS col2,

@ -54,7 +54,7 @@ function validate_data($user_classes)
if (!isset ($classcodes[$user_class['ClassName']]))
{
//2.1.1 check if code exists in DB
$class_table = Database :: get_main_table(MAIN_CLASS_TABLE);
$class_table = Database :: get_main_table(TABLE_MAIN_CLASS);
$sql = "SELECT * FROM $class_table WHERE name = '".mysql_real_escape_string($user_class['ClassName'])."'";
$res = api_sql_query($sql, __FILE__, __LINE__);
if (mysql_num_rows($res) == 0)
@ -86,9 +86,11 @@ function validate_data($user_classes)
*/
function save_data($users_classes)
{
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$class_user_table = Database :: get_main_table(MAIN_CLASS_USER_TABLE);
$class_table = Database :: get_main_table(MAIN_CLASS_TABLE);
// table definitions
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$class_user_table = Database :: get_main_table(MAIN_CLASS_USER_TABLE);
$class_table = Database :: get_main_table(TABLE_MAIN_CLASS);
$csv_data = array ();
foreach ($users_classes as $index => $user_class)
{

@ -56,7 +56,7 @@ if(isset($_POST['activeExtension'])){
// select all the courses and insert the tool inside
$sql = 'SELECT db_name FROM '.Database::get_main_table(MAIN_COURSE_TABLE);
$sql = 'SELECT db_name FROM '.Database::get_main_table(TABLE_MAIN_COURSE);
$rs = api_sql_query($sql);
while($row = mysql_fetch_array($rs)){

@ -1,5 +1,5 @@
<?php
// $Id: course_add.php 10082 2006-11-21 19:08:15Z pcool $
// $Id: course_add.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -43,7 +43,7 @@ require_once (api_get_path(LIBRARY_PATH).'fileManage.lib.php');
require_once (api_get_path(CONFIGURATION_PATH).'add_course.conf.php');
require_once (api_get_path(LIBRARY_PATH).'add_course.lib.inc.php');
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
$table_course = Database::get_main_table(MAIN_COURSE_TABLE);
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tool_name = get_lang('AddCourse');
//$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('PlatformAdmin'));
@ -63,7 +63,7 @@ while ($cat = mysql_fetch_array($res))
}
// Get all possible teachers
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "SELECT user_id,lastname,firstname FROM $table_user WHERE status=1 ORDER BY lastname,firstname";
$res = api_sql_query($sql,__FILE__,__LINE__);
$teachers = array();

@ -1,4 +1,4 @@
<?php // $Id: course_category.php 9246 2006-09-25 13:24:53Z bmol $
<?php // $Id: course_category.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -38,7 +38,7 @@ api_protect_admin_script();
$category=$_GET['category'];
$action=$_GET['action'];
$tbl_course = Database::get_main_table(MAIN_COURSE_TABLE);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_category = Database::get_main_table(MAIN_CATEGORY_TABLE);
$errorMsg='';

@ -1,6 +1,6 @@
<?php
// $Id: course_edit.php 10154 2006-11-23 08:48:12Z elixir_inter $
// $Id: course_edit.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -42,7 +42,7 @@ $this_section=SECTION_PLATFORM_ADMIN;
api_protect_admin_script();
include (api_get_path(LIBRARY_PATH).'fileManage.lib.php');
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
$course_table = Database::get_main_table(MAIN_COURSE_TABLE);
$course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$course_code = isset($_GET['course_code']) ? $_GET['course_code'] : $_POST['code'];
$noPHP_SELF = true;
$tool_name = get_lang('ModifyCourseInfo');

@ -64,7 +64,7 @@ function validate_data($courses)
//2.3 check if code allready used in DB
else
{
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT * FROM $course_table WHERE code = '".mysql_real_escape_string($course['Code'])."'";
$res = api_sql_query($sql, __FILE__, __LINE__);
if (mysql_num_rows($res) > 0)
@ -106,10 +106,11 @@ function validate_data($courses)
function save_data($courses)
{
global $_configuration, $firstExpirationDelay;
foreach($courses as $index => $course)
{
$keys = define_course_keys($course['Code'], "", $_configuration['db_prefix']);
$user_table = Database::get_main_table(MAIN_USER_TABLE);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT user_id, CONCAT(lastname,' ',firstname) AS name FROM $user_table WHERE username = '".mysql_real_escape_string($course['Teacher'])."'";
$res = api_sql_query($sql,__FILE__,__LINE__);
$teacher = mysql_fetch_object($res);

@ -1,5 +1,5 @@
<?php
// $Id: course_information.php 10154 2006-11-23 08:48:12Z elixir_inter $
// $Id: course_information.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -45,7 +45,7 @@ api_protect_admin_script();
*/
function get_course_usage($course_code)
{
$table = Database::get_main_table(MAIN_COURSE_TABLE);
$table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT * FROM $table WHERE code='".$course_code."'";
$res = api_sql_query($sql,__FILE__,__LINE__);
$course = mysql_fetch_object($res);
@ -53,7 +53,7 @@ function get_course_usage($course_code)
$table = Database :: get_course_table(LEARNPATH_MAIN_TABLE, $course->db_name);
$usage[] = array (get_lang(TOOL_LEARNPATH), Database::count_rows($table));
// Forums
$table = Database :: get_course_table(TOOL_FORUM_TABLE, $course->db_name);
$table = Database :: get_course_table(TABLE_FORUM, $course->db_name);
$usage[] = array (get_lang(TOOL_BB_FORUM), Database::count_rows($table));
// Quizzes
$table = Database :: get_course_table(QUIZ_TEST_TABLE, $course->db_name);
@ -82,7 +82,7 @@ if (!isset ($_GET['code']))
}
//$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array ("url" => 'course_list.php', "name" => get_lang('Courses'));
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$code = $_GET['code'];
$sql = "SELECT * FROM $table_course WHERE code = '".$code."'";
$res = api_sql_query($sql,__FILE__,__LINE__);
@ -120,7 +120,7 @@ echo '</blockquote>';
echo '<h4>'.get_lang('Users').'</h4>';
echo '<blockquote>';
$table_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$sql = 'SELECT *,cu.status as course_status FROM '.$table_course_user.' cu, '.$table_user." u WHERE cu.user_id = u.user_id AND cu.course_code = '".$code."' ";
$res = api_sql_query($sql,__FILE__,__LINE__);
if (mysql_num_rows($res) > 0)
@ -157,7 +157,7 @@ echo '</blockquote>';
* Show all classes subscribed in this course
*/
$table_course_class = Database :: get_main_table(MAIN_COURSE_CLASS_TABLE);
$table_class = Database :: get_main_table(MAIN_CLASS_TABLE);
$table_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$sql = 'SELECT * FROM '.$table_course_class.' cc, '.$table_class.' c WHERE cc.class_id = c.id AND cc.course_code = '."'".$_GET['code']."'";
$res = api_sql_query($sql,__FILE__,__LINE__);
if (mysql_num_rows($res) > 0)

@ -1,5 +1,5 @@
<?php
// $Id: course_list.php 9246 2006-09-25 13:24:53Z bmol $
// $Id: course_list.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -47,7 +47,7 @@ require_once (api_get_path(LIBRARY_PATH).'sortabletable.class.php');
*/
function get_number_of_courses()
{
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT COUNT(code) AS total_number_of_items FROM $course_table";
if (isset ($_GET['keyword']))
{
@ -74,7 +74,7 @@ function get_number_of_courses()
*/
function get_course_data($from, $number_of_items, $column, $direction)
{
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT code AS col0, visual_code AS col1, title AS col2, course_language AS col3, category_code AS col4, subscribe AS col5, unsubscribe AS col6, code AS col7, code AS col8 FROM $course_table";
if (isset ($_GET['keyword']))
{

@ -53,7 +53,7 @@ function validate_data($users_courses)
if (!isset ($coursecodes[$user_course['CourseCode']]))
{
//2.1.1 check if code exists in DB
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT * FROM $course_table WHERE code = '".mysql_real_escape_string($user_course['CourseCode'])."'";
$res = api_sql_query($sql, __FILE__, __LINE__);
if (mysql_num_rows($res) == 0)
@ -94,7 +94,7 @@ function validate_data($users_courses)
*/
function save_data($users_courses)
{
$user_table= Database::get_main_table(MAIN_USER_TABLE);
$user_table= Database::get_main_table(TABLE_MAIN_USER);
$course_user_table= Database::get_main_table(MAIN_COURSE_USER_TABLE);
$csv_data = array();
foreach ($users_courses as $index => $user_course)

@ -1,4 +1,4 @@
<?php // $Id: index.php 10178 2006-11-23 14:11:01Z bmol $
<?php // $Id: index.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -284,12 +284,12 @@ function check_dokeos_version2()
if (ini_get('allow_url_fopen')==1)
{
// the number of courses
$sql="SELECT code FROM ".Database::get_main_table(MAIN_COURSE_TABLE);
$sql="SELECT code FROM ".Database::get_main_table(TABLE_MAIN_COURSE);
$result=api_sql_query($sql);
$number_of_courses = mysql_num_rows($result);
// the number of users
$sql="SELECT user_id FROM ".Database::get_main_table(MAIN_USER_TABLE);
$sql="SELECT user_id FROM ".Database::get_main_table(TABLE_MAIN_USER);
$result=api_sql_query($sql);
$number_of_users = mysql_num_rows($result);

@ -37,19 +37,20 @@ $langFile = 'admin';
$cidReset = true;
require ('../inc/global.inc.php');
api_protect_admin_script();
$tool_name = "Résumé de la session";
$tool_name = get_lang('SessionOverview');
$interbreadcrumb[]=array("url" => "index.php","name" => get_lang('AdministrationTools'));
$interbreadcrumb[]=array("url" => "session_list.php","name" => "Liste des sessions");
$interbreadcrumb[]=array("url" => "session_list.php","name" => get_lang('SessionList'));
$tbl_session=Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_session_rel_class=Database::get_main_table(MAIN_SESSION_CLASS_TABLE);
$tbl_session_rel_course=Database::get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_course=Database::get_main_table(MAIN_COURSE_TABLE);
$tbl_user=Database::get_main_table(MAIN_USER_TABLE);
$tbl_session_rel_user=Database::get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_session_rel_course_rel_user=Database::get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_class=Database::get_main_table(MAIN_CLASS_TABLE);
$tbl_class_rel_user=Database::get_main_table(MAIN_CLASS_USER_TABLE);
// Table Definitions
$tbl_session = Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_session_rel_class = Database::get_main_table(MAIN_SESSION_CLASS_TABLE);
$tbl_session_rel_course = Database::get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_rel_user = Database::get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_session_rel_course_rel_user = Database::get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_class = Database::get_main_table(TABLE_MAIN_CLASS);
$tbl_class_rel_user = Database::get_main_table(MAIN_CLASS_USER_TABLE);
$id_session = $_GET['id_session'];

@ -10,7 +10,7 @@ api_protect_admin_script();
$formSent=0;
$errorMsg='';
$tbl_user=Database::get_main_table(MAIN_USER_TABLE);
$tbl_user=Database::get_main_table(TABLE_MAIN_USER);
$tbl_session=Database::get_main_table(MAIN_SESSION_TABLE);
$tool_name = get_lang('AddSession');

@ -13,8 +13,9 @@ $course_code=trim(stripslashes($_GET['course_code']));
$formSent=0;
$errorMsg='';
$tbl_user=Database::get_main_table(MAIN_USER_TABLE);
$tbl_course=Database::get_main_table(MAIN_COURSE_TABLE);
// Table definitions
$tbl_user=Database::get_main_table(TABLE_MAIN_USER);
$tbl_course=Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_session=Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_session_course=Database::get_main_table(MAIN_SESSION_COURSE_TABLE);

@ -7,7 +7,7 @@ include('../inc/global.inc.php');
api_protect_admin_script();
$tbl_course=Database::get_main_table(MAIN_COURSE_TABLE);
$tbl_course=Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_session=Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_session_rel_course=Database::get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_rel_course_rel_user=Database::get_main_table(MAIN_SESSION_COURSE_USER_TABLE);

@ -7,8 +7,9 @@ include('../inc/global.inc.php');
api_protect_admin_script();
$tbl_user=Database::get_main_table(MAIN_USER_TABLE);
$tbl_course=Database::get_main_table(MAIN_COURSE_TABLE);
// table definitions
$tbl_user=Database::get_main_table(TABLE_MAIN_USER);
$tbl_course=Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_session=Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_session_rel_course=Database::get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_rel_course_rel_user=Database::get_main_table(MAIN_SESSION_COURSE_USER_TABLE);

@ -12,7 +12,8 @@ $id=intval($_GET['id']);
$formSent=0;
$errorMsg='';
$tbl_user=Database::get_main_table(MAIN_USER_TABLE);
// table definitions
$tbl_user=Database::get_main_table(TABLE_MAIN_USER);
$tbl_session=Database::get_main_table(MAIN_SESSION_TABLE);
$tool_name = get_lang('EditSession');

@ -39,13 +39,13 @@ $session_id=$_GET['session_id'];
$formSent=0;
$errorMsg='';
$tbl_user=Database::get_main_table(MAIN_USER_TABLE);
$tbl_course = Database::get_main_table(MAIN_COURSE_TABLE);
$tbl_course_user = Database::get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_session = Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_session_user = Database::get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_session_course = Database::get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_course_user = Database::get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_course_user = Database::get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_session = Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_session_user = Database::get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_session_course = Database::get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_course_user = Database::get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$archivePath=api_get_path(SYS_PATH).$archiveDirName.'/';

@ -41,12 +41,13 @@ include(api_get_library_path().'/xmllib.php');
$formSent=0;
$errorMsg='';
$tbl_user = Database::get_main_table(MAIN_USER_TABLE);
$tbl_course = Database::get_main_table(MAIN_COURSE_TABLE);
$tbl_session = Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_session_user = Database::get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_session_course = Database::get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_course_user = Database::get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
// Database table definitions
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_session = Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_session_user = Database::get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_session_course = Database::get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_course_user = Database::get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tool_name=get_lang('ImportSessionListXMLCSV');

@ -47,7 +47,7 @@ class Statistics
*/
function count_courses($category_code = NULL)
{
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT COUNT(*) AS number FROM ".$course_table." ";
if (isset ($category_code))
{
@ -66,9 +66,11 @@ class Statistics
*/
function count_users($status, $category_code = NULL, $count_invisible_courses = true)
{
$course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
// Database table definitions
$course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "SELECT COUNT(DISTINCT(user_id)) AS number FROM $user_table WHERE status = ".intval(mysql_real_escape_string($status))." ";
if (isset ($category_code))
{
@ -246,7 +248,7 @@ class Statistics
*/
function print_course_by_language_stats()
{
$table = Database::get_main_table(MAIN_COURSE_TABLE);
$table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT course_language, count( code ) AS number_of_courses FROM $table GROUP BY course_language ";
$res = api_sql_query($sql,__FILE__,__LINE__);
$result = array();
@ -261,7 +263,7 @@ class Statistics
*/
function print_user_pictures_stats()
{
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "SELECT COUNT(*) AS n FROM $user_table";
$res = api_sql_query($sql,__FILE__,__LINE__);
$count1 = mysql_fetch_object($res);

@ -1,6 +1,6 @@
<?php
// $Id: subscribe_class2course.php 9246 2006-09-25 13:24:53Z bmol $
// $Id: subscribe_class2course.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -47,8 +47,8 @@ $first_letter_course = '';
$courses = array ();
$classes = array();
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_class = Database :: get_main_table(MAIN_CLASS_TABLE);
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$tool_name = get_lang('AddClassesToACourse');

@ -1,5 +1,5 @@
<?php
// $Id: subscribe_user2class.php 9246 2006-09-25 13:24:53Z bmol $
// $Id: subscribe_user2class.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -44,9 +44,10 @@ $first_letter_right = '';
$left_user_list = array();
$right_user_list = array ();
$tbl_class = Database :: get_main_table(MAIN_CLASS_TABLE);
// Database table definitions
$tbl_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$tbl_class_user = Database :: get_main_table(MAIN_CLASS_USER_TABLE);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "SELECT name FROM $tbl_class WHERE id='$class_id'";
$result = api_sql_query($sql, __FILE__, __LINE__);

@ -1,5 +1,5 @@
<?php
// $Id: subscribe_user2course.php 9246 2006-09-25 13:24:53Z bmol $
// $Id: subscribe_user2course.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -61,8 +61,9 @@ $first_letter_user = '';
$first_letter_course = '';
$courses = array ();
$users = array();
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
/*
-----------------------------------------------------------

@ -1,4 +1,4 @@
<?php // $Id: user_add.php 10082 2006-11-21 19:08:15Z pcool $
<?php // $Id: user_add.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -27,20 +27,27 @@
* @package dokeos.admin
==============================================================================
*/
// language file
$langFile = array('admin','registration');
$cidReset = true;
include ('../inc/global.inc.php');
$this_section=SECTION_PLATFORM_ADMIN;
api_protect_admin_script();
$table_admin = Database :: get_main_table(MAIN_ADMIN_TABLE);
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
// including necessary libraries
include ('../inc/global.inc.php');
include (api_get_path(LIBRARY_PATH).'fileManage.lib.php');
include (api_get_path(LIBRARY_PATH).'fileUpload.lib.php');
include (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
// section for the tabs
$this_section=SECTION_PLATFORM_ADMIN;
// user permissions
api_protect_admin_script();
// Database table definitions
$table_admin = Database :: get_main_table(TABLE_MAIN_ADMIN);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$htmlHeadXtra[] = '
<script language="JavaScript" type="text/JavaScript">

@ -1,4 +1,4 @@
<?php // $Id: user_edit.php 10082 2006-11-21 19:08:15Z pcool $
<?php // $Id: user_edit.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -58,8 +58,8 @@ $tool_name=get_lang('ModifyUserInfo');
//$interbreadcrumb[]=array("url" => "index.php","name" => get_lang('PlatformAdmin'));
$interbreadcrumb[]=array("url" => "user_list.php","name" => get_lang('UserList'));
$table_user = Database::get_main_table(MAIN_USER_TABLE);
$table_admin = Database::get_main_table(MAIN_ADMIN_TABLE);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$table_admin = Database::get_main_table(TABLE_MAIN_ADMIN);
$sql = "SELECT u.*, a.user_id AS is_admin FROM $table_user u LEFT JOIN $table_admin a ON a.user_id = u.user_id WHERE u.user_id = '".$user_id."'";
$res = api_sql_query($sql,__FILE__,__LINE__);
if(mysql_num_rows($res) != 1)

@ -1,5 +1,5 @@
<?php
// $Id: user_export.php 9246 2006-09-25 13:24:53Z bmol $
// $Id: user_export.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -41,9 +41,10 @@ include (api_get_path(LIBRARY_PATH).'fileManage.lib.php');
include (api_get_path(LIBRARY_PATH).'export.lib.inc.php');
include (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
// Database table definitions
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tool_name = get_lang('ExportUserListXMLCSV');

@ -1,6 +1,6 @@
<?php
// $Id: user_import.php 9246 2006-09-25 13:24:53Z bmol $
// $Id: user_import.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -152,7 +152,7 @@ function complete_missing_data($users)
*/
function save_data($users)
{
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$sendMail = $_POST['sendMail'] ? 1 : 0;
foreach ($users as $index => $user)
{

@ -1,5 +1,5 @@
<?php
// $Id: user_information.php 9246 2006-09-25 13:24:53Z bmol $
// $Id: user_information.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -50,7 +50,7 @@ $user = api_get_user_info($_GET['user_id']);
$tool_name = $user['firstName'].' '.$user['lastName'].(empty($user['official_code'])?'':' ('.$user['official_code'].')');
Display::display_header($tool_name);
$table_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
if( isset($_GET['action']) )
{
switch($_GET['action'])
@ -117,7 +117,7 @@ else
* Show the classes in which this user is subscribed
*/
$table_class_user = Database :: get_main_table(MAIN_CLASS_USER_TABLE);
$table_class = Database :: get_main_table(MAIN_CLASS_TABLE);
$table_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$sql = 'SELECT * FROM '.$table_class_user.' cu, '.$table_class.' c WHERE cu.user_id = '.$user['user_id'].' AND cu.class_id = c.id';
$res = api_sql_query($sql,__FILE__,__LINE__);
if (mysql_num_rows($res) > 0)

@ -1,6 +1,6 @@
<?php
// $Id: user_list.php 10082 2006-11-21 19:08:15Z pcool $
// $Id: user_list.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -52,8 +52,8 @@ function login_user($user_id)
global $uidReset, $loginFailed, $uidReset, $_configuration, $_user;
global $is_platformAdmin, $is_allowedCreateCourse;
$main_user_table = Database :: get_main_table(MAIN_USER_TABLE);
$main_admin_table = Database :: get_main_table(MAIN_ADMIN_TABLE);
$main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
$main_admin_table = Database :: get_main_table(TABLE_MAIN_ADMIN);
$track_e_login_table = Database :: get_statistic_table(STATISTIC_TRACK_E_LOGIN_TABLE);
//logic --------------------------------------------------------------------
@ -149,7 +149,7 @@ function login_user($user_id)
*/
function get_number_of_users()
{
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "SELECT COUNT(user_id) AS total_number_of_items FROM $user_table";
if (isset ($_GET['keyword']))
{
@ -185,7 +185,7 @@ function get_number_of_users()
*/
function get_user_data($from, $number_of_items, $column, $direction)
{
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "SELECT
user_id AS col0,
official_code AS col1,
@ -298,7 +298,7 @@ function active_filter($active, $url_params, $row)
*/
function lock_unlock_user($status,$user_id)
{
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
if ($status=='lock')
{

@ -1,4 +1,4 @@
<?php //$Id: announcements.php 9982 2006-11-15 00:08:08Z pcool $
<?php //$Id: announcements.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -78,8 +78,8 @@ $length = '36';
// Database variables
$tbl_course_user = Database::get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_user = Database::get_main_table(MAIN_USER_TABLE);
$tbl_courses = Database::get_main_table(MAIN_COURSE_TABLE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_courses = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_sessions = Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_session_course_user= Database::get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_group = Database::get_course_table(GROUP_TABLE);

@ -1,4 +1,4 @@
<?php // $Id: courses.php 10115 2006-11-22 15:35:52Z edwandos $
<?php // $Id: courses.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -56,10 +56,10 @@ include_once(api_get_path(LIBRARY_PATH) . 'course.lib.php');
Variables
-----------------------------------------------------------
*/
$tbl_course = Database::get_main_table(MAIN_COURSE_TABLE);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_courses_nodes = Database::get_main_table(MAIN_CATEGORY_TABLE);
$tbl_courseUser = Database::get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_user = Database::get_main_table(MAIN_USER_TABLE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
/*
-----------------------------------------------------------
@ -283,7 +283,7 @@ function browse_courses()
*/
function count_courses_in_category($category)
{
$tbl_course = Database::get_main_table(MAIN_COURSE_TABLE);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$sql="SELECT * FROM $tbl_course WHERE category_code".(empty($category)?" IS NULL":"='".$category."'");
$result=api_sql_query($sql);
return mysql_num_rows($result);
@ -336,7 +336,7 @@ function browse_course_categories()
*/
function browse_courses_in_category()
{
$tbl_course = Database::get_main_table(MAIN_COURSE_TABLE);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
echo "<p><b>".get_lang('CoursesInCategory')."</b>";
@ -468,7 +468,7 @@ function escape($s)
*/
function search_courses($search_term)
{
$TABLECOURS = Database::get_main_table(MAIN_COURSE_TABLE);
$TABLECOURS = Database::get_main_table(TABLE_MAIN_COURSE);
$search_term_safe=escape($search_term);
@ -738,7 +738,7 @@ function display_courses_in_category($user_category_id, $showicons)
global $_user;
// table definitions
$TABLECOURS=Database::get_main_table(MAIN_COURSE_TABLE);
$TABLECOURS=Database::get_main_table(TABLE_MAIN_COURSE);
$TABLECOURSUSER=Database::get_main_table(MAIN_COURSE_USER_TABLE);
$TABLE_USER_COURSE_CATEGORY = "`".Database::get_user_personal_database()."`.`user_course_category`";
@ -1023,7 +1023,7 @@ function display_unsubscribe_icons($course)
*/
function get_courses_of_user($user_id)
{
$TABLECOURS=Database::get_main_table(MAIN_COURSE_TABLE);
$TABLECOURS=Database::get_main_table(TABLE_MAIN_COURSE);
$TABLECOURSUSER=Database::get_main_table(MAIN_COURSE_USER_TABLE);
// Secondly we select the courses that are in a category (user_course_cat<>0) and sort these according to the sort of the category

@ -1,5 +1,5 @@
<?php
// $Id: inscription.php 10082 2006-11-21 19:08:15Z pcool $
// $Id: inscription.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -119,7 +119,7 @@ if ($form->validate())
if ($user_id)
{
// TODO: add language to parameter list of UserManager::create_user(...)
$sql = "UPDATE ".Database::get_main_table(MAIN_USER_TABLE)."
$sql = "UPDATE ".Database::get_main_table(TABLE_MAIN_USER)."
SET language = '".mysql_real_escape_string($values['language'])."'
WHERE user_id = '".$_user['user_id']."' ";
//api_sql_query($sql,__FILE__,__LINE__);
@ -127,7 +127,7 @@ if ($form->validate())
// if there is a default duration of a valid account then we have to change the expiration_date accordingly
if (get_setting('account_valid_duration')<>'')
{
$sql = "UPDATE ".Database::get_main_table(MAIN_USER_TABLE)."
$sql = "UPDATE ".Database::get_main_table(TABLE_MAIN_USER)."
SET expiration_date='registration_date+1' WHERE user_id='".$_user['user_id']."'";
api_sql_query($sql,__FILE__,__LINE__);
}
@ -136,7 +136,7 @@ if ($form->validate())
if (get_setting('allow_registration')=='approval')
{
// 1. set account inactive
$sql = "UPDATE ".Database::get_main_table(MAIN_USER_TABLE)."
$sql = "UPDATE ".Database::get_main_table(TABLE_MAIN_USER)."
SET active='0' WHERE user_id='".$_user['user_id']."'";
api_sql_query($sql,__FILE__,__LINE__);

@ -1,4 +1,4 @@
<?php // $Id: inscription_second.php 10082 2006-11-21 19:08:15Z pcool $
<?php // $Id: inscription_second.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -39,7 +39,7 @@
$langFile = "registration";
require("../inc/global.inc.php");
$TABLEUSER = Database::get_main_table(MAIN_USER_TABLE);
$TABLEUSER = Database::get_main_table(TABLE_MAIN_USER);
define ("CHECK_PASS_EASY_TO_FIND", false);

@ -1,6 +1,6 @@
<?php
// $Id: lostPassword.php 9246 2006-09-25 13:24:53Z bmol $
// $Id: lostPassword.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -52,7 +52,7 @@ if (get_setting('allow_lostpassword') == "false")
api_not_allowed();
}
api_display_tool_title($tool_name);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
if (isset ($_GET["reset"]) && isset ($_GET["id"]))
{
$msg = reset_password($_GET["reset"], $_GET["id"]);

@ -1,5 +1,5 @@
<?php
// $Id: lost_password.lib.php 10114 2006-11-22 15:32:30Z pcool $
// $Id: lost_password.lib.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -99,7 +99,7 @@ function get_secret_word($add)
function reset_password($secret, $id)
{
global $your_password_has_been_reset,$userPasswordCrypted;
$tbl_user = Database::get_main_table(MAIN_USER_TABLE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT user_id AS uid, lastname AS lastName, firstname AS firstName, username AS loginName, password, email FROM ".$tbl_user." WHERE user_id=$id";
$result = api_sql_query($sql,__FILE__,__LINE__);
if ($result && mysql_num_rows($result))

@ -26,19 +26,20 @@ api_block_anonymous_users();
Display :: display_header($nameTools);
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_session = Database :: get_main_table(MAIN_SESSION_TABLE);
$tbl_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_course_user = Database :: get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_stats_lastaccess = Database :: get_statistic_table(STATISTIC_TRACK_E_LASTACCESS_TABLE);
$tbl_stats_exercices = Database :: get_statistic_table(STATISTIC_TRACK_E_EXERCICES_TABLE);
$tbl_course_lp_view = Database :: get_course_table('lp_view');
$tbl_course_lp_view_item = Database :: get_course_table('lp_item_view');
$tbl_course_lp = Database :: get_course_table('lp');
$tbl_course_lp_item = Database :: get_course_table('lp_item');
$tbl_course_quiz = Database :: get_course_table('quiz');
// 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(MAIN_SESSION_TABLE);
$tbl_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_course_user = Database :: get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_stats_lastaccess = Database :: get_statistic_table(STATISTIC_TRACK_E_LASTACCESS_TABLE);
$tbl_stats_exercices = Database :: get_statistic_table(STATISTIC_TRACK_E_EXERCICES_TABLE);
$tbl_course_lp_view = Database :: get_course_table('lp_view');
$tbl_course_lp_view_item = Database :: get_course_table('lp_item_view');
$tbl_course_lp = Database :: get_course_table('lp');
$tbl_course_lp_item = Database :: get_course_table('lp_item');
$tbl_course_quiz = Database :: get_course_table('quiz');
$result=api_sql_query("SELECT DISTINCT id, name, date_start, date_end FROM session_rel_course_rel_user,session WHERE id_session=id AND id_user=".$_user['user_id']." ORDER BY date_start, date_end, name",__FILE__,__LINE__);

@ -1,5 +1,5 @@
<?php
// $Id: profile.php 10005 2006-11-16 10:47:21Z elixir_inter $
// $Id: profile.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -84,7 +84,7 @@ if (is_profile_editable())
else
$tool_name = get_lang('ViewProfile');
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
/*
-----------------------------------------------------------
@ -278,7 +278,7 @@ function is_profile_editable()
*/
function get_user_image($user_id)
{
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "SELECT picture_uri FROM $table_user WHERE user_id = '$user_id'";
$result = api_sql_query($sql, __FILE__, __LINE__);

@ -1,4 +1,4 @@
<?php //$Id: agenda.php 9973 2006-11-14 14:53:22Z pcool $
<?php //$Id: agenda.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -200,13 +200,13 @@ $DaysLong = array (get_lang("SundayLong"), get_lang("MondayLong"), get_lang("Tue
// Defining the months of the year to allow translation of the months. We use camelcase because these are arrays of language variables
$MonthsLong = array (get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong"));
// setting the database variables
$TABLEAGENDA = Database::get_course_table(AGENDA_TABLE);
$TABLE_ITEM_PROPERTY = Database::get_course_table(LAST_TOOL_EDIT_TABLE);
$tbl_user = Database::get_main_table(MAIN_USER_TABLE);
$tbl_courseUser = Database::get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_group = Database::get_course_table(GROUP_TABLE);
$tbl_groupUser = Database::get_course_table(GROUP_USER_TABLE);
// Database table definitions
$TABLEAGENDA = Database::get_course_table(AGENDA_TABLE);
$TABLE_ITEM_PROPERTY = Database::get_course_table(LAST_TOOL_EDIT_TABLE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_courseUser = Database::get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_group = Database::get_course_table(GROUP_TABLE);
$tbl_groupUser = Database::get_course_table(GROUP_USER_TABLE);
$tbl_session_course_user= Database::get_main_table(MAIN_SESSION_COURSE_USER_TABLE);

@ -86,7 +86,7 @@ Display::display_header(get_lang('MyAgenda'));
SETTING SOME VARIABLES
============================================================================== */
// setting the database variables
$TABLECOURS = Database :: get_main_table(MAIN_COURSE_TABLE);
$TABLECOURS = Database :: get_main_table(TABLE_MAIN_COURSE);
$TABLECOURSUSER = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$TABLEAGENDA = Database :: get_course_table(AGENDA_TABLE);
$TABLE_ITEMPROPERTY = Database :: get_course_table(LAST_TOOL_EDIT_TABLE);

@ -1,4 +1,4 @@
<?php // $Id: course_home.php 9985 2006-11-15 00:43:47Z pcool $
<?php // $Id: course_home.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -151,7 +151,7 @@ if($is_allowed_in_course == false)
if(api_get_setting('use_session_mode')=='true' && $is_allowed_in_course)
{
$tbl_session = Database::get_main_table(MAIN_SESSION_TABLE);
$tbl_user = Database::get_main_table(MAIN_USER_TABLE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_course = Database::get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_course_user = Database::get_main_table(MAIN_SESSION_COURSE_USER_TABLE);

@ -1,5 +1,5 @@
<?php
// $Id: infocours.php 10154 2006-11-23 08:48:12Z elixir_inter $
// $Id: infocours.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -64,7 +64,7 @@ require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'
*/
define("MODULE_HELP_NAME", "Settings");
define("COURSE_CHANGE_PROPERTIES", "COURSE_CHANGE_PROPERTIES");
$TABLECOURSE = Database :: get_main_table(MAIN_COURSE_TABLE);
$TABLECOURSE = Database :: get_main_table(TABLE_MAIN_COURSE);
$TABLEFACULTY = Database :: get_main_table(MAIN_CATEGORY_TABLE);
$TABLECOURSEHOME = Database :: get_course_table(TOOL_LIST_TABLE);
$TABLELANGUAGES = Database :: get_main_table(MAIN_LANGUAGE_TABLE);
@ -204,7 +204,7 @@ if ($form->validate() && is_settings_editable())
{
$update_values[$index] = mysql_real_escape_string($value);
}
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql = "UPDATE $table_course SET title = '".$update_values['title']."',
visual_code = '".$update_values['visual_code']."',
course_language = '".$update_values['course_language']."',

@ -1,4 +1,4 @@
<?php // $Id: postpone.php 9246 2006-09-25 13:24:53Z bmol $
<?php // $Id: postpone.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -68,7 +68,7 @@ Display::display_header($nameTools,"Settings");
//include(api_get_path(CONFIGURATION_PATH)."postpone.conf.php");
$nameTools = get_lang('Postpone');
$TABLECOURSE = Database::get_main_table(MAIN_COURSE_TABLE);
$TABLECOURSE = Database::get_main_table(TABLE_MAIN_COURSE);
$is_allowedToEdit = $is_courseAdmin;
$currentCourseID = $_course['sysCode'];
$currentCourseRepository = $_course["path"];

@ -1,4 +1,4 @@
<?php // $Id: CourseBuilder.class.php 10156 2006-11-23 08:59:13Z elixir_inter $
<?php // $Id: CourseBuilder.class.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -136,7 +136,7 @@ class CourseBuilder
*/
function build_forums()
{
$table = Database :: get_course_table(TOOL_FORUM_TABLE);
$table = Database :: get_course_table(TABLE_FORUM);
$sql = 'SELECT * FROM '.$table;
$db_result = api_sql_query($sql, __FILE__, __LINE__);
while ($obj = mysql_fetch_object($db_result))
@ -153,7 +153,7 @@ class CourseBuilder
*/
function build_forum_category($id)
{
$table = Database :: get_course_table(TOOL_FORUM_CATEGORY_TABLE);
$table = Database :: get_course_table(TABLE_FORUM_CATEGORY);
$sql = 'SELECT * FROM '.$table.' WHERE cat_id = '.$id;
$db_result = api_sql_query($sql, __FILE__, __LINE__);
while ($obj = mysql_fetch_object($db_result))
@ -167,7 +167,7 @@ class CourseBuilder
*/
function build_forum_topics()
{
$table = Database :: get_course_table(TOOL_FORUM_POST_TABLE);
$table = Database :: get_course_table(TABLE_FORUM_POST);
$sql = 'SELECT * FROM '.$table;
$db_result = api_sql_query($sql, __FILE__, __LINE__);
while ($obj = mysql_fetch_object($db_result))
@ -181,7 +181,7 @@ class CourseBuilder
*/
function build_forum_posts()
{
$table_post = Database :: get_course_table(TOOL_FORUM_POST_TABLE);
$table_post = Database :: get_course_table(TABLE_FORUM_POST);
$table_posttext = Database :: get_course_table(TOOL_FORUM_POST_TEXT_TABLE);
$sql = 'SELECT * FROM '.$table_post.' p,'.$table_posttext.' pt WHERE p.post_id = pt.post_id';
$db_result = api_sql_query($sql, __FILE__, __LINE__);

@ -1,5 +1,5 @@
<?php
// $Id: CourseRecycler.class.php 10156 2006-11-23 08:59:13Z elixir_inter $
// $Id: CourseRecycler.class.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -114,7 +114,7 @@ class CourseRecycler
{
$table_forum = Database :: get_course_table(FORUM_TABLE);
$table_topic = Database :: get_course_table(FORUM_TOPIC_TABLE);
$table_post = Database :: get_course_table(TOOL_FORUM_POST_TABLE);
$table_post = Database :: get_course_table(TABLE_FORUM_POST);
$table_posttext = Database :: get_course_table(TOOL_FORUM_POST_TEXT_TABLE);
$forum_ids = implode(',', (array_keys($this->course->resources[RESOURCE_FORUM])));
$sql = "SELECT post_id FROM ".$table_post." WHERE forum_id IN (".$forum_ids.")";
@ -141,8 +141,8 @@ class CourseRecycler
*/
function recycle_forum_categories()
{
$table_forum = Database :: get_course_table(TOOL_FORUM_TABLE);
$table_forumcat = Database :: get_course_table(TOOL_FORUM_CATEGORY_TABLE);
$table_forum = Database :: get_course_table(TABLE_FORUM);
$table_forumcat = Database :: get_course_table(TABLE_FORUM_CATEGORY);
$sql = "SELECT fc.cat_id FROM ".$table_forumcat." fc LEFT JOIN ".$table_forum." f ON fc.cat_id=f.cat_id WHERE f.forum_id IS NULL";
$res = api_sql_query($sql,__FILE__,__LINE__);
while ($obj = mysql_fetch_object($res))

@ -1,7 +1,7 @@
<?php
// $Id: CourseRestorer.class.php 10156 2006-11-23 08:59:13Z elixir_inter $
// $Id: CourseRestorer.class.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -323,9 +323,9 @@ class CourseRestorer
{
if ($this->course->has_resources(RESOURCE_FORUM))
{
$table_forum = Database :: get_course_table(TOOL_FORUM_TABLE, $this->course->destination_db);
$table_topic = Database :: get_course_table(TOOL_FORUM_POST_TABLE, $this->course->destination_db);
$table_post = Database :: get_course_table(TOOL_FORUM_POST_TABLE, $this->course->destination_db);
$table_forum = Database :: get_course_table(TABLE_FORUM, $this->course->destination_db);
$table_topic = Database :: get_course_table(TABLE_FORUM_POST, $this->course->destination_db);
$table_post = Database :: get_course_table(TABLE_FORUM_POST, $this->course->destination_db);
$resources = $this->course->resources;
foreach ($resources[RESOURCE_FORUM] as $id => $forum)
{
@ -360,7 +360,7 @@ class CourseRestorer
*/
function restore_forum_category($id)
{
$forum_cat_table = Database :: get_course_table(TOOL_FORUM_CATEGORY_TABLE, $this->course->destination_db);
$forum_cat_table = Database :: get_course_table(TABLE_FORUM_CATEGORY, $this->course->destination_db);
$resources = $this->course->resources;
$forum_cat = $resources[RESOURCE_FORUMCATEGORY][$id];
if (!$forum_cat->is_restored())
@ -378,7 +378,7 @@ class CourseRestorer
*/
function restore_topic($id, $forum_id)
{
$table = Database :: get_course_table(TOOL_FORUM_POST_TABLE, $this->course->destination_db);
$table = Database :: get_course_table(TABLE_FORUM_POST, $this->course->destination_db);
$resources = $this->course->resources;
$topic = $resources[RESOURCE_FORUMTOPIC][$id];
$sql = "INSERT INTO ".$table." SET topic_title = '".mysql_real_escape_string($topic->title)."', topic_time = '".$topic->time."', nom = '".mysql_real_escape_string($topic->lastname)."', prenom = '".mysql_real_escape_string($topic->firstname)."', topic_notify = '".$topic->topic_notify."', forum_id = '".$forum_id."'";
@ -408,7 +408,7 @@ class CourseRestorer
*/
function restore_post($id, $topic_id, $forum_id)
{
$table_post = Database :: get_course_table(TOOL_FORUM_POST_TABLE, $this->course->destination_db);
$table_post = Database :: get_course_table(TABLE_FORUM_POST, $this->course->destination_db);
$table_posttext = Database :: get_course_table(TOOL_FORUM_POST_TEXT_TABLE, $this->course->destination_db);
$resources = $this->course->resources;
$post = $resources[RESOURCE_FORUMPOST][$id];

@ -1,5 +1,5 @@
<?php
// $Id: copy_course.php 9246 2006-09-25 13:24:53Z bmol $
// $Id: copy_course.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -85,7 +85,7 @@ elseif (isset ($_POST['copy_option']) && $_POST['copy_option'] == 'select_items'
// Else, show the default page
else
{
$table_c = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_c = Database :: get_main_table(TABLE_MAIN_COURSE);
$table_cu = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$user_info = api_get_user_info();
$course_info = api_get_course_info();

@ -971,7 +971,7 @@ function display_user_link($user_id, $name='')
{
if ($name=='')
{
$table_user = Database::get_main_table(MAIN_USER_TABLE);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$sql="SELECT * FROM $table_user WHERE user_id='".mysql_real_escape_string($user_id)."'";
$result=api_sql_query($sql,__FILE__,__LINE__);
$row=mysql_fetch_array($result);

@ -1,4 +1,7 @@
<?php
/**
* @todo use database library
*/
/*
-----------------------------------------------------------
including the global file
@ -53,7 +56,7 @@ $TBL_EXERCICE_QUESTION = $_course['dbNameGlu'].'quiz_rel_question';
$TBL_EXERCICES = $_course['dbNameGlu'].'quiz';
$TBL_QUESTIONS = $_course['dbNameGlu'].'quiz_question';
$TBL_REPONSES = $_course['dbNameGlu'].'quiz_answer';
$main_user_table = Database :: get_main_table(MAIN_USER_TABLE);
$main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
$main_course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$TABLETRACK_ATTEMPT = $_configuration['statistics_database']."`.`track_e_attempt";
$TABLETRACK_EXERCICES = $_configuration['statistics_database']."`.`track_e_exercices";

@ -31,6 +31,7 @@
* @author Denes Nagy, HotPotatoes integration
* @author Wolfgang Schneider, code/html cleanup
* @package dokeos.exercise
* @todo use database library
==============================================================================
*/
@ -61,7 +62,7 @@ require_once('hotpotatoes.lib.php');
*/
$is_allowedToEdit = is_allowed_to_edit();
$TBL_USER = Database::get_main_table(MAIN_USER_TABLE);
$TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
$TBL_DOCUMENT = Database::get_course_table(DOCUMENT_TABLE);
$TBL_ITEM_PROPERTY = Database::get_course_table(ITEM_PROPERTY_TABLE);
$TBL_EXERCICE_QUESTION = Database::get_course_table(QUIZ_TEST_QUESTION_TABLE);
@ -69,7 +70,7 @@ $TBL_EXERCICES = Database::get_course_table(QUIZ_TEST_TABLE);
$TBL_QUESTIONS = Database::get_course_table(QUIZ_QUESTION_TABLE);
$TBL_TRACK_EXERCICES = $_configuration['statistics_database']."`.`track_e_exercices";
$TBL_TRACK_HOTPOTATOES = $_configuration['statistics_database']."`.`track_e_hotpotatoes";
$TABLETRACK_ATTEMPT = $_configuration['statistics_database']."`.`track_e_attempt";
$TABLETRACK_ATTEMPT = $_configuration['statistics_database']."`.`track_e_attempt";
// document path
$documentPath= api_get_path(SYS_COURSE_PATH).$_course['path']."/document";

@ -1,4 +1,4 @@
<?php // $Id: exercise_result.php 10140 2006-11-23 04:36:47Z yannoo $
<?php // $Id: exercise_result.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -35,6 +35,7 @@
* @author Roan Embrechts, some refactoring
* @package dokeos.exercise
* @todo split more code up in functions, move functions to library?
* @todo use database library
==============================================================================
*/
@ -62,17 +63,16 @@ $this_section=SECTION_COURSES;
include(api_get_path(LIBRARY_PATH).'events.lib.inc.php');
include(api_get_path(LIBRARY_PATH).'mail.lib.inc.php');
//include(api_get_path(LIBRARY_PATH).'text.lib.php');
$TBL_EXERCICE_QUESTION = $_course['dbNameGlu'].'quiz_rel_question';
$TBL_EXERCICES = $_course['dbNameGlu'].'quiz';
$TBL_QUESTIONS = $_course['dbNameGlu'].'quiz_question';
$TBL_REPONSES = $_course['dbNameGlu'].'quiz_answer';
$TABLETRACK_EXERCICES = $_configuration['statistics_database']."`.`track_e_exercices";
$TABLETRACK_ATTEMPT = $_configuration['statistics_database']."`.`track_e_attempt";
$main_user_table = Database :: get_main_table(MAIN_USER_TABLE);
// Database table definitions
$TBL_EXERCICE_QUESTION = $_course['dbNameGlu'].'quiz_rel_question';
$TBL_EXERCICES = $_course['dbNameGlu'].'quiz';
$TBL_QUESTIONS = $_course['dbNameGlu'].'quiz_question';
$TBL_REPONSES = $_course['dbNameGlu'].'quiz_answer';
$TABLETRACK_EXERCICES = $_configuration['statistics_database']."`.`track_e_exercices";
$TABLETRACK_ATTEMPT = $_configuration['statistics_database']."`.`track_e_attempt";
$main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
$main_course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$table_ans = Database :: get_course_table(QUIZ_ANSWER_TABLE);
$table_ans = Database :: get_course_table(QUIZ_ANSWER_TABLE);
//temp values to move to AWACS
$dsp_percent = false; //false to display total score as absolute values
@ -113,8 +113,8 @@ if ( empty ( $questionList ) ) {
if ( empty ( $objExercise ) ) {
$objExercise = $_SESSION['objExercise'];
}
$main_user_table = Database :: get_main_table(MAIN_USER_TABLE);
$main_admin_table = Database :: get_main_table(MAIN_ADMIN_TABLE);
$main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
$main_admin_table = Database :: get_main_table(TABLE_MAIN_ADMIN);
$courseName = $_SESSION[_course][name];
$query = "select user_id from $main_admin_table";
$admin_id = mysql_result(api_sql_query($query),0,"user_id");

@ -2,6 +2,7 @@
/**
* @todo remove the debug code and use the general debug library
* @todo use the Database:: functions
* @todo small letters for table variables
*/
include('exercise.class.php');
include('question.class.php');
@ -23,14 +24,16 @@ $this_section=SECTION_COURSES;
api_protect_course_script();
include(api_get_path(LIBRARY_PATH).'text.lib.php');
include_once(api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
$TBL_EXERCICE_QUESTION = $_course['dbNameGlu'].'quiz_rel_question';
$TBL_EXERCICES = $_course['dbNameGlu'].'quiz';
$TBL_QUESTIONS = $_course['dbNameGlu'].'quiz_question';
$TBL_REPONSES = $_course['dbNameGlu'].'quiz_answer';
$main_user_table = Database :: get_main_table(MAIN_USER_TABLE);
// Database table definitions
$TBL_EXERCICE_QUESTION = $_course['dbNameGlu'].'quiz_rel_question';
$TBL_EXERCICES = $_course['dbNameGlu'].'quiz';
$TBL_QUESTIONS = $_course['dbNameGlu'].'quiz_question';
$TBL_REPONSES = $_course['dbNameGlu'].'quiz_answer';
$main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
$main_course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$TABLETRACK_ATTEMPT = $_configuration['statistics_database']."`.`track_e_attempt";
$TABLETRACK_EXERCICES = $_configuration['statistics_database']."`.`track_e_exercices";
$TABLETRACK_ATTEMPT = $_configuration['statistics_database']."`.`track_e_attempt";
$TABLETRACK_EXERCICES = $_configuration['statistics_database']."`.`track_e_exercices";
$dsp_percent = false;
$debug=0;

@ -21,7 +21,7 @@ $table_posts = "`".$_course["dbNameGlu"]."forum_post"."`";
$table_mailcue = "`".$_course["dbNameGlu"]."forum_mailcue"."`";
$table_item_property = Database :: get_course_table(LAST_TOOL_EDIT_TABLE);
$table_users = Database :: get_main_table(MAIN_USER_TABLE);
$table_users = Database :: get_main_table(TABLE_MAIN_USER);
/*
-----------------------------------------------------------

@ -85,7 +85,7 @@ function define_course_keys($wantedCode, $prefix4all = "", $prefix4baseName = ""
{
global $prefixAntiNumber, $_configuration;
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$wantedCode = strtr($wantedCode, "ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ", "AAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy");
@ -1625,7 +1625,7 @@ function string2binary($variable)
function register_course($courseSysCode, $courseScreenCode, $courseRepository, $courseDbName, $titular, $category, $title, $course_language, $uidCreator, $expiration_date = "")
{
GLOBAL $defaultVisibilityForANewCourse, $langCourseDescription, $langProfessor, $langAnnouncementEx, $error_msg, $_configuration;
$TABLECOURSE = Database :: get_main_table(MAIN_COURSE_TABLE);
$TABLECOURSE = Database :: get_main_table(TABLE_MAIN_COURSE);
$TABLECOURSUSER = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
#$TABLEANNOUNCEMENTS=$_configuration['table_prefix'].$courseDbName.$_configuration['db_glue'].$TABLEANNOUNCEMENTS;

@ -97,8 +97,8 @@ class Blog
*/
function get_blog_users($blog_id)
{
// Init
$tbl_users = Database::get_main_table(MAIN_USER_TABLE);
// Database table definitions
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs = Database::get_course_table(BLOGS_TABLE);
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
@ -669,7 +669,7 @@ class Blog
// Init
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_blogs_comments = Database::get_course_table(BLOGS_COMMENTS_TABLE);
$tbl_users = Database::get_main_table(MAIN_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
global $dateFormatLong;
// Get posts and authors
@ -795,7 +795,7 @@ class Blog
// Init
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_blogs_comments = Database::get_course_table(BLOGS_COMMENTS_TABLE);
$tbl_users = Database::get_main_table(MAIN_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
global $dateFormatLong;
@ -959,7 +959,7 @@ class Blog
{
// Init
$tbl_blogs_comments = Database::get_course_table(BLOGS_COMMENTS_TABLE);
$tbl_users = Database::get_main_table(MAIN_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
global $dateFormatLong;
@ -1146,7 +1146,7 @@ class Blog
{
// Init
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_users = Database::get_main_table(MAIN_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
// Get posts and author
$sql = "SELECT post.*, user.lastname, user.firstname FROM $tbl_blogs_posts post INNER JOIN $tbl_users user ON post.author = user.user_id WHERE post.blog_id = $blog_id AND post.post_id = $post_id ORDER BY post_id DESC";
@ -1268,7 +1268,7 @@ class Blog
function display_assigned_task_list($blog_id)
{
// Init
$tbl_users = Database::get_main_table(MAIN_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_tasks_rel_user = Database::get_course_table(BLOGS_TASKS_REL_USER);
$counter = 0;
@ -1493,7 +1493,7 @@ class Blog
function display_assign_task_form($blog_id)
{
// Init
$tbl_users = Database::get_main_table(MAIN_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$day = date("d");
@ -1616,7 +1616,7 @@ class Blog
/* ------------- */
// Init
$tbl_users = Database::get_main_table(MAIN_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_tasks_rel_user = Database::get_course_table(BLOGS_TASKS_REL_USER);
@ -1859,7 +1859,7 @@ class Blog
// Init
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_users = Database::get_main_table(MAIN_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$sql = "
SELECT title
@ -1955,7 +1955,7 @@ class Blog
// Init
global $_course;
$currentCourse = $_course['sysCode'];
$tbl_users = Database::get_main_table(MAIN_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
$table_course_user = Database::get_main_table(MAIN_COURSE_USER_TABLE);
echo '<span class="blogpost_title">' . get_lang('SubscribeMembers') . '</span>';
@ -2042,7 +2042,7 @@ class Blog
global $_user;
// Init
$tbl_users = Database::get_main_table(MAIN_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
echo '<span class="blogpost_title">' . get_lang('UnsubscribeMembers') . '</span>';
@ -2142,7 +2142,7 @@ class Blog
function display_form_user_rights($blog_id)
{
// Init
$tbl_users = Database::get_main_table(MAIN_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(BLOGS_REL_USER_TABLE);
echo '<span class="blogpost_title">' . get_lang('RightsManager') . '</span>';
@ -2226,7 +2226,7 @@ class Blog
$posts = array();
$tasks = array();
$tbl_users = Database::get_main_table(MAIN_USER_TABLE);
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_posts = Database::get_course_table(BLOGS_POSTS_TABLE);
$tbl_blogs_tasks = Database::get_course_table(BLOGS_TASKS);
$tbl_blogs_tasks_rel_user = Database::get_course_table(BLOGS_TASKS_REL_USER);

@ -43,7 +43,7 @@ class ClassManager
*/
function get_class_info($class_id)
{
$table_class = Database :: get_main_table(MAIN_CLASS_TABLE);
$table_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$sql = "SELECT * FROM $table_class WHERE id='".$class_id."'";
$res = api_sql_query($sql, __FILE__, __LINE__);
return mysql_fetch_array($res, MYSQL_ASSOC);
@ -55,7 +55,7 @@ class ClassManager
*/
function set_name($name, $class_id)
{
$table_class = Database :: get_main_table(MAIN_CLASS_TABLE);
$table_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$sql = "UPDATE $table_class SET name='".mysql_real_escape_string($name)."' WHERE id='".$class_id."'";
$res = api_sql_query($sql, __FILE__, __LINE__);
}
@ -65,7 +65,7 @@ class ClassManager
*/
function create_class($name)
{
$table_class = Database :: get_main_table(MAIN_CLASS_TABLE);
$table_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$sql = "INSERT INTO $table_class SET name='".mysql_real_escape_string($name)."'";
api_sql_query($sql, __FILE__, __LINE__);
return mysql_affected_rows() == 1;
@ -76,7 +76,7 @@ class ClassManager
*/
function class_name_exists($name)
{
$table_class = Database :: get_main_table(MAIN_CLASS_TABLE);
$table_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$sql = "SELECT * FROM $table_class WHERE name='".mysql_real_escape_string($name)."'";
$res = api_sql_query($sql, __FILE__, __LINE__);
return mysql_num_rows($res) != 0;
@ -89,7 +89,7 @@ class ClassManager
*/
function delete_class($class_id)
{
$table_class = Database :: get_main_table(MAIN_CLASS_TABLE);
$table_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$table_class_course = Database :: get_main_table(MAIN_COURSE_CLASS_TABLE);
$table_class_user = Database :: get_main_table(MAIN_CLASS_USER_TABLE);
$sql = "DELETE FROM $table_class_user WHERE class_id = '".$class_id."'";
@ -107,7 +107,7 @@ class ClassManager
function get_users($class_id)
{
$table_class_user = Database :: get_main_table(MAIN_CLASS_USER_TABLE);
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "SELECT * FROM $table_class_user cu, $table_user u WHERE cu.class_id = '".$class_id."' AND cu.user_id = u.user_id";
$res = api_sql_query($sql, __FILE__, __LINE__);
$users = array ();
@ -170,7 +170,7 @@ class ClassManager
function get_courses($class_id)
{
$table_class_course = Database :: get_main_table(MAIN_COURSE_CLASS_TABLE);
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT * FROM $table_class_course cc, $table_course c WHERE cc.class_id = '".$class_id."' AND cc.course_code = c.code";
$res = api_sql_query($sql, __FILE__, __LINE__);
$courses = array ();
@ -233,7 +233,7 @@ class ClassManager
*/
function get_class_id($name)
{
$table_class = Database :: get_main_table(MAIN_CLASS_TABLE);
$table_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$sql = "SELECT * FROM $table_class WHERE name='".$name."'";
$res = api_sql_query($sql, __FILE__, __LINE__);
$obj = mysql_fetch_object($res);
@ -246,7 +246,7 @@ class ClassManager
*/
function get_classes_in_course($course_code)
{
$table_class = Database :: get_main_table(MAIN_CLASS_TABLE);
$table_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$table_course_class = Database :: get_main_table(MAIN_COURSE_CLASS_TABLE);
$sql = "SELECT cl.* FROM $table_class cl, $table_course_class cc WHERE cc.course_code = '".mysql_real_escape_string($course_code)."' AND cc.class_id = cl.id";
$res = api_sql_query($sql, __FILE__, __LINE__);

@ -158,9 +158,9 @@ define("VISIBLE_NO_SUBSCRIPTION_ALLOWED", 3);
-----------------------------------------------------------
*/
$TABLECOURSE = Database :: get_main_table(MAIN_COURSE_TABLE);
$TABLECOURSE = Database :: get_main_table(TABLE_MAIN_COURSE);
$TABLECOURSDOMAIN = Database :: get_main_table(MAIN_CATEGORY_TABLE);
$TABLEUSER = Database :: get_main_table(MAIN_USER_TABLE);
$TABLEUSER = Database :: get_main_table(TABLE_MAIN_USER);
$TABLECOURSUSER = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$TABLEANNOUNCEMENTS = "announcement";
$coursesRepositories = $_configuration['root_sys'];
@ -184,7 +184,7 @@ class CourseManager
*/
function get_course_information($course_code)
{
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql="SELECT * FROM ".$course_table." WHERE code='".$course_code."'";
$sql_result = api_sql_query($sql, __FILE__, __LINE__);
$result = mysql_fetch_array($sql_result);
@ -205,7 +205,7 @@ class CourseManager
function get_access_settings($course_code)
{
$system_code = $course_info["sysCode"];
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT `visibility`, `subscribe`, `unsubscribe` from ".$course_table." where `code` = '".$course_code."'";
$sql_result = api_sql_query($sql, __FILE__, __LINE__);
$result = mysql_fetch_array($sql_result);
@ -244,7 +244,7 @@ class CourseManager
}
$user_ids = implode(',', $user_id);
$table_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
// Unsubscribe user from all groups in the course
$sql = "SELECT * FROM $table_course WHERE code = '".$course_code."'";
$res = api_sql_query($sql, __FILE__, __LINE__);
@ -274,8 +274,8 @@ class CourseManager
*/
function subscribe_user($user_id, $course_code, $status = STUDENT)
{
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$location_table = Database :: get_main_table(MAIN_LOCATION_TABLE);
$user_role_table = Database :: get_main_table(MAIN_USER_ROLE_TABLE);
@ -343,8 +343,8 @@ class CourseManager
*/
function add_user_to_course($user_id, $course_code, $status = STUDENT)
{
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$status = ($status == STUDENT || $status == COURSEMANAGER) ? $status : STUDENT;
@ -488,7 +488,7 @@ class CourseManager
*/
function is_existing_course_code($wanted_course_code)
{
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql_query = "SELECT COUNT(*) as number FROM ".$course_table."WHERE `code` = '$wanted_course_code' OR `visual_code` = '$wanted_course_code' ";
$sql_result = api_sql_query($sql_query, __FILE__, __LINE__);
@ -509,7 +509,7 @@ class CourseManager
*/
function get_real_course_list()
{
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql_query = "SELECT * FROM $course_table WHERE `target_course_code` IS NULL";
$sql_result = api_sql_query($sql_query, __FILE__, __LINE__);
@ -526,7 +526,7 @@ class CourseManager
*/
function get_virtual_course_list()
{
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql_query = "SELECT * FROM $course_table WHERE `target_course_code` IS NOT NULL";
$sql_result = api_sql_query($sql_query, __FILE__, __LINE__);
@ -543,7 +543,7 @@ class CourseManager
*/
function get_real_course_list_of_user_as_course_admin($user_id)
{
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$sql_query = " SELECT *
@ -571,7 +571,7 @@ class CourseManager
*/
function get_course_list_of_user_as_course_admin($user_id)
{
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$sql_query = " SELECT *
@ -742,7 +742,7 @@ class CourseManager
*/
function get_virtual_course_info($real_course_code)
{
$table = Database :: get_main_table(MAIN_COURSE_TABLE);
$table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql_query = "SELECT * FROM $table WHERE `target_course_code` = '$real_course_code'";
$sql_result = api_sql_query($sql_query, __FILE__, __LINE__);
$result = array ();
@ -759,7 +759,7 @@ class CourseManager
*/
function is_virtual_course_from_system_code($system_code)
{
$table = Database :: get_main_table(MAIN_COURSE_TABLE);
$table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql_query = "SELECT * FROM $table WHERE `code` = '$system_code'";
$sql_result = api_sql_query($sql_query, __FILE__, __LINE__);
$result = mysql_fetch_array($sql_result);
@ -781,7 +781,7 @@ class CourseManager
*/
function is_virtual_course_from_visual_code($visual_code)
{
$table = Database :: get_main_table(MAIN_COURSE_TABLE);
$table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql_query = "SELECT * FROM $table WHERE `visual_code` = '$visual_code'";
$sql_result = api_sql_query($sql_query, __FILE__, __LINE__);
$result = mysql_fetch_array($sql_result);
@ -823,7 +823,7 @@ class CourseManager
*/
function get_virtual_courses_linked_to_real_course($real_course_code)
{
$table = Database :: get_main_table(MAIN_COURSE_TABLE);
$table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql_query = "SELECT * FROM $table WHERE `target_course_code` = '$real_course_code'";
$sql_result = api_sql_query($sql_query, __FILE__, __LINE__);
$result_array = array ();
@ -844,7 +844,7 @@ class CourseManager
*/
function get_target_of_linked_course($virtual_course_code)
{
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
//get info about the virtual course
$sql_query = "SELECT * FROM $course_table WHERE `code` = '$virtual_course_code'";
@ -898,7 +898,7 @@ class CourseManager
function is_user_subscribed_in_real_or_linked_course($user_id, $course_code, $session_id='')
{
if($session_id==''){
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$sql_query = " SELECT *
@ -1042,7 +1042,7 @@ class CourseManager
*/
function get_list_of_virtual_courses_for_specific_user_and_real_course($user_id, $real_course_code)
{
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
if(api_get_setting("use_session_mode")!="true"){
@ -1135,7 +1135,7 @@ class CourseManager
function create_virtual_course($real_course_code, $course_title, $wanted_course_code, $course_language, $course_category)
{
global $firstExpirationDelay;
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$user_id = api_get_user_id();
$real_course_info = Database :: get_course_info($real_course_code);
$real_course_code = $real_course_info["system_code"];
@ -1191,7 +1191,7 @@ class CourseManager
{
global $_configuration;
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$table_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$table_course_class = Database :: get_main_table(MAIN_COURSE_CLASS_TABLE);
$user_role_table = Database :: get_main_table(MAIN_USER_ROLE_TABLE);
@ -1268,7 +1268,7 @@ class CourseManager
return;
}
$sql_dump = '';
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT * FROM $table_course WHERE code = '$course_code'";
$res = api_sql_query($sql, __FILE__, __LINE__);
$course = mysql_fetch_object($res);

@ -29,6 +29,8 @@
* Include/require it in your code to use its functionality.
*
* @package dokeos.library
* @todo the table constants have all to start with TABLE_
* This is because of the analogy with the tool constants TOOL_
==============================================================================
*/
/*
@ -37,10 +39,10 @@
==============================================================================
*/
//main database tables
define("MAIN_COURSE_TABLE", "course");
define("MAIN_USER_TABLE", "user");
define("MAIN_CLASS_TABLE", "class");
define("MAIN_ADMIN_TABLE", "admin");
define('TABLE_MAIN_COURSE', 'course');
define('TABLE_MAIN_USER', 'user');
define('TABLE_MAIN_CLASS', 'class');
define('TABLE_MAIN_ADMIN', 'admin');
define("MAIN_COURSE_CLASS_TABLE", "course_rel_class");
define("MAIN_COURSE_USER_TABLE", "course_rel_user");
define("MAIN_CLASS_USER_TABLE", "class_user");
@ -84,10 +86,10 @@ define("TOOL_INTRO_TABLE", "tool_intro");
define("SCORMDOC_TABLE", "scormdocument");
define("STUDENT_PUBLICATION_TABLE", "student_publication");
//course forum tables
define("TOOL_FORUM_CATEGORY_TABLE",'forum_category');
define("TOOL_FORUM_TABLE",'forum_forum');
define("TOOL_FORUM_THREAD_TABLE",'forum_thread');
define("TOOL_FORUM_POST_TABLE",'forum_post');
define('TABLE_FORUM_CATEGORY','forum_category');
define('TABLE_FORUM','forum_forum');
define('TABLE_FORUM_THREAD','forum_thread');
define('TABLE_FORUM_POST','forum_post');
//course group tables
define("GROUP_TABLE", "group_info");
define("GROUP_USER_TABLE", "group_rel_user");
@ -369,7 +371,7 @@ class Database
*/
function get_course_list()
{
$table = Database::get_main_table(MAIN_COURSE_TABLE);
$table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql_query = "SELECT * FROM $table";
$sql_result = api_sql_query($sql_query, __FILE__, __LINE__);
$result = api_store_result($sql_result);
@ -383,7 +385,7 @@ class Database
*/
function get_course_info($course_code)
{
$table = Database::get_main_table(MAIN_COURSE_TABLE);
$table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql_query = "SELECT * FROM $table WHERE `code` = '$course_code'";
$sql_result = api_sql_query($sql_query, __FILE__, __LINE__);
$result = mysql_fetch_array($sql_result);
@ -400,7 +402,7 @@ class Database
*/
function get_user_info_from_id($user_id = '')
{
$table = Database::get_main_table(MAIN_USER_TABLE);
$table = Database::get_main_table(TABLE_MAIN_USER);
if ($user_id == '')
{
return $GLOBALS["_user"];

@ -81,7 +81,7 @@ class DocumentManager
{
global $_course, $maxFilledSpace;
$course_code = $_course['sysCode'];
$course_table = Database :: get_main_table(MAIN_COURSE_TABLE);
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql_query = "SELECT `".DISK_QUOTA_FIELD."` FROM $course_table WHERE `code` = '$course_code'";
$sql_result = api_sql_query($sql_query, __FILE__, __LINE__);

@ -1,5 +1,5 @@
<?php
// $Id: UsernameAvailable.php 6392 2005-10-11 14:38:21Z bmol $
// $Id: UsernameAvailable.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -36,7 +36,7 @@ class HTML_QuickForm_Rule_UsernameAvailable extends HTML_QuickForm_Rule
*/
function validate($username,$current_username = null)
{
$user_table = Database::get_main_table(MAIN_USER_TABLE);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT * FROM $user_table WHERE username = '$username'";
if(!is_null($current_username))
{

@ -101,8 +101,8 @@ class GroupManager
$course_db = $course_info['database'];
}
$table_group = Database :: get_course_table(GROUP_TABLE, $course_db);
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$table_group_user = Database :: get_course_table(GROUP_USER_TABLE, $course_db);
$sql = "SELECT g.id ,
g.name ,
@ -148,7 +148,7 @@ class GroupManager
$currentCourseRepository = $_course['path'];
$table_group = Database :: get_course_table(GROUP_TABLE);
$table_forum = Database :: get_course_table(TOOL_FORUM_TABLE);
$table_forum = Database :: get_course_table(TABLE_FORUM);
$category = GroupManager :: get_category($category_id);
if( strlen($places) == 0)
{
@ -283,12 +283,15 @@ class GroupManager
{
$course = api_get_course_info();
}
$group_table = Database :: get_course_table(GROUP_TABLE, $course_db);
$group_user_table = Database :: get_course_table(GROUP_USER_TABLE, $course_db);
$forum_table = Database :: get_course_table(TOOL_FORUM_TABLE, $course_db);
$forum_post_table = Database :: get_course_table(TOOL_FORUM_POST_TABLE, $course_db);
$forum_post_text_table = Database :: get_course_table(TOOL_FORUM_POST_TEXT_TABLE, $course_db);
$forum_topic_table = Database :: get_course_table(TOOL_FORUM_POST_TABLE, $course_db);
// Database table definitions
$group_table = Database :: get_course_table(GROUP_TABLE, $course_db);
$group_user_table = Database :: get_course_table(GROUP_USER_TABLE, $course_db);
$forum_table = Database :: get_course_table(TABLE_FORUM, $course_db);
$forum_post_table = Database :: get_course_table(TABLE_FORUM_POST, $course_db);
$forum_post_text_table = Database :: get_course_table(TOOL_FORUM_POST_TEXT_TABLE, $course_db);
$forum_topic_table = Database :: get_course_table(TABLE_FORUM_POST, $course_db);
$group_ids = is_array($group_ids) ? $group_ids : array ($group_ids);
// define repository for deleted element
$group_garbage = api_get_path(GARBAGE_PATH).$course['path']."/group/";
@ -359,7 +362,7 @@ class GroupManager
function set_group_properties($group_id, $name, $description, $maximum_number_of_students, $doc_state, $work_state, $calendar_state, $announcements_state, $self_registration_allowed, $self_unregistration_allowed)
{
$table_group = Database :: get_course_table(GROUP_TABLE);
//$table_forum = Database :: get_course_table(TOOL_FORUM_TABLE);
//$table_forum = Database :: get_course_table(TABLE_FORUM);
$sql = "UPDATE ".$table_group."
SET name='".trim($name)."',
doc_state = '".$doc_state."',
@ -852,7 +855,7 @@ class GroupManager
*/
function get_subscribed_users($group_id)
{
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_group_user = Database :: get_course_table(GROUP_USER_TABLE);
$sql = "SELECT `ug`.`id`, `u`.`user_id`, `u`.`lastname`, `u`.`firstname`, `u`.`email`
FROM ".$table_user." u, ".$table_group_user." ug
@ -881,7 +884,7 @@ class GroupManager
*/
function get_subscribed_tutors($group_id,$id_only=false)
{
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_group_tutor = Database :: get_course_table(GROUP_TUTOR_TABLE);
$sql = "SELECT `tg`.`id`, `u`.`user_id`, `u`.`lastname`, `u`.`firstname`, `u`.`email`
FROM ".$table_user." u, ".$table_group_tutor." tg
@ -1056,7 +1059,7 @@ class GroupManager
{
global $_course;
$course_user_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "SELECT user.user_id AS user_id, user.lastname AS lastname, user.firstname AS firstname
FROM ".$user_table." user, ".$course_user_table." cu
WHERE cu.user_id=user.user_id

@ -385,7 +385,7 @@ function api_get_user_info($user_id = '')
}
else
{
$sql = "SELECT * FROM ".Database :: get_main_table(MAIN_USER_TABLE)." WHERE user_id=$user_id";
$sql = "SELECT * FROM ".Database :: get_main_table(TABLE_MAIN_USER)." WHERE user_id=$user_id";
$result = api_sql_query($sql, __FILE__, __LINE__);
$result_array = mysql_fetch_array($result);
// this is done so that it returns the same array-index-names

@ -127,7 +127,7 @@ function WhoIsOnline($uid,$statistics_database,$valid)
function GetFullUserName($uid)
{
$user_table = Database::get_main_table(MAIN_USER_TABLE);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$query = "SELECT `firstname`,`lastname` FROM ".$user_table." WHERE `user_id`='$uid'";
$result = @api_sql_query($query,__FILE__,__LINE__);
if (count($result)>0)
@ -161,7 +161,7 @@ function GetURL($path)
// picture?
function IsValidUser($uid)
{
$user_table = Database::get_main_table(MAIN_USER_TABLE);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$query = "SELECT `picture_uri` FROM ".$user_table." WHERE `user_id`='$uid'";
$result = @api_sql_query($query,__FILE__,__LINE__);
@ -200,7 +200,7 @@ function chatcall() {
{
return (false);
}
$track_user_table = Database::get_main_table(MAIN_USER_TABLE);
$track_user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql="select chatcall_user_id, chatcall_date from $track_user_table where ( user_id = '".$_user['user_id']."' )";
$result=api_sql_query($sql,__FILE__,__LINE__);
$row=mysql_fetch_array($result);

@ -127,7 +127,7 @@ class SurveyManager
function get_survey_author($authorid)
{
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$sql_query = "SELECT * FROM $user_table where user_id='$authorid'";
$res = api_sql_query($sql_query, __FILE__, __LINE__);
$firstname=@mysql_result($res,0,'firstname');
@ -882,7 +882,7 @@ function insert_old_groups($sid,$gids,$table_group,$table_question)
function insert_old_groups($sid,$gids,$table_group,$table_question,$db_name,$cidReq)
{
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT * FROM $table_course WHERE code = '$cidReq'";
$res = api_sql_query($sql,__FILE__,__LINE__);
$obj_name=@mysql_fetch_object($res);
@ -1016,7 +1016,7 @@ function insert_old_groups($sid,$gids,$table_group,$table_question,$db_name,$cid
function import_question($surveyid,$qids,$table_group,$table_question,$db_name,$cidReq,$yes)
{
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql_course = "SELECT * FROM $table_course WHERE code = '$cidReq'";
$res_course = api_sql_query($sql_course,__FILE__,__LINE__);
$obj_name=@mysql_fetch_object($res_course);
@ -1528,7 +1528,7 @@ function import_group($sid,$gids,$db_name,$curr_dbname)
function get_status()
{
$table_user = Database::get_main_table(MAIN_USER_TABLE);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$sqlm = "SELECT status FROM $table_user WHERE user_id = '$_SESSION[_uid]'";
$resm = api_sql_query($sqlm,__FILE__,__LINE__);
$objm=@mysql_fetch_object($resm);

@ -60,7 +60,7 @@ class UserManager
function create_user($firstName, $lastName, $status, $email, $loginName, $password, $official_code = '', $language="english", $phone = '', $picture_uri = '', $auth_source = PLATFORM_AUTH_SOURCE, $expiration_date = '0000-00-00 00:00:00', $active = 1)
{
global $_user, $userPasswordCrypted;
$table_user = Database::get_main_table(MAIN_USER_TABLE);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
if ($_user['user_id'])
{
$creator_id = $_user['user_id'];
@ -139,11 +139,11 @@ class UserManager
{
return false;
}
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$table_class_user = Database :: get_main_table(MAIN_CLASS_USER_TABLE);
$table_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$table_admin = Database :: get_main_table(MAIN_ADMIN_TABLE);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$table_admin = Database :: get_main_table(TABLE_MAIN_ADMIN);
// Unsubscribe the user from all groups in all his courses
$sql = "SELECT * FROM $table_course c, $table_course_user cu WHERE cu.user_id = '".$user_id."' AND c.code = cu.course_code";
@ -211,7 +211,7 @@ class UserManager
function update_user($user_id, $firstname, $lastname, $username, $password = null, $auth_source = null, $email, $status, $official_code, $phone, $picture_uri, $expiration_date, $active, $creator_id= null )
{
global $userPasswordCrypted;
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "UPDATE $table_user SET
lastname='".mysql_real_escape_string($lastname)."',
firstname='".mysql_real_escape_string($firstname)."',
@ -248,7 +248,7 @@ class UserManager
*/
function is_username_available($username)
{
$table_user = Database :: get_main_table(MAIN_USER_TABLE);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "SELECT username FROM $table_user WHERE username = '".addslashes($username)."'";
$res = api_sql_query($sql,__FILE__,__LINE__);
return mysql_num_rows($res) == 0;
@ -261,7 +261,7 @@ class UserManager
*/
function get_user_list()
{
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$sql_query = "SELECT * FROM $user_table";
$sql_result = api_sql_query($sql_query,__FILE__,__LINE__);
while ($result = mysql_fetch_array($sql_result))
@ -277,7 +277,7 @@ class UserManager
*/
function get_user_info($username)
{
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "SELECT * FROM $user_table WHERE username='".$username."'";
$res = api_sql_query($sql,__FILE__,__LINE__);
$user = mysql_fetch_array($res,MYSQL_ASSOC);
@ -288,7 +288,7 @@ class UserManager
function get_teacher_list($course_id, $sel_teacher='')
{
$user_course_table = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$user_table = Database :: get_main_table(MAIN_USER_TABLE);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$sql_query = "SELECT * FROM $user_table a, $user_course_table b where a.user_id=b.user_id AND b.status=1 AND b.course_code='$course_id'";
$sql_result = api_sql_query($sql_query,__FILE__,__LINE__);
echo "<select name=\"author\">";

@ -208,7 +208,7 @@ else
$password = $_POST['password'];
//lookup the user in the main database
$user_table = Database::get_main_table(MAIN_USER_TABLE);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT user_id, username, password, auth_source, active, expiration_date
FROM $user_table
WHERE username = '".trim(addslashes($login))."'";
@ -374,8 +374,8 @@ if (isset($uidReset) && $uidReset) // session data refresh requested
if (isset($_user['user_id']) && $_user['user_id']) // a uid is given (log in succeeded)
{
$user_table = Database::get_main_table(MAIN_USER_TABLE);
$admin_table = Database::get_main_table(MAIN_ADMIN_TABLE);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$admin_table = Database::get_main_table(TABLE_MAIN_ADMIN);
if ($_configuration['tracking_enabled'])
{
$sql = "SELECT `user`.*, `a`.`user_id` `is_admin`,
@ -448,7 +448,7 @@ if (isset($cidReset) && $cidReset) // course session data refresh requested or e
{
if ($cidReq)
{
$course_table = Database::get_main_table(MAIN_COURSE_TABLE);
$course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$course_cat_table = Database::get_main_table(MAIN_CATEGORY_TABLE);
$sql = "SELECT `course`.*, `course_category`.`code` `faCode`, `course_category`.`name` `faName`
FROM $course_table
@ -775,7 +775,7 @@ else
if(isset($_cid))
{
$tbl_course = Database::get_main_table(MAIN_COURSE_TABLE);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$sql="UPDATE $tbl_course SET last_visit=NOW() WHERE code='$_cid'";
api_sql_query($sql,__FILE__,__LINE__);
}

@ -1092,7 +1092,7 @@ function migrate_threads_of_forum($phpbb_forum_id, $new_forum_id)
global $phpbb_threads;
global $table_forums;
$table_users = Database :: get_main_table(MAIN_USER_TABLE);
$table_users = Database :: get_main_table(TABLE_MAIN_USER);
$sql_phpbb_threads="SELECT forum.*, users.user_id
FROM $phpbb_threads forum, $table_users users
@ -1145,7 +1145,7 @@ function migrate_posts_of_thread($phpbb_thread_id, $new_forum_thread_id, $new_fo
global $table_threads;
global $added_resources;
$table_users = Database :: get_main_table(MAIN_USER_TABLE);
$table_users = Database :: get_main_table(TABLE_MAIN_USER);
$table_added_resources = Database::get_course_table(LINKED_RESOURCES_TABLE);

@ -19,12 +19,12 @@ Display :: display_header($nameTools);
api_display_tool_title($nameTools);
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_session = Database :: get_main_table(MAIN_SESSION_TABLE);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_rel_user = Database :: get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_admin= Database :: get_main_table(MAIN_ADMIN_TABLE);
$tbl_admin= Database :: get_main_table(TABLE_MAIN_ADMIN);
/*
===============================================================================

@ -20,9 +20,9 @@ Display :: display_header($nameTools);
api_display_tool_title($nameTools);
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_session = Database :: get_main_table(MAIN_SESSION_TABLE);
$tbl_session_rel_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_rel_course_rel_user = Database :: get_main_table(MAIN_SESSION_COURSE_USER_TABLE);

@ -28,9 +28,9 @@
Display :: display_header($nameTools);
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_user_course = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session = Database :: get_main_table(MAIN_SESSION_TABLE);
$tbl_session_course_user = Database :: get_main_table(MAIN_SESSION_COURSE_USER_TABLE);

@ -1,26 +1,28 @@
<?php
/*
* Created on 27 juil. 2006 by Elixir Interactive http://www.elixir-interactive.com
/**
* @todo use constant for $this_section
*/
$langFile = array ('registration', 'index','trad4all','tracking');
$cidReset=true;
require ('../inc/global.inc.php');
$nameTools= get_lang("MySpace");
$this_section = "session_my_space";
$langFile = array ('registration', 'index','trad4all','tracking');
$cidReset=true;
require ('../inc/global.inc.php');
$nameTools= get_lang("MySpace");
$this_section = "session_my_space";
api_block_anonymous_users();
Display :: display_header($nameTools);
api_block_anonymous_users();
Display :: display_header($nameTools);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_class = Database :: get_main_table(MAIN_CLASS_TABLE);
$tbl_sessions = Database :: get_main_table(MAIN_SESSION_TABLE);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_user = Database :: get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_session_course_user = Database :: get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_admin= Database :: get_main_table(MAIN_ADMIN_TABLE);
// Database table definitions
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$tbl_sessions = Database :: get_main_table(MAIN_SESSION_TABLE);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_user = Database :: get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_session_course_user = Database :: get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_admin = Database :: get_main_table(TABLE_MAIN_ADMIN);
@ -32,13 +34,14 @@ function is_coach(){
$result=api_sql_query($sql);
if(mysql_num_rows($result)>0){
if(mysql_num_rows($result)>0)
{
return true;
}
else{
else
{
return false;
}
}
@ -49,68 +52,63 @@ function is_coach(){
===============================================================================
*/
//Trainers
if(api_is_platform_admin()){
$sqlNbFormateurs = "SELECT COUNT(user_id)
FROM $tbl_user
WHERE status = 1
";
$resultNbFormateurs = api_sql_query($sqlNbFormateurs);
$a_nbFormateurs = mysql_fetch_array($resultNbFormateurs);
$nbFormateurs = $a_nbFormateurs[0];
}
//Coachs
$nbCoachs=0;
if(api_is_platform_admin()){
$sqlNbCoachs = "SELECT COUNT(DISTINCT id_coach)
FROM $tbl_session_course
WHERE id_coach<>'0'
";
$resultNbCoachs = api_sql_query($sqlNbCoachs);
$a_nbCoachs = mysql_fetch_array($resultNbCoachs);
$nbCoachs = $a_nbCoachs[0];
}
elseif($is_allowedCreateCourse){
$a_coach=array();
//Trainers
if(api_is_platform_admin())
{
$sqlNbFormateurs = "SELECT COUNT(user_id) FROM $tbl_user WHERE status = 1";
$resultNbFormateurs = api_sql_query($sqlNbFormateurs);
$a_nbFormateurs = mysql_fetch_array($resultNbFormateurs);
$nbFormateurs = $a_nbFormateurs[0];
}
//Coachs
$nbCoachs=0;
if(api_is_platform_admin())
{
$sqlNbCoachs = "SELECT COUNT(DISTINCT id_coach) FROM $tbl_session_course WHERE id_coach<>'0'";
$resultNbCoachs = api_sql_query($sqlNbCoachs);
$a_nbCoachs = mysql_fetch_array($resultNbCoachs);
$nbCoachs = $a_nbCoachs[0];
}
elseif($is_allowedCreateCourse)
{
$a_coach=array();
$sqlNbCours = " SELECT course_code
FROM $tbl_course_user
WHERE user_id='".$_user['user_id']."' AND status='1'
";
$resultNbCours = api_sql_query($sqlNbCours);
while($a_courses=mysql_fetch_array($resultNbCours)){
$sql="SELECT DISTINCT id_coach FROM $tbl_session_course WHERE course_code='".$a_courses["course_code"]."'";
$sqlNbCours = " SELECT course_code
FROM $tbl_course_user
WHERE user_id='".$_user['user_id']."' AND status='1'
";
$resultNbCours = api_sql_query($sqlNbCours);
while($a_courses=mysql_fetch_array($resultNbCours))
{
$sql="SELECT DISTINCT id_coach FROM $tbl_session_course WHERE course_code='".$a_courses["course_code"]."'";
$resultCoach = api_sql_query($sql);
$resultCoach = api_sql_query($sql);
if(mysql_num_rows($resultCoach)>0){
while($a_temp=mysql_fetch_array($resultCoach)){
$a_coach[]=$a_temp["id_coach"];
}
if(mysql_num_rows($resultCoach)>0)
{
while($a_temp=mysql_fetch_array($resultCoach))
{
$a_coach[]=$a_temp["id_coach"];
}
}
}
$a_coach=array_unique($a_coach);
$nbCoachs=count($a_coach);
}
$a_coach=array_unique($a_coach);
$nbCoachs=count($a_coach);
}
//Nombre de stagiaires (cours dans lesquels il est coach ou formateurs)
//Nombre de stagiaires (cours dans lesquels il est coach ou formateurs)
$nbStagiaire=0;
$a_stagiaire_teacher=array();
//La personne est admin
if(api_is_platform_admin()){
if(api_is_platform_admin())
{
$sqlNbStagiaire = " SELECT COUNT(user_id)
FROM $tbl_user
@ -120,9 +118,8 @@ function is_coach(){
$a_nbStagiaire = mysql_fetch_array($resultNbStagiaire);
$nbStagiaire = $a_nbStagiaire[0];
}
else{
else
{
//La personne a le statut de professeur
if($is_allowedCreateCourse){
@ -131,12 +128,15 @@ function is_coach(){
$result_courses=api_sql_query($sql_select_courses);
while($a_courses=mysql_fetch_array($result_courses)){
while($a_courses=mysql_fetch_array($result_courses))
{
$s_course_code=$a_courses["course_code"];
$sqlStudents = "SELECT user.user_id,lastname,firstname,email FROM $tbl_course_user as course_rel_user, $tbl_user as user WHERE course_rel_user.user_id=user.user_id AND course_rel_user.status='5' AND course_rel_user.course_code='$s_course_code'";
$result_students=api_sql_query($sqlStudents);
if(mysql_num_rows($result_students)>0){
while($a_students_temp=mysql_fetch_array($result_students)){
if(mysql_num_rows($result_students)>0)
{
while($a_students_temp=mysql_fetch_array($result_students))
{
$a_stagiaire_teacher[]=$a_students_temp["user_id"];
}
}
@ -147,22 +147,22 @@ function is_coach(){
$resultNbStagiaire = api_sql_query($sqlNbStagiaire);
while($a_temp = mysql_fetch_array($resultNbStagiaire)){
while($a_temp = mysql_fetch_array($resultNbStagiaire))
{
$a_stagiaire_teacher[]=$a_temp[0];
}
}
}
if(is_coach()){
if(is_coach())
{
$a_stagiaire_coach=array();
$sql="SELECT id_session, course_code FROM $tbl_session_course WHERE id_coach='".$_user['user_id']."'";
$result=api_sql_query($sql);
while($a_courses=mysql_fetch_array($result)){
while($a_courses=mysql_fetch_array($result))
{
$course_code=$a_courses["course_code"];
$id_session=$a_courses["id_session"];
@ -175,7 +175,8 @@ function is_coach(){
$q_students=api_sql_query($sqlStudents);
while($a_temp=mysql_fetch_array($q_students)){
while($a_temp=mysql_fetch_array($q_students))
{
$a_stagiaire_coach[]=$a_temp[0];
}
@ -187,16 +188,16 @@ function is_coach(){
$nbStagiaire=count($a_stagiaires);
}
else{
else
{
$nbStagiaire=count($a_stagiaire_teacher);
}
}
//Nombre de cours
//La personne est admin donc on compte le nombre total de cours
if(api_is_platform_admin()){
if(api_is_platform_admin())
{
$sqlNbCours = " SELECT COUNT(code)
FROM $tbl_course
@ -212,7 +213,8 @@ function is_coach(){
$a_cours=array();
//La personne a le statut de professeur
if($is_allowedCreateCourse){
if($is_allowedCreateCourse)
{
$sqlNbCours = " SELECT DISTINCT course_code
FROM $tbl_course_user
@ -249,37 +251,37 @@ function is_coach(){
//Nombre de sessions
//La personne est admin donc on compte le nombre total de sessions
if(api_is_platform_admin()){
if(api_is_platform_admin())
{
$sqlNbSessions = " SELECT COUNT(id)
FROM $tbl_sessions
";
$resultNbSessions = api_sql_query($sqlNbSessions);
$a_nbSessions= mysql_fetch_array($resultNbSessions);
$nbSessions = $a_nbSessions[0];
}
else{
else
{
$a_sessions=array();
if($is_allowedCreateCourse){
if($is_allowedCreateCourse)
{
$sqlNbSessions = " SELECT DISTINCT id_session
FROM $tbl_session_course as session_course, $tbl_course_user as course_rel_user
WHERE session_course.course_code=course_rel_user.course_code AND course_rel_user.status='1' AND course_rel_user.user_id='".$_user['user_id']."'
";
$resultNbSessions = api_sql_query($sqlNbSessions);
while($a_temp = mysql_fetch_array($resultNbSessions)){
while($a_temp = mysql_fetch_array($resultNbSessions))
{
$a_sessions[]=$a_temp["id_session"];
}
}
if(is_coach()){
if(is_coach())
{
$sqlNbSessions = " SELECT DISTINCT id_session
FROM $tbl_session_course
WHERE id_coach='".$_user['user_id']."'
@ -287,10 +289,10 @@ function is_coach(){
$resultNbSessions = api_sql_query($sqlNbSessions);
while($a_temp = mysql_fetch_array($resultNbSessions)){
while($a_temp = mysql_fetch_array($resultNbSessions))
{
$a_sessions[]=$a_temp["id_session"];
}
}
$a_sessions=array_unique($a_sessions);
@ -301,26 +303,25 @@ function is_coach(){
$sql_nb_admin="SELECT count(user_id) FROM $tbl_admin";
$resultNbAdmin = api_sql_query($sql_nb_admin);
$i_nb_admin=mysql_result($resultNbAdmin,0,0);
?>
<?php
if(api_is_platform_admin()){
echo '<div class="admin_section">
if(api_is_platform_admin())
{
echo '<div class="admin_section">
<h4>
<a href="teachers.php"><img src="'.api_get_path(WEB_IMG_PATH).'teachers.gif">&nbsp;'.get_lang('Trainers').' ('.$nbFormateurs.')</a>
<a href="teachers.php"><img src="'.api_get_path(WEB_IMG_PATH).'teachers.gif">&nbsp;'.get_lang('Trainers').' ('.$nbFormateurs.')</a>
</h4>
</div>';
}
}
if(api_is_platform_admin() || $is_allowedCreateCourse){
if(api_is_platform_admin() || $is_allowedCreateCourse)
{
echo '<div class="admin_section">
<h4>
<a href="coaches.php"><img src="'.api_get_path(WEB_IMG_PATH).'coachs.gif">&nbsp;'.get_lang("Tutor").' ('.$nbCoachs.')</a>
</h4>
</div>';
}
?>
}
?>
<div class="admin_section">
<h4>
<?php

@ -121,12 +121,12 @@ function exportCsv($a_infosUser,$tableTitle,$a_header,$a_dataLearnpath,$a_dataEx
*===============================================================================
*/
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_session_user = Database :: get_main_table(MAIN_SESSION_USER_TABLE);
$tbl_session = Database :: get_main_table(MAIN_SESSION_TABLE);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_course_user = Database :: get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_stats_exercices = Database :: get_statistic_table(STATISTIC_TRACK_E_EXERCICES_TABLE);
//$tbl_course_lp_view = Database :: get_course_table('lp_view');

@ -16,8 +16,8 @@ require ('../inc/global.inc.php');
Display :: display_header($nameTools);
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$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(MAIN_SESSION_COURSE_TABLE);
$tbl_session = Database :: get_main_table(MAIN_SESSION_TABLE);
$tbl_track_exercice = Database :: get_statistic_table(STATISTIC_TRACK_E_EXERCICES_TABLE);

@ -16,8 +16,8 @@
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$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(MAIN_SESSION_COURSE_TABLE);
$tbl_session = Database :: get_main_table(MAIN_SESSION_TABLE);
$tbl_track_exercice = Database :: get_statistic_table(STATISTIC_TRACK_E_EXERCICES_TABLE);

@ -18,7 +18,7 @@ ob_start();
$tbl_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_sessions = Database :: get_main_table(MAIN_SESSION_TABLE);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
/*

@ -16,8 +16,8 @@ ob_start();
Display :: display_header($nameTools);
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_session = Database :: get_main_table(MAIN_SESSION_TABLE);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
@ -80,7 +80,7 @@ ob_start();
$tbl_session_course_user = Database :: get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
@ -132,7 +132,7 @@ ob_start();
$tbl_session_course_user = Database :: get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
$sql_select_courses="SELECT course_rel_user.course_code FROM $tbl_course_user as course_rel_user, $tbl_session_course as session_rel_course WHERE user_id='$i_teacher_id' AND status='1' AND session_rel_course.course_code=course_rel_user.course_code";
@ -182,7 +182,7 @@ ob_start();
$tbl_session_course_user = Database :: get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
$tbl_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
$sql_select_courses="SELECT course_code, id_session FROM $tbl_session_course as session_rel_course WHERE session_rel_course.id_coach='$i_coach_id'";

@ -20,8 +20,8 @@ Display :: display_header($nameTools);
api_display_tool_title($nameTools);
$tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
$tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_session = Database :: get_main_table(MAIN_SESSION_TABLE);
$tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
$tbl_session_rel_user = Database :: get_main_table(MAIN_SESSION_USER_TABLE);

@ -229,7 +229,7 @@ class aicc extends learnpath {
$new_lp_item = 'lp_item';
//The previous method wasn't safe to get the database name, so do it manually with the course_code
$sql = "SELECT * FROM ".Database::get_main_table(MAIN_COURSE_TABLE)." WHERE code='$course_code'";
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE)." WHERE code='$course_code'";
$res = api_sql_query($sql,__FILE__,__LINE__);
if(Database::num_rows($res)<1){ error_log('New LP - Database for '.$course_code.' not found '.__FILE__.' '.__LINE__,0);return -1;}
$row = Database::fetch_array($res);

@ -80,7 +80,7 @@ class learnpath {
}
else
{
$main_table = Database::get_main_table(MAIN_COURSE_TABLE);
$main_table = Database::get_main_table(TABLE_MAIN_COURSE);
//$course = Database::escape_string($course);
$course = $this->escape_string($course);
$sql = "SELECT * FROM $main_table WHERE code = '$course'";
@ -152,7 +152,7 @@ class learnpath {
else
{
//$main_table = Database::get_main_user_table();
$main_table = Database::get_main_table(MAIN_USER_TABLE);
$main_table = Database::get_main_table(TABLE_MAIN_USER);
//$user_id = Database::escape_integer($user_id);
$user_id = $this->escape_string($user_id);
$sql = "SELECT * FROM $main_table WHERE user_id = '$user_id'";

@ -2066,7 +2066,7 @@ function exportitem($id, $item_id, $item_type, $add_scorm_communications = false
//------------------------POST BEGIN---------------------------------------
case "Post" :
//1 Get the forum post data from the database
$tbl_posts =Database::get_course_table(TOOL_FORUM_POST_TABLE);
$tbl_posts =Database::get_course_table(TABLE_FORUM_POST);
$tbl_posts_text =Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE);
$result = api_sql_query("SELECT * FROM $tbl_posts where post_id=$item_id", __FILE__, __LINE__);
$myrow = mysql_fetch_array($result);

@ -319,7 +319,7 @@ function display_addedresource_link($type, $id, $style='')
echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$myrow['topic_id'].'&amp;forum='.$myrow['forum_id'].'&amp;md5='.$myrow['md5'].'"'.$styling.'>'.$myrow_title['post_title']."</a><br />\n";
break;
case 'Post':
$tbl_post = Database::get_course_table(TOOL_FORUM_POST_TABLE);
$tbl_post = Database::get_course_table(TABLE_FORUM_POST);
$tbl_post_text = Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE);
$sql = "SELECT * FROM $tbl_post p, $tbl_post_text t WHERE p.post_id = t.post_id AND p.post_id = $id";
$result = api_sql_query($sql,__FILE__,__LINE__);
@ -1742,9 +1742,9 @@ function rl_get_html_resource_link($course_code, $type, $id, $style='', $new_win
break;
case TOOL_THREAD: //=topics
if(!empty($_SESSION['dokeos_version']) AND $_SESSION['dokeos_version']>=1.8){
//$tbl_forum = Database::get_course_table(TOOL_FORUM_TABLE,$_course['database']);
//$tbl_thread = Database::get_course_table(TOOL_FORUM_THREAD_TABLE,$_course['database']);
$tbl_post = Database::get_course_table(TOOL_FORUM_POST_TABLE,$_course['database']);
//$tbl_forum = Database::get_course_table(TABLE_FORUM,$_course['database']);
//$tbl_thread = Database::get_course_table(TABLE_FORUM_THREAD,$_course['database']);
$tbl_post = Database::get_course_table(TABLE_FORUM_POST,$_course['database']);
// grabbing the title of the post
$sql_title = "SELECT * FROM $tbl_post WHERE post_id=".$id;
$result_title = api_sql_query($sql_title,__FILE__,__LINE__);
@ -1764,7 +1764,7 @@ function rl_get_html_resource_link($course_code, $type, $id, $style='', $new_win
}
break;
case TOOL_POST:
$tbl_post = Database::get_course_table(TOOL_FORUM_POST_TABLE,$_course['database']);
$tbl_post = Database::get_course_table(TABLE_FORUM_POST,$_course['database']);
//$tbl_post_text = Database::get_course_table(FORUM_POST_TEXT_TABLE);
$sql = "SELECT * FROM $tbl_post p WHERE p.post_id = $id";
$result = api_sql_query($sql,__FILE__,__LINE__);
@ -1892,7 +1892,7 @@ function rl_get_resource_link_for_learnpath($course_code, $learnpath_id, $id_in_
break;
case TOOL_POST:
$tbl_post = Database::get_course_table(TOOL_FORUM_POST_TABLE,$_course['database']);
$tbl_post = Database::get_course_table(TABLE_FORUM_POST,$_course['database']);
$result= api_sql_query("SELECT * FROM $tbl_post where post_id=$id",__FILE__,__LINE__);
$myrow=Database::fetch_array($result);
$title=$myrow['post_title'];
@ -2007,9 +2007,9 @@ function rl_get_resource_name($course_code, $learnpath_id, $id_in_path)
break;
case TOOL_THREAD: //=topics
if(!empty($_SESSION['dokeos_version']) AND $_SESSION['dokeos_version']>=1.8){
//$tbl_forum = Database::get_course_table(TOOL_FORUM_TABLE,$_course['database']);
//$tbl_thread = Database::get_course_table(TOOL_FORUM_THREAD_TABLE,$_course['database']);
$tbl_post = Database::get_course_table(TOOL_FORUM_POST_TABLE,$_course['database']);
//$tbl_forum = Database::get_course_table(TABLE_FORUM,$_course['database']);
//$tbl_thread = Database::get_course_table(TABLE_FORUM_THREAD,$_course['database']);
$tbl_post = Database::get_course_table(TABLE_FORUM_POST,$_course['database']);
// grabbing the title of the post
$sql_title = "SELECT * FROM $tbl_post WHERE post_id=".$id;
$result_title = api_sql_query($sql_title,__FILE__,__LINE__);
@ -2029,7 +2029,7 @@ function rl_get_resource_name($course_code, $learnpath_id, $id_in_path)
}
break;
case TOOL_POST:
$tbl_post = Database::get_course_table(TOOL_FORUM_POST_TABLE,$_course['database']);
$tbl_post = Database::get_course_table(TABLE_FORUM_POST,$_course['database']);
//$tbl_post_text = Database::get_course_table(FORUM_POST_TEXT_TABLE);
$sql = "SELECT * FROM $tbl_post p WHERE p.post_id = $id";
$result = api_sql_query($sql,__FILE__,__LINE__);

@ -826,10 +826,10 @@ if ($content == "Ad_Valvas")
*/
if ($content == "Forum")
{
$TBL_FORUMS = Database::get_course_table(TOOL_FORUM_TABLE);
$TBL_CATAGORIES = Database::get_course_table(TOOL_FORUM_CATEGORY_TABLE);
$TBL_FORUMTOPICS = Database::get_course_table(TOOL_FORUM_THREAD_TABLE);
$tbl_posts = Database::get_course_table(TOOL_FORUM_POST_TABLE);
$TBL_FORUMS = Database::get_course_table(TABLE_FORUM);
$TBL_CATAGORIES = Database::get_course_table(TABLE_FORUM_CATEGORY);
$TBL_FORUMTOPICS = Database::get_course_table(TABLE_FORUM_THREAD);
$tbl_posts = Database::get_course_table(TABLE_FORUM_POST);
echo "<table width='100%'>";

@ -358,7 +358,7 @@ class scorm extends learnpath {
$new_lp_item = 'lp_item';
//The previous method wasn't safe to get the database name, so do it manually with the course_code
$sql = "SELECT * FROM ".Database::get_main_table(MAIN_COURSE_TABLE)." WHERE code='$course_code'";
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE)." WHERE code='$course_code'";
$res = api_sql_query($sql,__FILE__,__LINE__);
if(Database::num_rows($res)<1){ error_log('Database for '.$course_code.' not found '.__FILE__.' '.__LINE__,0);return -1;}
$row = Database::fetch_array($res);
@ -837,7 +837,7 @@ class scorm extends learnpath {
if($this->debug>0){error_log('In scorm::reimport_manifest() method',0);}
global $_course;
//RECOVERING PATH FROM DB
$main_table = Database::get_main_table(MAIN_COURSE_TABLE);
$main_table = Database::get_main_table(TABLE_MAIN_COURSE);
//$course = Database::escape_string($course);
$course = $this->escape_string($course);
$sql = "SELECT * FROM $main_table WHERE code = '$course'";

@ -5,7 +5,7 @@ $max_dsp_lp = 0;
$courses_list = array();
$courses_id_list = array();
$courses_dir_list = array();
$sql = "SELECT * FROM ".Database::get_main_table(MAIN_COURSE_TABLE)."";
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE)."";
echo $sql."<br />\n";
$res = api_sql_query($sql,__FILE__,__LINE__);
while ($row = Database::fetch_array($res))

@ -5,7 +5,7 @@ $max_dsp_lp = 0;
$courses_list = array();
$courses_id_list = array();
$courses_dir_list = array();
$sql = "SELECT * FROM ".Database::get_main_table(MAIN_COURSE_TABLE)."";
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE)."";
echo $sql."<br />\n";
$res = api_sql_query($sql,__FILE__,__LINE__);
while ($row = Database::fetch_array($res))

@ -50,7 +50,7 @@ $max_dsp_lp = 0;
$courses_list = array();
$courses_id_list = array();
$courses_dir_list = array();
$sql = "SELECT * FROM ".Database::get_main_table(MAIN_COURSE_TABLE)."";
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE);
$res = api_sql_query($sql,__FILE__,__LINE__);
while ($row = Database::fetch_array($res))
{
@ -538,7 +538,7 @@ $lp_course_code = array();
$scorm_lp_paths = array();
//avoid empty dokeosCourse fields as they potentially break the rest
$course_main = Database::get_main_table(MAIN_COURSE_TABLE);
$course_main = Database::get_main_table(TABLE_MAIN_COURSE);
$sql_crs = "SELECT * FROM $course_main WHERE target_course_code IS NULL";
echo "$sql_crs<br />\n";
$res_crs = api_sql_query($sql_crs,__FILE__,__LINE__);

@ -42,7 +42,7 @@ $max_dsp_lp = 0;
$courses_list = array();
$courses_id_list = array();
$courses_dir_list = array();
$sql = "SELECT * FROM ".Database::get_main_table(MAIN_COURSE_TABLE)." WHERE code='$course_code'";
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE)." WHERE code='$course_code'";
$res = api_sql_query($sql,__FILE__,__LINE__);
while ($row = Database::fetch_array($res))
{
@ -472,7 +472,7 @@ $lp_course_code = array();
$scorm_lp_paths = array();
//avoid empty dokeosCourse fields as they potentially break the rest
$course_main = Database::get_main_table(MAIN_COURSE_TABLE);
$course_main = Database::get_main_table(TABLE_MAIN_COURSE);
$sql_crs = "SELECT * FROM $course_main WHERE target_course_code IS NULL AND code = '$course_code'";
echo "$sql_crs<br />\n";
$res_crs = api_sql_query($sql_crs,__FILE__,__LINE__);

@ -10,7 +10,7 @@
*/
require_once('back_compat.inc.php');
$sql = "SELECT * FROM ".Database::get_main_table(MAIN_COURSE_TABLE)."";
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE)."";
$res = api_sql_query($sql,__FILE__,__LINE__);
while ($row = Database::fetch_array($res))
{

@ -10,7 +10,7 @@
*/
require_once('back_compat.inc.php');
$sql = "SELECT * FROM ".Database::get_main_table(MAIN_COURSE_TABLE)."";
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE)."";
$res = api_sql_query($sql,__FILE__,__LINE__);
while ($row = Database::fetch_array($res))
{

@ -38,7 +38,7 @@ include('../inc/global.inc.php');
$reset=$_GET['reset']?true:false;
$tbl_user = Database::get_main_table(MAIN_USER_TABLE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);

@ -37,7 +37,7 @@ $langFile='chat';
include('../inc/global.inc.php');
$this_section=SECTION_COURSES;
$tbl_user=Database::get_main_table(MAIN_USER_TABLE);
$tbl_user=Database::get_main_table(TABLE_MAIN_USER);
$tbl_online_connected=Database::get_course_table(ONLINE_CONNECTED_TABLE);
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";

@ -37,7 +37,7 @@ $langFile='chat';
include('../inc/global.inc.php');
$this_section=SECTION_COURSES;
$tbl_user = Database::get_main_table(MAIN_USER_TABLE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);

@ -37,7 +37,7 @@ $langFile='chat';
include('../inc/global.inc.php');
$this_section=SECTION_COURSES;
$tbl_user = Database::get_main_table(MAIN_USER_TABLE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);

@ -1,4 +1,4 @@
<?php // $Id: online_links.php 10083 2006-11-21 19:43:29Z pcool $
<?php // $Id: online_links.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -42,7 +42,7 @@ include_once(api_get_path(LIBRARY_PATH).'fileUpload.lib.php');
$action=$_GET['action'];
$link=intval($_GET['link']);
$tbl_user=Database::get_main_table(MAIN_USER_TABLE);
$tbl_user=Database::get_main_table(TABLE_MAIN_USER);
$tbl_online_link=Database::get_course_table(ONLINE_LINK_TABLE);
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";

@ -1,4 +1,4 @@
<?php // $Id: online_master.php 9988 2006-11-15 01:28:32Z pcool $
<?php // $Id: online_master.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -39,7 +39,7 @@ $this_section=SECTION_COURSES;
$init=intval($_GET['init']);
$tbl_user = Database::get_main_table(MAIN_USER_TABLE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_course_user = Database::get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_online_link=Database::get_course_table(ONLINE_LINK_TABLE);

@ -1,4 +1,4 @@
<?php // $Id: online_message.php 9988 2006-11-15 01:28:32Z pcool $
<?php // $Id: online_message.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -46,7 +46,7 @@ $this_section=SECTION_COURSES;
$sent = $_REQUEST['sent'];
$question = $_REQUEST['question'];
$tbl_user = Database::get_main_table(MAIN_USER_TABLE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);

@ -1,4 +1,4 @@
<?php // $Id: online_streaming.php 9988 2006-11-15 01:28:32Z pcool $
<?php // $Id: online_streaming.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -37,7 +37,7 @@ $langFile='chat';
include('../inc/global.inc.php');
$this_section=SECTION_COURSES;
$tbl_user = Database::get_main_table(MAIN_USER_TABLE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$query="SELECT username FROM $tbl_user WHERE user_id='".$_user['user_id']."'";
$result=api_sql_query($query,__FILE__,__LINE__);

@ -1,4 +1,4 @@
<?php // $Id: online_whoisonline.php 9988 2006-11-15 01:28:32Z pcool $
<?php // $Id: online_whoisonline.php 10190 2006-11-24 00:23:20Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -39,7 +39,7 @@ $this_section=SECTION_COURSES;
$showPic=intval($_GET['showPic']);
$tbl_user=Database::get_main_table(MAIN_USER_TABLE);
$tbl_user=Database::get_main_table(TABLE_MAIN_USER);
$tbl_course_user = Database::get_main_table(MAIN_COURSE_USER_TABLE);
$tbl_online_connected=Database::get_course_table(ONLINE_CONNECTED_TABLE);

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save