mirror of
https://github.com/moodle/moodle.git
synced 2025-01-21 23:48:45 +01:00
Added attendace_get_participants(). Needed to implement
backup & restore.
This commit is contained in:
parent
2cc4c0b4bf
commit
5735794924
@ -391,4 +391,21 @@ function attendance_get_records($table, $field1="", $value1="", $field2="", $val
|
||||
return get_records_sql("SELECT $fields FROM $CFG->prefix$table $select $sort $limit");
|
||||
}
|
||||
|
||||
function attendance_get_participants($attendanceid) {
|
||||
//Returns the users with data in one attendance
|
||||
//(users with records in attendance_roll, students)
|
||||
|
||||
global $CFG;
|
||||
|
||||
//Get students
|
||||
$students = get_records_sql("SELECT DISTINCT u.*
|
||||
FROM {$CFG->prefix}user u,
|
||||
{$CFG->prefix}attendance_roll a
|
||||
WHERE a.dayid = '$attendanceid' and
|
||||
u.id = a.userid");
|
||||
|
||||
//Return students array (it contains an array of unique users)
|
||||
return ($students);
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user