$sql = "SELECT *, id as real_id FROM $tbl_course c
INNER JOIN $tbl_course_rel_user cru ON (cru.course_code = c.code) LEFT JOIN $tbl_course_rel_access_url a ON (a.course_code = c.code) WHERE cru.user_id = '$user_id' AND status = ".DRH." AND relation_type = '".COURSE_RELATION_TYPE_RRHH."' AND access_url_id = ".api_get_current_access_url_id()."";
INNER JOIN $tbl_course_rel_user cru ON (cru.course_code = c.code)
LEFT JOIN $tbl_course_rel_access_url a ON (a.course_code = c.code)
WHERE
cru.user_id = '$user_id' AND
status = ".DRH." AND
relation_type = '".COURSE_RELATION_TYPE_RRHH."' AND
$sql = "SELECT *, id as real_id FROM $tbl_course c
INNER JOIN $tbl_course_rel_user cru ON cru.course_code = c.code AND cru.user_id = '$user_id' AND status = ".DRH." AND relation_type = '".COURSE_RELATION_TYPE_RRHH."' ";
$sql = "SELECT * FROM $tbl_session s INNER JOIN $tbl_session_rel_user sru ON (sru.id_session = s.id) LEFT JOIN $tbl_session_rel_access_url a ON (s.id = a.session_id)
WHERE sru.id_user = '$hr_manager_id' AND sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."' AND access_url_id = ".api_get_current_access_url_id()."";
$sql = "SELECT * FROM $tbl_session s
INNER JOIN $tbl_session_rel_user sru ON (sru.id_session = s.id)
LEFT JOIN $tbl_session_rel_access_url a ON (s.id = a.session_id)
WHERE
sru.id_user = '$hr_manager_id' AND
sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."' AND