Added attendace_get_participants(). Needed to implement

backup & restore.
This commit is contained in:
stronk7 2003-09-18 18:08:49 +00:00
parent 2cc4c0b4bf
commit 5735794924

View File

@ -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);
}
?>