forked from science-ation/science-ation
Add basic project info to registration/view
This commit is contained in:
parent
0d365bc731
commit
cd140c198a
3
api.php
3
api.php
@ -879,8 +879,9 @@ switch($request[0]) {
|
||||
|
||||
/* APIDOC: registration/view
|
||||
description(registration information about the currently logged in users registration)
|
||||
object(registration: {id,num,status,end,nummentors,students array of student,status array})
|
||||
object(registration: {id,num,status,end,nummentors,students array of student,status array,project array})
|
||||
object(student: {id,accounts_id,username,firstname,lastname,complete})
|
||||
object(project: {id,projectnumber,title})
|
||||
return(registration array)
|
||||
*/
|
||||
case 'view':
|
||||
|
@ -421,12 +421,19 @@ function getRegistration($id) {
|
||||
$reg=mysql_fetch_assoc($q);
|
||||
if(!$reg) return null;
|
||||
|
||||
//get the students
|
||||
$s=mysql_query("SELECT users.id,users.firstname,users.lastname, accounts.id AS accounts_id, accounts.username FROM users JOIN accounts ON users.accounts_id=accounts.id WHERE users.registrations_id='$id' AND users.conferences_id='{$conference['id']}'");
|
||||
while($r=mysql_fetch_assoc($s)) {
|
||||
$r['complete']=studentIndividualStatus($r['id']);
|
||||
$reg['students'][]=$r;
|
||||
}
|
||||
|
||||
//and also get the project
|
||||
$pq=mysql_query("SELECT id,projectnumber,title FROM projects WHERE registrations_id='$id' AND conferences_id='{$conference['id']}'");
|
||||
$p=mysql_fetch_assoc($pq);
|
||||
$reg['project']=$p;
|
||||
|
||||
//and finally, the status breakdown for the entire registration
|
||||
$reg['status']=participant_status_completion_details(null,$id);
|
||||
return $reg;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user