function course_report_load in Course 6
Same name and namespace in other branches
- 7.2 course.module \course_report_load()
- 7 course.module \course_report_load()
Load a course report entry, by report entry ID or node/user object.
Return value
object An object representation of a course report.
5 calls to course_report_load()
- course_edit_enrollment_action in ./
course.module - Edit enrolment action
- course_edit_enrollment_action_form in ./
course.module - Edit enrollment action form.
- course_outline_show_complete_links in includes/
course.outline.inc - Render a landing page for course completion.
- course_takecourse_title in ./
course.module - Menu title handler for the Take course tab.
- _course_report_retrieve in services/
course_report_resource.inc - Get one course report record.
1 string reference to 'course_report_load'
File
- ./
course.module, line 2414 - course.module Core functionality for Courses.
Code
function course_report_load($mixed, $user = NULL) {
if (is_object($mixed)) {
$result = db_query('SELECT cr.* FROM {course_report} cr WHERE nid = %d AND uid = %d', $mixed->nid, $user->uid);
return db_fetch_object($result);
}
elseif (is_numeric($user)) {
$result = db_query('SELECT cr.* FROM {course_report} cr WHERE nid = %d AND uid = %d', $mixed, $user);
return db_fetch_object($result);
}
else {
$result = db_query('SELECT cr.* FROM {course_report} cr WHERE crid = %d', $mixed);
return db_fetch_object($result);
}
}