Use c_id instead of course code

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 02fdee3abb
commit f421984e52
  1. 5
      main/cron/import_csv.php
  2. 9
      main/inc/lib/sessionmanager.lib.php

@ -2066,14 +2066,13 @@ class ImportCsv
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE_USER)."
WHERE
user_id = ".$userId." AND
course_code = '".$courseInfo['code']."'
c_id = '".$courseInfo['real_id']."'
";
$result = Database::query($sql);
$rows = Database::num_rows($result);
if ($rows > 0) {
$userCourseData = Database::fetch_array($result, 'ASSOC');
if (!empty($userCourseData) && !empty($userCourseData['user_course_cat'])) {
if (!empty($userCourseData)) {
$teacherBackup[$userId][$courseInfo['code']] = $userCourseData;
}
}

@ -4677,7 +4677,6 @@ class SessionManager
$course_code = $courseArray[0];
if (CourseManager::course_exists($course_code)) {
$courseInfo = api_get_course_info($course_code);
$courseId = $courseInfo['real_id'];
@ -4790,14 +4789,14 @@ class SessionManager
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE_USER)."
WHERE
user_id = ".$teacher['user_id']." AND
course_code = '".$course_code."'
c_id = '".$courseId."'
";
$result = Database::query($sql);
$rows = Database::num_rows($result);
if ($rows > 0) {
$userCourseData = Database::fetch_array($result, 'ASSOC');
if (!empty($userCourseData) && !empty($userCourseData['user_course_cat'])) {
if (!empty($userCourseData)) {
$teacherBackupList[$teacher['user_id']][$course_code] = $userCourseData;
}
}
@ -4922,14 +4921,14 @@ class SessionManager
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE_USER)."
WHERE
user_id = ".$teacher['user_id']." AND
course_code = '".$course_code."'
c_id = '".$courseId."'
";
$result = Database::query($sql);
$rows = Database::num_rows($result);
if ($rows > 0) {
$userCourseData = Database::fetch_array($result, 'ASSOC');
if (!empty($userCourseData) && !empty($userCourseData['user_course_cat'])) {
if (!empty($userCourseData)) {
$teacherBackupList[$teacher['user_id']][$course_code] = $userCourseData;
}
}

Loading…
Cancel
Save