$coach_name = " CONCAT(u.firstname, ' ', u.lastname) as coach_name ";
$coach_name = " CONCAT(u.firstname, ' ', u.lastname) as coach_name ";
}
$today = api_get_utc_datetime();
@ -723,12 +724,13 @@ class SessionManager {
}
//}
}
// count users in this session-course relation
$sql = "SELECT COUNT(id_user) as nbUsers FROM $tbl_session_rel_course_rel_user WHERE id_session='$id_session' AND course_code='$enreg_course' AND status<>2";
$sql = "SELECT COUNT(id_user) as nbUsers FROM $tbl_session_rel_course_rel_user WHERE id_session='$session_id' AND course_code='$course_code' AND status<>2";
$rs = Database::query($sql);
list($nbr_users) = Database::fetch_array($rs);
// update the session-course relation to add the users total
$update_sql = "UPDATE $tbl_session_rel_course SET nbr_users=$nbr_users WHERE id_session='$id_session' AND course_code='$enreg_course'";
$update_sql = "UPDATE $tbl_session_rel_course SET nbr_users=$nbr_users WHERE id_session='$session_id' AND course_code='$course_code'";
Database::query($update_sql);
}
@ -1667,7 +1669,7 @@ class SessionManager {
* @param $copy_users
* @param $create_new_courses
* @param $set_exercises_lp_invisible
* @return unknown_type
* @return int
*/
public function copy_session($id, $copy_courses = true, $copy_users = true, $create_new_courses = false, $set_exercises_lp_invisible = false) {