Add basic project info to registration/view

This commit is contained in:
james 2011-03-03 01:53:04 +00:00
parent 0d365bc731
commit cd140c198a
2 changed files with 9 additions and 1 deletions

View File

@ -879,8 +879,9 @@ switch($request[0]) {
/* APIDOC: registration/view /* APIDOC: registration/view
description(registration information about the currently logged in users registration) 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(student: {id,accounts_id,username,firstname,lastname,complete})
object(project: {id,projectnumber,title})
return(registration array) return(registration array)
*/ */
case 'view': case 'view':

View File

@ -421,12 +421,19 @@ function getRegistration($id) {
$reg=mysql_fetch_assoc($q); $reg=mysql_fetch_assoc($q);
if(!$reg) return null; 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']}'"); $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)) { while($r=mysql_fetch_assoc($s)) {
$r['complete']=studentIndividualStatus($r['id']); $r['complete']=studentIndividualStatus($r['id']);
$reg['students'][]=$r; $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); $reg['status']=participant_status_completion_details(null,$id);
return $reg; return $reg;
} }