".COURSE_RELATION_TYPE_RRHH." AND t3.c_id = '".$courseInfo['real_id']."' AND t2.last_connection>'".$date_inter."' $extra_condition ORDER BY username"; $result = Database::query($sql); $users = Database::store_result($result); } else { $session_condition = api_get_session_condition($session_id, true, false, 't3.session_id'); // select learners $query = "SELECT DISTINCT t1.user_id,username,firstname,lastname,picture_uri,email FROM $tbl_user t1, $tbl_chat_connected t2, $tbl_session_course_user t3 WHERE t2.c_id = $course_id AND t1.user_id=t2.user_id AND t3.user_id=t2.user_id AND t3.session_id = '".$session_id."' AND t3.c_id = '".$courseInfo['real_id']."' AND t2.last_connection>'".$date_inter."' $session_condition ORDER BY username"; $result = Database::query($query); while ($learner = Database::fetch_array($result)) { $users[$learner['user_id']] = $learner; } // select session coach $query = "SELECT DISTINCT t1.user_id,username,firstname,lastname,picture_uri,email FROM $tbl_user t1,$tbl_chat_connected t2,$tbl_session t3 WHERE t2.c_id = $course_id AND t1.user_id=t2.user_id AND t3.id_coach=t2.user_id AND t3.id = '".$session_id."' AND t2.last_connection > '".$date_inter."' $extra_condition ORDER BY username"; $result = Database::query($query); if ($coach = Database::fetch_array($result)) { $users[$coach['user_id']] = $coach; } // select session course coach $query = "SELECT DISTINCT t1.user_id,username,firstname,lastname,picture_uri,email FROM $tbl_user t1,$tbl_chat_connected t2,$tbl_session_course_user t3 WHERE t2.c_id = $course_id AND t1.user_id=t2.user_id AND t3.user_id =t2.user_id AND t3.status=2 AND t3.session_id = '".$session_id."' AND t3.c_id = '".$course_id."' AND t2.last_connection>'".$date_inter."' $extra_condition ORDER BY username"; $result = Database::query($query); $course_coaches = array(); while ($coaches = Database::fetch_array($result)) { $users[$coaches['user_id']] = $coaches; } } require 'header_frame.inc.php'; ?>
  • '18')); } else { echo Display::return_icon('students.gif', get_lang('Student'), array('height' => '18')); } ?>